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

◆ update_buffer()

void MayaFlux::Buffers::NodeSourceProcessor::update_buffer ( std::vector< double > &  buffer_data)
private

Updates the buffer data with node output.

Parameters
buffer_dataReference to the buffer's data vector

This method applies the node-generated data to the buffer according to the configured interpolation coefficient and clear_before_process setting.

Definition at line 60 of file NodeBuffer.cpp.

61{
62 const auto& state = m_node->m_state.load();
63 if (state == Utils::NodeState::INACTIVE) {
64 for (double& i : buffer_data) {
65 i += m_node->process_sample(0.F) * m_mix;
66 }
67 return;
68 }
69 m_node->save_state();
70
71 for (double& i : buffer_data) {
72 i += m_node->process_sample(0.F) * m_mix;
73 }
74 m_node->restore_state();
75}
float m_mix
Interpolation coefficient between existing and incoming data (0.0-1.0)
std::shared_ptr< Nodes::Node > m_node
Source node that generates sequential data values.
@ INACTIVE
Engine is not processing this node.
Definition Utils.hpp:29

References MayaFlux::Utils::INACTIVE, m_mix, and m_node.

Referenced by processing_function().

+ Here is the caller graph for this function: