Captures node computation output into a buffer.
31{
34 return;
35 }
36
37 try {
38 auto& buffer_data = std::dynamic_pointer_cast<AudioBuffer>(buffer)->get_data();
39
41 if (auto node_buffer = std::dynamic_pointer_cast<NodeBuffer>(buffer)) {
42 should_clear = node_buffer->get_clear_before_process();
43 }
44
45 if (should_clear) {
46 buffer->clear();
47 }
48
50
51 } catch (const std::exception& e) {
53 }
54}
#define MF_RT_ERROR(comp, ctx,...)
bool m_clear_before_process
Whether to reset the buffer before adding node output.
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.
void update_buffer_with_node_data(const std::shared_ptr< Nodes::Node > &node, std::span< double > buffer, double mix)
Apply node output to an existing buffer with mixing.
@ 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.