MayaFlux 0.4.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 476 of file NodeGraphManager.cpp.

478{
479 if (!network) {
480 return;
481 }
482
484
485 network->set_enabled(true);
486
487 if (network->get_output_mode() == Network::OutputMode::AUDIO_SINK
488 || network->get_output_mode() == Network::OutputMode::AUDIO_COMPUTE) {
489 uint32_t channel_mask = network->get_channel_mask();
490
491 if (channel_mask == 0) {
492 channel_mask = 1;
493 network->add_channel_usage(0);
494 }
495
496 auto channels = network->get_registered_channels();
497 m_audio_networks[token].push_back(network);
498
499 for (auto ch : channels) {
500 ensure_root_exists(token, ch);
503 "Added audio network to token {} channel {}: {} nodes",
504 static_cast<int>(token), ch, network->get_node_count());
505 }
506
507 } else {
508 m_token_networks[token].push_back(network);
509
512 "Added network to token {}: {} nodes, mode={}",
513 static_cast<int>(token),
514 network->get_node_count(),
515 static_cast<int>(network->get_output_mode()));
516 }
517}
#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: