|
Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
|
The DspGraphDispatcher class manages the processing graph for the audio engine. More...
#include <src/engine/session/graph_dispatcher.h>

Public Member Functions | |
| DspGraphDispatcher (device_io::AudioEngine *engine=nullptr) | |
| void | recalc_graph (bool soft) |
| Recalculates the process acyclic directed graph. | |
| void | start_cycle (const dsp::ITransport ¤t_transport_state, EngineProcessTimeInfo time_nfo, nframes_t remaining_latency_preroll, bool realtime_context) noexcept |
| Starts a new cycle. | |
| nframes_t | get_max_route_playback_latency () |
| Returns the max playback latency of the trigger nodes. | |
| bool | is_processing_kickoff_thread () const |
| Returns whether this is the thread that kicks off processing (thread that calls router_start_cycle()). | |
| bool | is_processing_thread () const |
| Returns if the current thread is a processing thread. | |
Data Fields | |
| std::unique_ptr< dsp::graph::GraphScheduler > | scheduler_ |
| std::atomic< bool > | graph_setup_in_progress_ = false |
| An atomic variable to check if the graph is currently being setup (so that we can avoid accessing buffers changed by this). | |
| EngineProcessTimeInfo | time_nfo_ |
| Time info for this processing cycle. | |
| nframes_t | max_route_playback_latency_ = 0 |
| Stored for the currently processing cycle. | |
| nframes_t | global_offset_ = 0 |
| Current global latency offset (max latency of all routes - remaining latency from engine). | |
| std::atomic< bool > | graph_access_locked_ { false } |
| Used when recalculating the graph - atomic flag for real-time safety. | |
| std::atomic_bool | callback_in_progress_ = false |
| unsigned int | process_kickoff_thread_ = 0 |
| ID of the thread that calls kicks off the cycle. | |
| device_io::AudioEngine * | audio_engine_ {} |
The DspGraphDispatcher class manages the processing graph for the audio engine.
The DspGraphDispatcher class is responsible for maintaining the active processing graph, handling graph setup and recalculation, and managing the processing cycle. It provides methods for starting a new processing cycle, retrieving the maximum playback latency, and checking the current processing thread.
Definition at line 51 of file graph_dispatcher.h.
|
inlinenodiscard |
Returns whether this is the thread that kicks off processing (thread that calls router_start_cycle()).
Definition at line 86 of file graph_dispatcher.h.
|
inlinenodiscard |
Returns if the current thread is a processing thread.
Definition at line 94 of file graph_dispatcher.h.
| void zrythm::engine::session::DspGraphDispatcher::recalc_graph | ( | bool | soft | ) |
Recalculates the process acyclic directed graph.
| soft | If true, only readjusts latencies. |
|
noexcept |
Starts a new cycle.
| realtime_context | Whether this is called in a realtime context. |
| remaining_latency_preroll | Remaining number of playback latency preroll samples for this cycle. |
| device_io::AudioEngine* zrythm::engine::session::DspGraphDispatcher::audio_engine_ {} |
Definition at line 199 of file graph_dispatcher.h.
| std::atomic_bool zrythm::engine::session::DspGraphDispatcher::callback_in_progress_ = false |
Definition at line 194 of file graph_dispatcher.h.
| nframes_t zrythm::engine::session::DspGraphDispatcher::global_offset_ = 0 |
Current global latency offset (max latency of all routes - remaining latency from engine).
Definition at line 189 of file graph_dispatcher.h.
| std::atomic<bool> zrythm::engine::session::DspGraphDispatcher::graph_access_locked_ { false } |
Used when recalculating the graph - atomic flag for real-time safety.
Definition at line 192 of file graph_dispatcher.h.
| std::atomic<bool> zrythm::engine::session::DspGraphDispatcher::graph_setup_in_progress_ = false |
An atomic variable to check if the graph is currently being setup (so that we can avoid accessing buffers changed by this).
Definition at line 178 of file graph_dispatcher.h.
| nframes_t zrythm::engine::session::DspGraphDispatcher::max_route_playback_latency_ = 0 |
Stored for the currently processing cycle.
Definition at line 184 of file graph_dispatcher.h.
| unsigned int zrythm::engine::session::DspGraphDispatcher::process_kickoff_thread_ = 0 |
ID of the thread that calls kicks off the cycle.
Definition at line 197 of file graph_dispatcher.h.
| std::unique_ptr<dsp::graph::GraphScheduler> zrythm::engine::session::DspGraphDispatcher::scheduler_ |
Definition at line 174 of file graph_dispatcher.h.
| EngineProcessTimeInfo zrythm::engine::session::DspGraphDispatcher::time_nfo_ |
Time info for this processing cycle.
Definition at line 181 of file graph_dispatcher.h.