MayaFlux 0.4.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 54 of file PlotProcessor.cpp.

56{
57 if (!network) {
58 MF_ERROR(C, X, "PlotProcessor::bind_network: null network for series {}", series_index);
59 return;
60 }
61
62 const auto mode = network->get_output_mode();
65 MF_ERROR(C, X,
66 "PlotProcessor::bind_network: network for series {} has no audio output mode", series_index);
67 return;
68 }
69
70 auto& b = m_bindings[series_index];
71 b.source_type = SourceType::NETWORK;
72 b.network = std::move(network);
73 b.node.reset();
74 b.audio_buffer.reset();
75 b.callable = {};
76}
#define MF_ERROR(comp, ctx,...)
Core::GlobalNetworkConfig network
Definition Config.cpp:37
size_t b
std::unordered_map< uint32_t, SeriesBinding > m_bindings
std::vector< double > mode(std::span< const double > data, size_t n_windows, uint32_t hop_size, uint32_t window_size)
Mode per window via tolerance-bucketed frequency count.
Definition Analysis.cpp:559
@ 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, network, and NETWORK.