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

◆ add_network()

void MayaFlux::Nodes::NodeGraphManager::add_network ( const std::shared_ptr< Network::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 474 of file NodeGraphManager.cpp.

476{
477 if (!network) {
478 return;
479 }
480
482
483 network->set_enabled(true);
484
485 if (network->get_output_mode() == Network::OutputMode::AUDIO_SINK
486 || network->get_output_mode() == Network::OutputMode::AUDIO_COMPUTE) {
487 uint32_t channel_mask = network->get_channel_mask();
488
489 if (channel_mask == 0) {
490 channel_mask = 1;
491 network->add_channel_usage(0);
492 }
493
494 auto channels = network->get_registered_channels();
495 m_audio_networks[token].push_back(network);
496
497 for (auto ch : channels) {
498 ensure_root_exists(token, ch);
501 "Added audio network to token {} channel {}: {} nodes",
502 static_cast<int>(token), ch, network->get_node_count());
503 }
504
505 } else {
506 m_token_networks[token].push_back(network);
507
510 "Added network to token {}: {} nodes, mode={}",
511 static_cast<int>(token),
512 network->get_node_count(),
513 static_cast<int>(network->get_output_mode()));
514 }
515}
#define MF_INFO(comp, ctx,...)
std::unordered_map< ProcessingToken, std::vector< std::shared_ptr< Network::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< Network::NodeNetwork > &network)
Register network globally (like nodes)
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< Network::NodeNetwork > > > m_audio_networks
Audio-sink networks Only populated for networks with OutputMode::AUDIO_SINK.
@ NodeProcessing
Node graph processing (Nodes::NodeGraphManager)
@ Nodes
DSP Generator and Filter Nodes, graph pipeline, node management.
@ AUDIO_COMPUTE
processed each cycle but not sent to output
@ AUDIO_SINK
Aggregated audio samples sent to output.

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

Referenced by MayaFlux::Kriya::TemporalActivation::activate_network().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: