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

◆ processing_function()

void MayaFlux::Buffers::LogicProcessor::processing_function ( const 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 343 of file LogicProcessor.cpp.

344{
345 if (!m_logic || !buffer) {
346 return;
347 }
348
349 auto audio_buffer = std::dynamic_pointer_cast<AudioBuffer>(buffer);
350 if (!audio_buffer || audio_buffer->get_data().empty()) {
351 return;
352 }
353
354 generate(audio_buffer->get_num_samples(), audio_buffer->get_data());
355 apply(buffer);
356}
std::shared_ptr< NetworkGeometryBuffer > buffer
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(), buffer, generate(), and m_logic.

+ Here is the call graph for this function: