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

◆ processing_function()

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

Captures node computation output into a buffer.

Parameters
bufferBuffer to store the processed data

This method implements a configurable data flow pattern:

  1. Optionally resets the buffer if clear_before_process is true
  2. Generates sequential values from the computational node
  3. Applies the specified interpolation between existing and incoming data

Implements MayaFlux::Buffers::BufferProcessor.

Definition at line 14 of file NodeBuffer.cpp.

15{
16 if (!m_node) {
17 MF_RT_ERROR(Journal::Component::Buffers, Journal::Context::BufferProcessing, "NodeSourceProcessor has null node. Skipping processing.");
18 return;
19 }
20
21 try {
22 auto& buffer_data = std::dynamic_pointer_cast<AudioBuffer>(buffer)->get_data();
23
24 bool should_clear = m_clear_before_process;
25 if (auto node_buffer = std::dynamic_pointer_cast<NodeBuffer>(buffer)) {
26 should_clear = node_buffer->get_clear_before_process();
27 }
28
29 if (should_clear) {
30 buffer->clear();
31 }
32
33 update_buffer(buffer_data);
34
35 } catch (const std::exception& e) {
36 error_rethrow(Journal::Component::Buffers, Journal::Context::BufferProcessing, std::source_location::current(), "Error processing node: {}", e.what());
37 }
38}
#define MF_RT_ERROR(comp, ctx,...)
bool m_clear_before_process
Whether to reset the buffer before adding node output.
void update_buffer(std::vector< double > &buffer_data)
Updates the buffer data with node output.
std::shared_ptr< Nodes::Node > m_node
Source node that generates sequential data values.
@ BufferProcessing
Buffer processing (Buffers::BufferManager, processing chains)
void error_rethrow(Component component, Context context, std::source_location location=std::source_location::current(), std::string_view additional_context="")
Catch and log an exception, then rethrow it.
@ Buffers
Buffers, Managers, processors and processing chains.

References MayaFlux::Journal::BufferProcessing, MayaFlux::Journal::Buffers, m_clear_before_process, m_node, MF_RT_ERROR, and update_buffer().

+ Here is the call graph for this function: