33#ifndef __AUDIO_ROUTING_H__
34#define __AUDIO_ROUTING_H__
36#include "zrythm-config.h"
38#ifdef HAVE_C11_THREADS
47#include "gtk_wrapper.h"
54typedef struct PassthroughProcessor PassthroughProcessor;
70#define ROUTER (AUDIO_ENGINE->router)
94 bool callback_in_progress;
133WARN_UNUSED_RESULT HOT NONNULL
135 const
Router * const self)
137 return g_thread_self () == self->process_kickoff_thread;
144 1) static inline
bool router_is_processing_thread (const
Router * const self)
146#ifdef HAVE_C11_THREADS
148 static thread_local bool have_result =
false;
149 static thread_local bool is_processing_thread =
false;
151 bool have_result =
false;
152 bool is_processing_thread =
false;
155 if (G_LIKELY (have_result))
157 return is_processing_thread;
160 if (G_UNLIKELY (!self->graph))
163 is_processing_thread =
false;
167 for (
int j = 0; j < self->graph->num_threads; j++)
169 if (pthread_equal (pthread_self (), self->graph->threads[j]->pthread))
171 is_processing_thread =
true;
178 self->graph->main_thread
179 && pthread_equal (pthread_self (), self->graph->main_thread->pthread))
181 is_processing_thread =
true;
187 is_processing_thread =
false;
204router_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.