9TimeSpec
Time(
double seconds)
11 return TimeSpec { seconds };
16 auto node = wrapper.entity();
17 const auto& spec = wrapper.spec();
21 auto activation = std::make_shared<Kriya::TemporalActivation>(
25 activation->activate_node(node, spec.seconds, node_token, ctx.
channels.value());
26 }
else if (ctx.
channel.has_value()) {
27 activation->activate_node(node, spec.seconds, node_token, { ctx.channel.value() });
29 activation->activate_node(node, spec.seconds, node_token);
32 static std::vector<std::shared_ptr<Kriya::TemporalActivation>> active_timers;
33 active_timers.push_back(activation);
35 if (active_timers.size() > 100) {
36 std::erase_if(active_timers, [](
const std::shared_ptr<Kriya::TemporalActivation>& t) {
37 return !t->is_active();
46 auto buffer = wrapper.entity();
47 const auto& spec = wrapper.spec();
51 auto activation = std::make_shared<Kriya::TemporalActivation>(
55 activation->activate_buffer(buffer, spec.seconds, buffer_token, ctx.
channel.value());
57 activation->activate_buffer(buffer, spec.seconds, buffer_token, ctx.
channels.value()[0]);
59 activation->activate_buffer(buffer, spec.seconds, buffer_token);
62 static std::vector<std::shared_ptr<Kriya::TemporalActivation>> active_timers;
63 active_timers.push_back(activation);
65 if (active_timers.size() > 100) {
66 std::erase_if(active_timers, [](
const std::shared_ptr<Kriya::TemporalActivation>& t) {
67 return !t->is_active();
74std::shared_ptr<Nodes::Network::NodeNetwork>
operator|(
const TemporalWrapper<Nodes::Network::NodeNetwork>& wrapper,
const CreationContext& ctx)
76 auto network = wrapper.entity();
77 const auto& spec = wrapper.spec();
81 auto activation = std::make_shared<Kriya::TemporalActivation>(
84 activation->activate_network(
network, spec.seconds, node_token);
86 static std::vector<std::shared_ptr<Kriya::TemporalActivation>> active_timers;
87 active_timers.push_back(activation);
89 if (active_timers.size() > 100) {
90 std::erase_if(active_timers, [](
const std::shared_ptr<Kriya::TemporalActivation>& t) {
91 return !t->is_active();
Core::GlobalNetworkConfig network
MAYAFLUX_API Vruta::ProcessingToken get_task_token(Domain domain)
Extracts task processing token from domain.
MAYAFLUX_API Nodes::ProcessingToken get_node_token(Domain domain)
Extracts node processing token from domain.
std::shared_ptr< Nodes::NodeGraphManager > get_node_graph_manager()
Gets the node graph manager from the default engine.
TimeSpec Time(double seconds)
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.
std::shared_ptr< T > operator|(std::shared_ptr< T > obj, const CreationContext &ctx)
MAYAFLUX_API Buffers::ProcessingToken get_buffer_token(Domain domain)
Extracts buffer processing token from domain.
Main namespace for the Maya Flux audio engine.
std::optional< uint32_t > channel
std::optional< std::vector< uint32_t > > channels
std::optional< Domain > domain