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

◆ process_audio_networks()

std::vector< std::vector< double > > MayaFlux::Nodes::NodeGraphManager::process_audio_networks ( ProcessingToken  token,
uint32_t  num_samples,
uint32_t  channel = 0 
)

Process audio networks for a specific channel.

Parameters
tokenProcessing domain (should be AUDIO_RATE)
num_samplesNumber of samples/frames to process
channelChannel index within that domain
Returns
Vector of processed audio data from all networks for that channel

Processes all audio-sink networks registered to the specified channel and returns their combined output data.

Definition at line 115 of file NodeGraphManager.cpp.

116{
118 return {};
119 }
120
121 std::vector<std::vector<double>> all_network_outputs;
122
123 auto audio_it = m_audio_networks.find(token);
124 if (audio_it != m_audio_networks.end()) {
125 for (auto& network : audio_it->second) {
126 if (!network || !network->is_enabled()) {
127 continue;
128 }
129
130 if (!network->is_registered_on_channel(channel)) {
131 continue;
132 }
133
134 if (!network->is_processed_this_cycle()) {
135 network->mark_processing(true);
136 network->process_batch(num_samples);
137 network->mark_processing(false);
138 network->mark_processed(true);
139 }
140
141 const auto& net_buffer = network->get_audio_buffer();
142 if (net_buffer) {
143 all_network_outputs.push_back(*net_buffer);
144 }
145 }
146 }
147
148 postprocess_networks(token, channel);
149 return all_network_outputs;
150}
static MayaFlux::Nodes::ProcessingToken token
Definition Timers.cpp:8
bool preprocess_networks(ProcessingToken token)
Preprocess networks for a specific token.
void postprocess_networks(ProcessingToken token, std::optional< uint32_t > channel)
Postprocess networks for a specific token and channel.
std::unordered_map< ProcessingToken, std::vector< std::shared_ptr< Network::NodeNetwork > > > m_audio_networks
Audio-sink networks Only populated for networks with OutputMode::AUDIO_SINK.

References m_audio_networks, postprocess_networks(), preprocess_networks(), and token.

+ Here is the call graph for this function: