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

◆ write_sample()

void MayaFlux::Kakshya::PlotContainer::write_sample ( uint32_t  index,
uint64_t  sample_index,
double  value 
)

Write a single sample within a series.

Parameters
indexSeries index.
sample_indexSample position within the series.
valueValue to write.

Definition at line 72 of file PlotContainer.cpp.

73{
74 if (index >= m_data.size()) {
75 MF_ERROR(C, X, "PlotContainer::write_sample: series index {} out of range", index);
76 return;
77 }
78
79 auto* vec = std::get_if<std::vector<double>>(&m_data[index]);
80 if (!vec || sample_index >= vec->size()) {
81 MF_ERROR(C, X, "PlotContainer::write_sample: sample index {} out of range in series {}", sample_index, index);
82 return;
83 }
84
85 (*vec)[sample_index] = value;
86}
#define MF_ERROR(comp, ctx,...)
std::vector< DataVariant > m_data

References m_data, and MF_ERROR.