10#ifndef __AUDIO_PORT_CONNECTIONS_MANAGER_H__
11#define __AUDIO_PORT_CONNECTIONS_MANAGER_H__
13#include "zrythm-config.h"
33#define PORT_CONNECTIONS_MANAGER_SCHEMA_VERSION 1
35#define PORT_CONNECTIONS_MGR \
36 (PROJECT->port_connections_manager)
48 size_t connections_size;
69static const cyaml_schema_field_t
70 port_connections_manager_fields_schema[] = {
75 port_connection_schema),
80static const cyaml_schema_value_t
81 port_connections_manager_schema = {
84 port_connections_manager_fields_schema),
88port_connections_manager_init_loaded (
92port_connections_manager_new (
void);
162port_connections_manager_find_connection (
174 const
void * user_data);
206#define port_connections_manager_ensure_connect_from_connection( \
208 port_connections_manager_ensure_connect ( \
209 self, conn->src_id, conn->dest_id, conn->multiplier, \
210 conn->locked, conn->enabled)
245port_connections_manager_contains_connection (
250port_connections_manager_print_ht (GHashTable * ht);
253port_connections_manager_print (
bool port_connections_manager_predicate_is_send_of(const void *obj, const void *user_data)
Returns whether the given connection is for the given send.
const PortConnection * port_connections_manager_ensure_connect(PortConnectionsManager *self, const PortIdentifier *src, const PortIdentifier *dest, float multiplier, bool locked, bool enabled)
Stores the connection for the given ports if it doesn't exist, otherwise updates the existing connect...
void port_connections_manager_regenerate_hashtables(PortConnectionsManager *self)
Regenerates the hash tables.
NONNULL PortConnectionsManager * port_connections_manager_clone(const PortConnectionsManager *src)
To be used during serialization.
PortConnection * port_connections_manager_get_source_or_dest(const PortConnectionsManager *self, const PortIdentifier *id, bool sources)
Wrapper over port_connections_manager_get_sources_or_dests() that returns the first connection.
int port_connections_manager_get_unlocked_sources_or_dests(const PortConnectionsManager *self, GPtrArray *arr, const PortIdentifier *id, bool sources)
Adds the sources/destinations of id in the given array.
void port_connections_manager_ensure_disconnect_all(PortConnectionsManager *self, const PortIdentifier *pi)
Disconnect all sources and dests of the given port identifier.
bool port_connections_manager_ensure_disconnect(PortConnectionsManager *self, const PortIdentifier *src, const PortIdentifier *dest)
Removes the connection for the given ports if it exists.
NONNULL void port_connections_manager_free(PortConnectionsManager *self)
Deletes port, doing required cleanup and updating counters.
int port_connections_manager_find(const PortConnectionsManager *self, GPtrArray *arr, GenericPredicateFunc predicate)
Adds the connections matching the given predicate to the given array (if given).
void port_connections_manager_reset(PortConnectionsManager *self, const PortConnectionsManager *src)
Removes all connections from self.
COLD NONNULL_ARGS(1) void automation_track_init_loaded(AutomationTrack *self
Inits a loaded AutomationTracklist.
int port_connections_manager_get_sources_or_dests(const PortConnectionsManager *self, GPtrArray *arr, const PortIdentifier *id, bool sources)
Adds the sources/destinations of id in the given array.
#define YAML_VALUE_PTR(cc, fields_schema)
Schema to be used as a pointer.
#define YAML_FIELD_DYN_PTR_ARRAY_VAR_COUNT_OPT(owner, member, schema)
Dynamic-width (reallocated) array of pointers with variable count, nullable.
bool(* GenericPredicateFunc)(const void *object, const void *user_data)
Predicate function prototype.
A connection between two ports.
Port connections manager.
GHashTable * dest_ht
Hashtable to speedup lookup by destination port identifier.
PortConnection ** connections
Connections.
GHashTable * src_ht
Hashtable to speedup lookup by source port identifier.
Struct used to identify Ports in the project.
Must ONLY be created via port_new()