Acquire data from all bound sources and write into the container.
For each bound series: acquires from source, writes into container m_data, then copies m_data into processed_data. Unbound series are left unchanged. Called from the graphics thread by Forma before the geometry function runs.
147{
148 auto plot = std::dynamic_pointer_cast<PlotContainer>(container);
149 if (!plot) {
150 MF_ERROR(C, X,
"PlotProcessor::process: container is not a PlotContainer");
151 return;
152 }
153
155
157 if (idx >=
plot->series_count())
158 continue;
159
160 thread_local std::vector<double> staging;
161 staging.resize(
plot->series_size(idx));
162
163 {
164 auto frame =
plot->get_frame(idx);
165 if (frame.size() == staging.size()) {
166 std::ranges::copy(frame, staging.begin());
167 } else {
168 std::ranges::fill(staging, 0.0);
169 }
170 }
171
172 switch (
b.source_type) {
175 break;
178 break;
181 break;
184 break;
187 break;
188 }
189
190 plot->write_series(idx, staging);
191 }
192
193 auto& src =
plot->get_data();
194 auto& dst =
plot->get_processed_data();
195 dst.resize(src.size());
196 for (size_t i = 0; i < src.size(); ++i)
197 dst[i] = src[i];
198
200}
#define MF_ERROR(comp, ctx,...)
void acquire_from_raw(SeriesBinding &b, std::vector< double > &series)
std::atomic< bool > m_processing
std::unordered_map< uint32_t, SeriesBinding > m_bindings
void acquire_from_audio_buffer(SeriesBinding &b, std::vector< double > &series)
void acquire_from_callable(SeriesBinding &b, std::vector< double > &series)
void acquire_from_node(SeriesBinding &b, std::vector< double > &series)
void acquire_from_network(SeriesBinding &b, std::vector< double > &series)