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

◆ add_network()

void MayaFlux::Nodes::NodeGraphManager::add_network ( const std::shared_ptr< NodeNetwork > &  network,
ProcessingToken  token 
)

Add a network to a processing token.

Parameters
networkNetwork to add
tokenProcessing domain (AUDIO_RATE, VISUAL_RATE, etc.)

Networks are processed parallel to RootNodes, managing their own internal node coordination and processing.

Definition at line 437 of file NodeGraphManager.cpp.

439{
440 if (!network) {
441 return;
442 }
443
445
446 network->set_enabled(true);
447
448 if (network->get_output_mode() == NodeNetwork::OutputMode::AUDIO_SINK) {
449 uint32_t channel_mask = network->get_channel_mask();
450
451 if (channel_mask == 0) {
452 channel_mask = 1;
453 network->add_channel_usage(0);
454 }
455
456 auto channels = network->get_registered_channels();
457 for (auto ch : channels) {
459 m_audio_networks[token][ch].push_back(network);
460
463 "Added audio network to token {} channel {}: {} nodes",
464 static_cast<int>(token), ch, network->get_node_count());
465 }
466
467 } else {
468 m_token_networks[token].push_back(network);
469
472 "Added network to token {}: {} nodes, mode={}",
473 static_cast<int>(token),
474 network->get_node_count(),
475 static_cast<int>(network->get_output_mode()));
476 }
477}
#define MF_INFO(comp, ctx,...)
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.
void ensure_root_exists(ProcessingToken token, unsigned int channel)
Ensures a root node exists for the given token and channel.
std::unordered_map< ProcessingToken, std::vector< std::shared_ptr< NodeNetwork > > > m_token_networks
Non-audio networks (token-level processing) For NONE, GRAPHICS_BIND, CUSTOM output modes.
void register_network_global(const std::shared_ptr< NodeNetwork > &network)
Register network globally (like nodes)
@ AUDIO_SINK
Aggregated audio samples sent to output.
@ NodeProcessing
Node graph processing (Nodes::NodeGraphManager)
@ Nodes
DSP Generator and Filter Nodes, graph pipeline, node management.

References MayaFlux::Nodes::NodeNetwork::AUDIO_SINK, ensure_root_exists(), m_audio_networks, m_token_networks, MF_INFO, MayaFlux::Journal::NodeProcessing, MayaFlux::Journal::Nodes, register_network_global(), and token.

+ Here is the call graph for this function: