Processes a single sample from all registered nodes.
- Returns
- Combined output sample from all nodes
This method processes each registered node and combines their outputs into a single sample. It is typically called in a loop to process multiple samples, but can also be used for single-sample processing.
Definition at line 73 of file RootNode.cpp.
74{
76 return 0.;
77
78 auto sample = 0.;
79
81 if (!node)
82 continue;
83
84 uint32_t state = node->m_state.load();
85 double node_output = 0.0;
86
88 node_output = node->process_sample();
90 } else {
91 node_output = node->get_last_output();
92 }
93
94 if (node->is_output_excluded_from_graph()) {
95 continue;
96 }
97
98 if (node->needs_channel_routing()) {
99 node_output *= node->get_routing_state().amount[
m_channel];
100 }
101
102 sample += node_output;
103 }
104
106
107 return sample;
108}
std::vector< std::shared_ptr< Node > > m_Nodes
Collection of nodes registered with this root node.
uint32_t m_channel
The processing channel index for this root node.
bool preprocess()
Checks if the root node can process pending operations.
void postprocess()
Performs post-processing after all nodes have been processed.
@ PROCESSED
Node has been processed this cycle.
void atomic_add_flag(std::atomic< NodeState > &state, NodeState flag)
Atomically adds a flag to a node state.
References MayaFlux::Nodes::atomic_add_flag(), m_channel, m_Nodes, postprocess(), preprocess(), and MayaFlux::Nodes::PROCESSED.
Referenced by process_batch().