10#ifndef __AUDIO_PORT_CONNECTIONS_MANAGER_H__
11#define __AUDIO_PORT_CONNECTIONS_MANAGER_H__
13#include "zrythm-config.h"
31#define PORT_CONNECTIONS_MANAGER_SCHEMA_VERSION 1
33#define PORT_CONNECTIONS_MGR (PROJECT->port_connections_manager)
43 size_t connections_size;
68port_connections_manager_new (
void);
137port_connections_manager_find_connection (
149 const
void * user_data);
181#define port_connections_manager_ensure_connect_from_connection(self, conn) \
182 port_connections_manager_ensure_connect ( \
183 self, conn->src_id, conn->dest_id, conn->multiplier, conn->locked, \
219port_connections_manager_contains_connection (
224port_connections_manager_print_ht (GHashTable * ht);
NONNULL_ARGS(1) int undo_manager_undo(UndoManager *self
Undo last action.
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.
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.
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()