11 return { seconds, channel };
16 return { seconds, std::move(channels) };
21 auto node = wrapper.
entity();
22 const auto& spec = wrapper.
spec();
27 if (spec.channels.has_value()) {
28 activation->activate_node(node, spec.seconds,
node_token, spec.channels.value());
30 activation->activate_node(node, spec.seconds,
node_token);
33 static std::vector<std::shared_ptr<Kriya::TemporalActivation>> active_timers;
34 active_timers.push_back(activation);
36 if (active_timers.size() > 100) {
37 std::erase_if(active_timers, [](
const std::shared_ptr<Kriya::TemporalActivation>& t) {
38 return !t->is_active();
47 auto buffer = wrapper.
entity();
48 const auto& spec = wrapper.
spec();
53 if (spec.channels.has_value() && !spec.channels.value().empty()) {
54 activation->activate_buffer(buffer, spec.seconds, buffer_token, spec.channels.value()[0]);
56 activation->activate_buffer(buffer, spec.seconds, buffer_token);
59 static std::vector<std::shared_ptr<Kriya::TemporalActivation>> active_timers;
60 active_timers.push_back(activation);
62 if (active_timers.size() > 100) {
63 std::erase_if(active_timers, [](
const std::shared_ptr<Kriya::TemporalActivation>& t) {
64 return !t->is_active();
73 auto network = wrapper.
entity();
74 const auto& spec = wrapper.
spec();
78 activation->activate_network(network, spec.seconds,
node_token);
80 static std::vector<std::shared_ptr<Kriya::TemporalActivation>> active_timers;
81 active_timers.push_back(activation);
83 if (active_timers.size() > 100) {
84 std::erase_if(active_timers, [](
const std::shared_ptr<Kriya::TemporalActivation>& t) {
85 return !t->is_active();
static const auto node_token
const TimeSpec & spec() const
std::shared_ptr< T > entity() const
Wraps an entity with a TimeSpec for temporal activation.
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.
std::shared_ptr< Nodes::Node > operator|(const std::shared_ptr< Nodes::Node > &node, Domain d)
TimeSpec Time(double seconds, uint32_t channel)
Creates a TimeSpec with the specified duration and a single channel.
Domain
Unified domain enum combining all three ProcessingToken subsystems.
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.
Main namespace for the Maya Flux audio engine.
Represents a timed activation operation for processing nodes, buffers, or networks.