MayaFlux 1.0.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 440 of file NodeGraphManager.cpp.

442{
443 if (!network) {
444 return;
445 }
446
448
449 network->set_enabled(true);
450
451 if (network->get_output_mode() == Network::OutputMode::AUDIO_SINK
452 || network->get_output_mode() == Network::OutputMode::AUDIO_COMPUTE) {
453 uint32_t channel_mask = network->get_channel_mask();
454
455 if (channel_mask == 0) {
456 channel_mask = 1;
457 network->add_channel_usage(0);
458 }
459
460 auto channels = network->get_registered_channels();
461 auto& audio = m_audio_networks[token];
462 if (std::ranges::find(audio, network) == audio.end()) {
463 audio.push_back(network);
464 }
465
466 for (auto ch : channels) {
467 ensure_root_exists(token, ch);
470 "Added audio network to token {} channel {}: {} nodes",
471 static_cast<int>(token), ch, network->get_node_count());
472 }
473
474 } else {
475 auto& others = m_token_networks[token];
476 if (std::ranges::find(others, network) == others.end()) {
477 others.push_back(network);
478 }
479
482 "Added network to token {}: {} nodes, mode={}",
483 static_cast<int>(token),
484 network->get_node_count(),
485 static_cast<int>(network->get_output_mode()));
486 }
487}
#define MF_INFO(comp, ctx,...)
Core::GlobalNetworkConfig network
Definition Config.cpp:43
uint32_t channels
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, channels, 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: