|
Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
|
Represents a node in a DSP graph. More...
#include <src/dsp/graph_node.h>
Public Types | |
| using | NodeId = int |
Public Member Functions | |
| GraphNode (NodeId id, IProcessable &processable) | |
| std::string | print_node_to_str () const |
| For general debugging. | |
| void | print_node () const |
| NodeId | get_id () const |
| void | process (EngineProcessTimeInfo time_nfo, nframes_t remaining_preroll_frames, const dsp::ITransport &transport) const |
| Processes the GraphNode. | |
| nframes_t | get_single_playback_latency () const |
| void | set_route_playback_latency (nframes_t dest_latency) |
| Sets the playback latency of the given node recursively. | |
| void | connect_to (GraphNode &target) |
| void | set_skip_processing (bool skip) |
| Sets whether processing should be skipped for this node. | |
| IProcessable & | get_processable () |
| auto & | feeds () const |
| Read-only access to child nodes (outgoing connections). | |
| auto & | depends () const |
| Read-only access to parent nodes (incoming connections). | |
| bool | remove_feed (const GraphNode &feed) |
| bool | remove_depend (const GraphNode &depend) |
Data Fields | |
| std::atomic< int > | refcount_ = 0 |
| Incoming node count. | |
| nframes_t | playback_latency_ = 0 |
| The playback latency of the node, in samples. | |
| nframes_t | capture_latency_ = 0 |
| The capture latency of the node, in samples. | |
| int | init_refcount_ = 0 |
| Initial incoming node count. | |
| nframes_t | route_playback_latency_ = 0 |
| The route's playback latency so far. | |
| bool | terminal_ = false |
| bool | initial_ = false |
Represents a node in a DSP graph.
GraphNode is a fundamental building block of the DSP graph, responsible for processing audio/MIDI data. It encapsulates the necessary functions and properties to handle the processing, latency compensation, and connection management within the graph.
The class provides the following key features:
GraphNode is designed to be used as part of the larger DSP graph system, providing the necessary functionality to handle the individual nodes and their interactions.
Definition at line 128 of file graph_node.h.
| using zrythm::dsp::graph::GraphNode::NodeId = int |
Definition at line 131 of file graph_node.h.
|
inline |
Read-only access to parent nodes (incoming connections).
Definition at line 196 of file graph_node.h.
|
inline |
Read-only access to child nodes (outgoing connections).
Definition at line 191 of file graph_node.h.
|
inline |
Definition at line 143 of file graph_node.h.
|
inline |
Definition at line 186 of file graph_node.h.
|
inline |
Definition at line 160 of file graph_node.h.
| void zrythm::dsp::graph::GraphNode::process | ( | EngineProcessTimeInfo | time_nfo, |
| nframes_t | remaining_preroll_frames, | ||
| const dsp::ITransport & | transport ) const |
Processes the GraphNode.
| remaining_preroll_frames | The number of frames remaining for preroll (as part of playback latency adjustment). |
| processing_cycle_in_progress | Whether the processing cycle is currently in progress (and this function is called as part of it), as opposed to being called before/after a processing cycle (e.g., for some special nodes that are processed before/after the actual processing). |
| void zrythm::dsp::graph::GraphNode::set_route_playback_latency | ( | nframes_t | dest_latency | ) |
Sets the playback latency of the given node recursively.
Used only when (re)creating the graph.
| dest_latency | The total destination latency so far. |
|
inline |
Sets whether processing should be skipped for this node.
When set to true, the node's processing function will be bypassed, effectively muting/disabling the node while keeping it in the graph.
| skip | True to skip processing, false to process normally |
Definition at line 184 of file graph_node.h.
| nframes_t zrythm::dsp::graph::GraphNode::capture_latency_ = 0 |
The capture latency of the node, in samples.
Definition at line 252 of file graph_node.h.
| int zrythm::dsp::graph::GraphNode::init_refcount_ = 0 |
Initial incoming node count.
Definition at line 255 of file graph_node.h.
| bool zrythm::dsp::graph::GraphNode::initial_ = false |
Definition at line 263 of file graph_node.h.
| nframes_t zrythm::dsp::graph::GraphNode::playback_latency_ = 0 |
The playback latency of the node, in samples.
Definition at line 243 of file graph_node.h.
| std::atomic<int> zrythm::dsp::graph::GraphNode::refcount_ = 0 |
Incoming node count.
Definition at line 235 of file graph_node.h.
| nframes_t zrythm::dsp::graph::GraphNode::route_playback_latency_ = 0 |
The route's playback latency so far.
Definition at line 258 of file graph_node.h.
| bool zrythm::dsp::graph::GraphNode::terminal_ = false |
Definition at line 262 of file graph_node.h.