33#ifndef __AUDIO_ROUTING_H__
34#define __AUDIO_ROUTING_H__
36#include "zrythm-config.h"
38#ifdef HAVE_C11_THREADS
55typedef struct PassthroughProcessor PassthroughProcessor;
66# include "weak_libjack.h"
75#define ROUTER (AUDIO_ENGINE->router)
99 bool callback_in_progress;
138WARN_UNUSED_RESULT HOT NONNULL
140 const
Router * const self)
142 return g_thread_self () == self->process_kickoff_thread;
149 1) static inline
bool router_is_processing_thread (const
Router * const self)
151#ifdef HAVE_C11_THREADS
153 static thread_local bool have_result =
false;
154 static thread_local bool is_processing_thread =
false;
156 bool have_result =
false;
157 bool is_processing_thread =
false;
160 if (G_LIKELY (have_result))
162 return is_processing_thread;
165 if (G_UNLIKELY (!self->graph))
168 is_processing_thread =
false;
172 for (
int j = 0; j < self->graph->num_threads; j++)
174 if (pthread_equal (pthread_self (), self->graph->threads[j]->pthread))
176 is_processing_thread =
true;
183 self->graph->main_thread
184 && pthread_equal (pthread_self (), self->graph->main_thread->pthread))
186 is_processing_thread =
true;
192 is_processing_thread =
false;
209router_free (
Router * self);
nframes_t router_get_max_route_playback_latency(Router *router)
Returns the max playback latency of the trigger nodes.
void router_start_cycle(Router *self, EngineProcessTimeInfo time_nfo)
Starts a new cycle.
NONNULL void router_queue_control_port_change(Router *self, const ControlPortChange *change)
Queues a control port change to be applied when processing starts.
WARN_UNUSED_RESULT HOT NONNULL ACCESS_READ_ONLY(1) static inline bool router_is_processing_kickoff_thread(const Router *const self)
Returns whether this is the thread that kicks off processing (thread that calls router_start_cycle())...
void router_recalc_graph(Router *self, bool soft)
Recalculates the process acyclic directed graph.
uint32_t nframes_t
Frame count.
Used for queueing changes to be applied during processing.
Common struct to pass around during processing to avoid repeating the data in function arguments.
A Fader is a processor that is used for volume controls and pan.
A node in the processing graph.
Multiple Producer Multiple Consumer lock-free queue.
The base plugin Inheriting plugins must have this as a child.
Must ONLY be created via port_new()
A Position is made up of bars.beats.sixteenths.ticks.
EngineProcessTimeInfo time_nfo
Time info for this processing cycle.
ZixRing * ctrl_port_change_queue
Message queue for control port changes, used for BPM/time signature changes.
int graph_setup_in_progress
An atomic variable to check if the graph is currently being setup (so that we can avoid accessing buf...
ZixSem graph_access
Used when recalculating the graph.
nframes_t global_offset
Current global latency offset (max latency of all routes - remaining latency from engine).
nframes_t max_route_playback_latency
Stored for the currently processing cycle.
GThread * process_kickoff_thread
Thread that calls kicks off the cycle.
Track to be inserted into the Project's Tracklist.