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

◆ operator|() [3/7]

std::shared_ptr< Nodes::Node > MayaFlux::operator| ( const TemporalWrapper< Nodes::Node > &  wrapper,
const CreationContext ctx 
)

Definition at line 14 of file Temporal.cpp.

15{
16 auto node = wrapper.entity();
17 const auto& spec = wrapper.spec();
18 auto node_token = get_node_token(ctx.domain.value());
19
20 auto activation = std::make_shared<Kriya::TemporalActivation>(
22
23 if (ctx.channels.has_value()) {
24 activation->activate_node(node, spec.seconds, node_token, ctx.channels.value());
25 } else if (ctx.channel.has_value()) {
26 activation->activate_node(node, spec.seconds, node_token, { ctx.channel.value() });
27 } else {
28 activation->activate_node(node, spec.seconds, node_token);
29 }
30
31 static std::vector<std::shared_ptr<Kriya::TemporalActivation>> active_timers;
32 active_timers.push_back(activation);
33
34 if (active_timers.size() > 100) {
35 std::erase_if(active_timers, [](const std::shared_ptr<Kriya::TemporalActivation>& t) {
36 return !t->is_active();
37 });
38 }
39
40 return node;
41}
static const auto node_token
Definition Chain.cpp:9
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:132
std::shared_ptr< Vruta::TaskScheduler > get_scheduler()
Gets the task scheduler from the default engine.
Definition Chronie.cpp:22
std::optional< uint32_t > channel
Definition Creator.hpp:22
std::optional< std::vector< uint32_t > > channels
Definition Creator.hpp:23
std::optional< Domain > domain
Definition Creator.hpp:21

References MayaFlux::CreationContext::channel, MayaFlux::CreationContext::channels, MayaFlux::CreationContext::domain, get_buffer_manager(), get_node_graph_manager(), get_node_token(), get_scheduler(), and node_token.

+ Here is the call graph for this function: