MayaFlux 0.1.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 108 of file NodeGraphManager.cpp.

109{
111 return {};
112 }
113
114 std::vector<std::vector<double>> all_network_outputs;
115
116 auto audio_it = m_audio_networks.find(token);
117 if (audio_it != m_audio_networks.end()) {
118 auto channel_it = audio_it->second.find(channel);
119 if (channel_it != audio_it->second.end()) {
120 for (auto& network : channel_it->second) {
121 if (!network || !network->is_enabled()) {
122 continue;
123 }
124
125 if (!network->is_processed_this_cycle()) {
126 network->mark_processing(true);
127 network->process_batch(num_samples);
128 network->mark_processing(false);
129 network->mark_processed(true);
130 }
131
132 const auto& net_buffer = network->get_audio_buffer();
133 if (net_buffer) {
134 all_network_outputs.push_back(*net_buffer);
135 }
136 }
137 }
138 }
139
140 postprocess_networks(token, channel);
141 return all_network_outputs;
142}
static MayaFlux::Nodes::ProcessingToken token
Definition Timers.cpp:8
std::unordered_map< ProcessingToken, std::unordered_map< unsigned int, std::vector< std::shared_ptr< NodeNetwork > > > > m_audio_networks
Audio-sink networks (channel-routed) Only populated for networks with OutputMode::AUDIO_SINK.
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.

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

+ Here is the call graph for this function: