MayaFlux 0.3.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ operator|() [5/7]

MAYAFLUX_API std::shared_ptr< Nodes::Network::NodeNetwork > MayaFlux::operator| ( const TemporalWrapper< Nodes::Network::NodeNetwork > &  wrapper,
Domain  domain 
)

Activates a node network in a specific domain for the duration specified by the TemporalWrapper.

This operator overload implements the syntax:

network >> Time(2.0, {0, 1}) | domain;
TimeSpec Time(double seconds, uint32_t channel)
Creates a TimeSpec with the specified duration and a single channel.
Definition Temporal.cpp:9

It activates the wrapped node network in the given domain for the specified duration and channels.

Parameters
wrapperThe TemporalWrapper containing the node network and timing information.
domainThe domain in which to activate the network.
Returns
A shared pointer to the activated node network.

Definition at line 71 of file Temporal.cpp.

72{
73 auto network = wrapper.entity();
74 const auto& spec = wrapper.spec();
75 auto node_token = get_node_token(domain);
76
77 auto activation = std::make_shared<Kriya::TemporalActivation>(*get_scheduler(), *get_node_graph_manager(), *get_buffer_manager());
78 activation->activate_network(network, spec.seconds, node_token);
79
80 static std::vector<std::shared_ptr<Kriya::TemporalActivation>> active_timers;
81 active_timers.push_back(activation);
82
83 if (active_timers.size() > 100) {
84 std::erase_if(active_timers, [](const std::shared_ptr<Kriya::TemporalActivation>& t) {
85 return !t->is_active();
86 });
87 }
88
89 return network;
90}
static const auto node_token
Definition Chain.cpp:9
const TimeSpec & spec() const
Definition Temporal.hpp:100
std::shared_ptr< T > entity() const
Definition Temporal.hpp:99
MAYAFLUX_API Nodes::ProcessingToken get_node_token(Domain domain)
Extracts node processing token from domain.
Definition Domain.hpp:174
std::shared_ptr< Nodes::NodeGraphManager > get_node_graph_manager()
Gets the node graph manager from the default engine.
Definition Graph.cpp:35
std::shared_ptr< Buffers::BufferManager > get_buffer_manager()
Gets the buffer manager from the default engine.
Definition Graph.cpp:133
std::shared_ptr< Vruta::TaskScheduler > get_scheduler()
Gets the task scheduler from the default engine.
Definition Chronie.cpp:20

References MayaFlux::TemporalWrapper< T >::entity(), get_buffer_manager(), get_node_graph_manager(), get_node_token(), get_scheduler(), node_token, and MayaFlux::TemporalWrapper< T >::spec().

+ Here is the call graph for this function: