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 435 of file NodeGraphManager.cpp.

437{
438 if (!network) {
439 return;
440 }
441
443
444 network->set_enabled(true);
445
446 if (network->get_output_mode() == Network::OutputMode::AUDIO_SINK
447 || network->get_output_mode() == Network::OutputMode::AUDIO_COMPUTE) {
448 uint32_t channel_mask = network->get_channel_mask();
449
450 if (channel_mask == 0) {
451 channel_mask = 1;
452 network->add_channel_usage(0);
453 }
454
455 auto channels = network->get_registered_channels();
456 m_audio_networks[token].push_back(network);
457
458 for (auto ch : channels) {
459 ensure_root_exists(token, ch);
462 "Added audio network to token {} channel {}: {} nodes",
463 static_cast<int>(token), ch, network->get_node_count());
464 }
465
466 } else {
467 m_token_networks[token].push_back(network);
468
471 "Added network to token {}: {} nodes, mode={}",
472 static_cast<int>(token),
473 network->get_node_count(),
474 static_cast<int>(network->get_output_mode()));
475 }
476}
#define MF_INFO(comp, ctx,...)
Core::GlobalNetworkConfig network
Definition Config.cpp:37
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, network, 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: