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

◆ execute() [2/2]

void MayaFlux::Kriya::Sequence::execute ( const std::shared_ptr< Nodes::NodeGraphManager > &  node_manager,
const std::shared_ptr< Vruta::TaskScheduler > &  scheduler 
)

Executes the sequence with explicit managers.

Parameters
node_managerThe NodeGraphManager to use for node connections
schedulerThe TaskScheduler to use for timing

This method executes the sequence of actions using the provided node manager and scheduler. This allows for more control over which managers are used, which is useful in contexts where multiple processing engines might exist.

The actions are executed in the order they were added, with any time delays respected.

Definition at line 83 of file Chain.cpp.

84{
85 EventChain chain(*scheduler);
86 double accumulated_time = 0.F;
87
88 for (const auto& token : tokens) {
89 if (token.type == Utils::ActionType::NODE) {
90 chain.then([node = token.node, node_manager]() {
91 auto& root = node_manager->get_root_node(node_token, 0);
92 root.register_node(node);
93 },
94 accumulated_time);
95 accumulated_time = 0.F;
96 } else if (token.type == Utils::ActionType::TIME) {
97 accumulated_time += token.seconds;
98 } else if (token.type == Utils::ActionType::FUNCTION) {
99 chain.then(token.func, accumulated_time);
100 accumulated_time = 0.F;
101 }
102 }
103 chain.start();
104}
static MayaFlux::Nodes::ProcessingToken token
Definition Timers.cpp:8
std::vector< ActionToken > tokens
Collection of actions in this sequence.
Definition Chain.hpp:289

References MayaFlux::Utils::FUNCTION, MayaFlux::Utils::NODE, node_token, MayaFlux::Kriya::EventChain::start(), MayaFlux::Kriya::EventChain::then(), MayaFlux::Utils::TIME, token, and tokens.

+ Here is the call graph for this function: