44{
45 auto buffer = wrapper.entity();
46 const auto& spec = wrapper.spec();
48
49 auto activation = std::make_shared<Kriya::TemporalActivation>(
51
53 activation->activate_buffer(buffer, spec.seconds, buffer_token, ctx.
channel.value());
55 activation->activate_buffer(buffer, spec.seconds, buffer_token, ctx.
channels.value()[0]);
56 } else {
57 activation->activate_buffer(buffer, spec.seconds, buffer_token);
58 }
59
60 static std::vector<std::shared_ptr<Kriya::TemporalActivation>> active_timers;
61 active_timers.push_back(activation);
62
63 if (active_timers.size() > 100) {
64 std::erase_if(active_timers, [](const std::shared_ptr<Kriya::TemporalActivation>& t) {
65 return !t->is_active();
66 });
67 }
68
69 return buffer;
70}
std::shared_ptr< Nodes::NodeGraphManager > get_node_graph_manager()
Gets the node graph manager from the default engine.
std::shared_ptr< Buffers::BufferManager > get_buffer_manager()
Gets the buffer manager from the default engine.
std::shared_ptr< Vruta::TaskScheduler > get_scheduler()
Gets the task scheduler from the default engine.
MAYAFLUX_API Buffers::ProcessingToken get_buffer_token(Domain domain)
Extracts buffer processing token from domain.
std::optional< uint32_t > channel
std::optional< std::vector< uint32_t > > channels
std::optional< Domain > domain