Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
|
The Router class manages the processing graph for the audio engine. More...
#include <src/engine/session/router.h>
Public Member Functions | |
Router (device_io::AudioEngine *engine=nullptr) | |
void | recalc_graph (bool soft) |
Recalculates the process acyclic directed graph. | |
void | start_cycle (EngineProcessTimeInfo time_nfo) |
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::binary_semaphore | graph_access_sem_ { 1 } |
Used when recalculating the graph. | |
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 Router class manages the processing graph for the audio engine.
The Router 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.
|
inlinenodiscard |
|
inlinenodiscard |
void zrythm::engine::session::Router::recalc_graph | ( | bool | soft | ) |
Recalculates the process acyclic directed graph.
soft | If true, only readjusts latencies. |
device_io::AudioEngine* zrythm::engine::session::Router::audio_engine_ {} |
bool zrythm::engine::session::Router::callback_in_progress_ = false |
nframes_t zrythm::engine::session::Router::global_offset_ = 0 |
std::binary_semaphore zrythm::engine::session::Router::graph_access_sem_ { 1 } |
std::atomic<bool> zrythm::engine::session::Router::graph_setup_in_progress_ = false |
nframes_t zrythm::engine::session::Router::max_route_playback_latency_ = 0 |
unsigned int zrythm::engine::session::Router::process_kickoff_thread_ = 0 |
std::unique_ptr<dsp::graph::GraphScheduler> zrythm::engine::session::Router::scheduler_ |
EngineProcessTimeInfo zrythm::engine::session::Router::time_nfo_ |