33#ifndef __AUDIO_GRAPH_H__
34#define __AUDIO_GRAPH_H__
61#define mpmc_queue_push_back_node(q, x) mpmc_queue_push_back (q, (void *) x)
63#define mpmc_queue_dequeue_node(q, x) mpmc_queue_dequeue (q, (void **) x)
65#define MAX_GRAPH_THREADS 128
93 size_t n_init_triggers;
106 ZixSem callback_done;
131 size_t num_setup_init_triggers;
137 size_t num_setup_terminal_nodes;
163graph_print (
Graph * graph);
166graph_destroy (
Graph * graph);
169graph_find_node_from_port (
const Graph * self,
const Port * port);
172graph_find_node_from_plugin (
const Graph * self,
const Plugin * pl);
175graph_find_node_from_track (
178 bool use_setup_nodes);
181graph_find_node_from_fader (
const Graph * self,
const Fader * fader);
184graph_find_node_from_prefader (
const Graph * self,
const Fader * prefader);
187graph_find_node_from_sample_processor (
192graph_find_node_from_monitor_fader (
const Graph * self,
const Fader * fader);
195graph_find_node_from_modulator_macro_processor (
200graph_find_node_from_channel_send (
const Graph * self,
const ChannelSend * send);
203graph_find_initial_processor_node (
const Graph * self);
206graph_find_hw_processor_node (
236graph_update_latencies (
Graph * self,
bool use_setup_nodes);
248graph_setup (
Graph * self,
const int drop_unnecessary_ports,
const int rechain);
281graph_new (
Router * router);
GraphNodeType
Graph nodes can be either ports or processors.
bool graph_validate_with_connection(Graph *self, const Port *src, const Port *dest)
Adds a new connection for the given src and dest ports and validates the graph.
int graph_start(Graph *graph)
Starts as many threads as there are cores.
void graph_terminate(Graph *self)
Tell all threads to terminate.
void graph_free(Graph *self)
Frees the graph and its members.
NONNULL GraphNode * graph_create_node(Graph *self, GraphNodeType type, void *data)
Creates a new node, adds it to the graph and returns it.
nframes_t graph_get_max_route_playback_latency(Graph *graph, bool use_setup_nodes)
Returns the max playback latency of the trigger nodes.
HOT void graph_on_reached_terminal_node(Graph *self)
Called from a terminal node (from the Graph worked-thread) to indicate it has completed processing.
Graph * graph_new_full(Router *router, SampleProcessor *sample_processor)
Returns a new graph.
uint32_t nframes_t
Frame count.
A Fader is a processor that is used for volume controls and pan.
A node in the processing graph.
Router * router
Pointer back to router for convenience.
gint n_terminal_nodes
Number of graph nodes without an outgoing edge.
ZixSem callback_start
Synchronization with main process callback.
GPtrArray * external_out_ports
An array of pointers to ports that are exposed to the backend and are outputs.
MPMCQueue * trigger_queue
Queue containing nodes that can be processed.
SampleProcessor * sample_processor
Sample processor, if temporary graph for sample processor.
int initial_processor
Dummy member to make lookups work.
int destroying
Flag to indicate if graph is currently getting destroyed.
ZixSem trigger
Wake up graph node process threads.
GHashTable * setup_graph_nodes
Chain used to setup in the background.
gint terminate
flag to exit, terminate all process-threads
gint terminal_refcnt
Remaining unprocessed terminal nodes in this cycle.
GHashTable * graph_nodes
List of all graph nodes (only used for memory management)
GraphNode ** init_trigger_list
Nodes without incoming edges.
GraphNode ** setup_terminal_nodes
Used only when constructing the graph so we can traverse the graph backwards to calculate the playbac...
guint trigger_queue_size
Number of entries in trigger queue.
guint idle_thread_cnt
Number of threads waiting for work.
Multiple Producer Multiple Consumer lock-free queue.
Modulator macro button processor.
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.
A processor to be used in the routing graph for playing samples independent of the timeline.
Track to be inserted into the Project's Tracklist.