The core processing function that must be implemented by derived classes.
- Parameters
-
This method is where the actual transformation logic is implemented. It should contain the algorithmic details of how the buffer's data is transformed, analyzed, or processed. The implementation can utilize any backend capabilities available to the processor, including:
- Parallel Processing: Using multi-threading or GPU compute for large datasets
- Data Transformations: Applying mathematical operations, filters, or effects
- Feature Extraction: Analyzing data characteristics for further processing
Derived classes must override this method to provide specific processing behavior.
Implements MayaFlux::Buffers::BufferProcessor.
Definition at line 122 of file StreamSliceProcessor.cpp.
123{
124 auto audio = std::dynamic_pointer_cast<AudioBuffer>(
buffer);
125 if (!audio)
126 return;
127
128 const uint32_t ch = audio->get_channel_id();
129 auto&
dst = audio->get_data();
130 std::ranges::fill(
dst, 0.0);
131
133 if (!slot.slice.active || !slot.slice.stream || !slot.proc)
134 continue;
135
136 apply_slice(slot.slice, *slot.proc);
137 slot.proc->process(slot.slice.stream);
138
139 const auto& pd = slot.slice.stream->get_dynamic_data(slot.proc->get_slot_index());
140 if (pd.empty())
141 continue;
142
143 const auto structure = slot.slice.stream->get_structure();
144 std::vector<double> tmp(
dst.size(), 0.0);
146 slot.slice.source_channel.value_or(ch), tmp);
147
148 for (
size_t s = 0; s <
dst.size(); ++s)
149 dst[s] += tmp[s] * slot.slice.scale;
150 }
151}
std::shared_ptr< NetworkGeometryBuffer > buffer
std::vector< Slot > m_slots
void extract_processed_data(const std::vector< DataVariant > &pd, OrganizationStrategy organization, uint64_t num_channels, uint32_t ch, std::span< double > output)
Extract one channel's samples from a processed dynamic data block.
References buffer, dst, MayaFlux::Kakshya::extract_processed_data(), and m_slots.