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

◆ bind_network()

void MayaFlux::Kakshya::PlotProcessor::bind_network ( uint32_t  series_index,
std::shared_ptr< Nodes::Network::NodeNetwork >  network 
)

Bind a series slot to a NodeNetwork with audio output.

Each process() reads get_audio_buffer() and copies the result into the series. Fails at bind time if the network has no audio output mode.

Parameters
series_indexIndex returned by PlotContainer::add_series().
networkNodeNetwork to read from.

Definition at line 63 of file PlotProcessor.cpp.

65{
66 if (!network) {
67 MF_ERROR(C, X, "PlotProcessor::bind_network: null network for series {}", series_index);
68 return;
69 }
70
71 const auto mode = network->get_output_mode();
74 MF_ERROR(C, X,
75 "PlotProcessor::bind_network: network for series {} has no audio output mode", series_index);
76 return;
77 }
78
79 auto& b = m_bindings[series_index];
80 b.source_type = SourceType::NETWORK;
81 b.network = std::move(network);
82 release_node(b);
83 b.audio_buffer.reset();
84 b.callable = {};
85}
#define MF_ERROR(comp, ctx,...)
Core::GlobalNetworkConfig network
Definition Config.cpp:43
uint32_t mode
size_t b
std::unordered_map< uint32_t, SeriesBinding > m_bindings
@ 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, b, m_bindings, MF_ERROR, mode, network, and NETWORK.