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

◆ processing_function()

void MayaFlux::Buffers::LogicProcessor::processing_function ( std::shared_ptr< Buffer buffer)
overridevirtual

Processes a buffer through the logic node.

Parameters
bufferThe audio buffer to process

Processing steps:

  1. Iterates through each sample in the buffer
  2. Calls Logic node's process_sample() for each sample to get logic value
  3. Applies the selected modulation strategy to combine logic with buffer data

The Logic node handles all temporal state, callbacks, and logic computation. The processor only manages iteration and modulation application.

Implements MayaFlux::Buffers::BufferProcessor.

Definition at line 170 of file LogicProcessor.cpp.

171{
172 if (!m_logic || !buffer) {
173 return;
174 }
175
176 auto audio_buffer = std::dynamic_pointer_cast<AudioBuffer>(buffer);
177 if (!audio_buffer || audio_buffer->get_data().empty()) {
178 return;
179 }
180
181 generate(audio_buffer->get_num_samples(), audio_buffer->get_data());
182 apply(buffer);
183}
bool generate(size_t num_samples, const std::vector< double > &input_data)
Generates discrete logic data from input without modifying any buffer.
std::shared_ptr< Nodes::Generator::Logic > m_logic
Logic node for processing.
bool apply(const std::shared_ptr< Buffer > &buffer, ModulationFunction modulation_func=nullptr)
Applies stored logic data to the given buffer.

References apply(), generate(), and m_logic.

+ Here is the call graph for this function: