Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
zrythm::dsp::DspGraphDispatcher Class Referencefinal

The DspGraphDispatcher class manages the processing graph for the audio engine. More...

#include <src/dsp/graph_dispatcher.h>

Public Types

using RunFunctionWithEngineLock = std::function<void (std::function<void ()>)>

Public Member Functions

 DspGraphDispatcher (std::unique_ptr< graph::IGraphBuilder > graph_builder, std::vector< graph::IProcessable * > terminal_processables, const juce::AudioDeviceManager &device_manager, RunFunctionWithEngineLock run_function_with_engine_lock, graph::GraphScheduler::RunOnMainThreadFunc run_on_main_thread)
void recalc_graph (bool soft)
 Recalculates the process acyclic directed graph.
void start_cycle (const dsp::ITransport &current_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.
auto & current_trigger_nodes () const
 Accessor for currently active trigger nodes.

Detailed Description

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 24 of file graph_dispatcher.h.

Member Typedef Documentation

◆ RunFunctionWithEngineLock

using zrythm::dsp::DspGraphDispatcher::RunFunctionWithEngineLock = std::function<void (std::function<void ()>)>

Definition at line 27 of file graph_dispatcher.h.

Member Function Documentation

◆ current_trigger_nodes()

auto & zrythm::dsp::DspGraphDispatcher::current_trigger_nodes ( ) const
inline

Accessor for currently active trigger nodes.

Note
This must only be called outside of start_cycle() calls (TODO: enforce this).

Definition at line 112 of file graph_dispatcher.h.

◆ is_processing_kickoff_thread()

bool zrythm::dsp::DspGraphDispatcher::is_processing_kickoff_thread ( ) const
inlinenodiscard

Returns whether this is the thread that kicks off processing (thread that calls router_start_cycle()).

Definition at line 66 of file graph_dispatcher.h.

◆ is_processing_thread()

bool zrythm::dsp::DspGraphDispatcher::is_processing_thread ( ) const
inlinenodiscard

Returns if the current thread is a processing thread.

Definition at line 76 of file graph_dispatcher.h.

◆ recalc_graph()

void zrythm::dsp::DspGraphDispatcher::recalc_graph ( bool soft)

Recalculates the process acyclic directed graph.

Parameters
softIf true, only readjusts latencies.

◆ start_cycle()

void zrythm::dsp::DspGraphDispatcher::start_cycle ( const dsp::ITransport & current_transport_state,
EngineProcessTimeInfo time_nfo,
nframes_t remaining_latency_preroll,
bool realtime_context )
noexcept

Starts a new cycle.

Parameters
realtime_contextWhether this is called in a realtime context.
remaining_latency_prerollRemaining number of playback latency preroll samples for this cycle.

The documentation for this class was generated from the following file: