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

◆ bind_callable()

void MayaFlux::Kakshya::PlotProcessor::bind_callable ( uint32_t  series_index,
std::function< void(std::vector< double > &)>  fn 
)

Bind a series slot to a callable.

Each process() calls fn with the series vector by reference. The callable fills or mutates it freely. Suitable for computed series, ring buffer views, and any source that does not fit the other patterns.

Parameters
series_indexIndex returned by PlotContainer::add_series().
fnCallable invoked with the series vector each process().

Definition at line 78 of file PlotProcessor.cpp.

80{
81 if (!fn) {
82 MF_ERROR(C, X, "PlotProcessor::bind_callable: null callable for series {}", series_index);
83 return;
84 }
85 auto& b = m_bindings[series_index];
86 b.source_type = SourceType::CALLABLE;
87 b.callable = std::move(fn);
88 b.node.reset();
89 b.audio_buffer.reset();
90 b.network.reset();
91}
#define MF_ERROR(comp, ctx,...)
size_t b
std::unordered_map< uint32_t, SeriesBinding > m_bindings

References b, CALLABLE, m_bindings, and MF_ERROR.