audio/port.h file

Contents

Ports that transfer audio/midi/other signals to one another.

Classes

struct Port
Must ONLY be created via port_new()
struct StereoPorts
L & R port, for convenience.

Enums

enum PortInternalType { INTERNAL_NONE, INTERNAL_LV2_PORT, INTERNAL_JACK_PORT, INTERNAL_PA_PORT, INTERNAL_ALSA_SEQ_PORT }
What the internal data is.

Typedefs

using PortInternalType = enum PortInternalType
What the internal data is.
using Port = struct Port
Must ONLY be created via port_new()
using StereoPorts = struct StereoPorts
L & R port, for convenience.

Functions

void port_init_loaded(Port* self, bool is_project)
This function finds the Ports corresponding to the PortIdentifiers for srcs and dests.
auto port_new_with_type(PortType type, PortFlow flow, const char* label) -> Port*
Creates port.
auto stereo_ports_new_from_existing(Port* l, Port* r) -> StereoPorts*
Creates blank stereo ports.
auto stereo_ports_new_generic(int in, const char* name, PortOwnerType owner_type, void* owner) -> StereoPorts*
Creates stereo ports for generic use.
void stereo_ports_connect(StereoPorts* src, StereoPorts* dest, int locked)
Connects the internal ports using port_connect().
void port_get_full_designation(Port* self, char* buf)
Copies a full designation of self in the format "Track/Port" or "Track/Plugin/Port" in buf.
void port_get_all(Port*** ports, int* max_size, bool is_dynamic, int* size)
Gathers all ports in the project and puts them in the given array and size.
void port_update_identifier(Port* self, Track* track)
To be called when the port's identifier changes to update corresponding identifiers.
static auto port_get_dest_index(Port* self, Port* dest) -> int
Returns the index of the destination in the dest array.
static auto port_get_src_index(Port* self, Port* src) -> int
Returns the index of the source in the source array.
static void port_set_multiplier_by_index(Port* port, int idx, float val)
Set the multiplier for a destination by its index in the dest array.
static void port_set_src_multiplier_by_index(Port* port, int idx, float val)
Set the multiplier for a destination by its index in the dest array.
static auto port_get_multiplier_by_index(Port* port, int idx) -> float
Get the multiplier for a destination by its index in the dest array.
void port_free(Port* port)
Deletes port, doing required cleanup and updating counters.
void port_set_expose_to_backend(Port* self, int expose)
Sets whether to expose the port to the backend and exposes it or removes it.
auto port_is_exposed_to_backend(const Port* self) -> int
Returns if the port is exposed to the backend.
void port_rename_backend(Port* self)
Renames the port on the backend side.
void port_set_control_value(Port* self, const float val, const bool is_normalized, const bool forward_event)
Sets the given control value to the corresponding underlying structure in the Port.
auto port_get_control_value(Port* self, const bool normalize) -> float
Gets the given control value from the corresponding underlying structure in the Port.
auto port_connect(Port* src, Port* dest, const int locked) -> int
Connets src to dest.
auto port_disconnect(Port* src, Port* dest) -> int
Disconnects src from dest.
static auto port_disconnect_dests(Port* src) -> int
Disconnects dests of port.
auto port_get_num_unlocked_srcs(Port* port) -> int
Returns the number of unlocked (user-editable) sources.
auto port_get_num_unlocked_dests(Port* port) -> int
Returns the number of unlocked (user-editable) destinations.
void port_update_track_pos(Port* port, Track* track, int pos)
Updates the track pos on a track port and all its source/destination identifiers.
static void port_apply_fader(Port* port, float amp, nframes_t start_frame, const nframes_t nframes)
Apply given fader value to port.
void port_sum_signal_from_inputs(Port* port, const long g_start_frames, const nframes_t start_frame, const nframes_t nframes, const bool noroll)
First sets port buf to 0, then sums the given port signal from its inputs.
void port_set_owner_track(Port* port, Track* track)
Sets the owner track & its ID.
void port_set_owner_track_from_channel(Port* port, Channel* ch)
Sets the owner track & its ID.
void port_set_owner_track_processor(Port* port, TrackProcessor* track_processor)
Sets the owner track & its ID.
void port_set_owner_sample_processor(Port* port, SampleProcessor* sample_processor)
Sets the owner sample processor.
void port_set_owner_fader(Port* port, Fader* fader)
Sets the owner fader & its ID.
void port_set_owner_plugin(Port* port, Plugin* pl)
Sets the owner plugin & its ID.
auto port_is_connection_locked(Port* src, Port* dest) -> int
Returns if the connection from src to dest is locked or not.
auto ports_connected(Port* src, Port* dest) -> bool
Returns if the two ports are connected or not.
auto ports_can_be_connected(const Port* src, const Port* dest) -> bool
Returns whether the Port's can be connected (if the connection will be valid and won't break the acyclicity of the graph).
void ports_disconnect(Port** ports, int num_ports, int deleting)
Disconnects all the given ports.
auto ports_remove(Port** ports, int* num_ports) -> int
Removes all the given ports from the project, optionally freeing them.
void port_print_connections_all(void)
Prints all connections.
void port_clear_buffer(Port* port)
Clears the port buffer.
auto port_disconnect_all(Port* port) -> int
Disconnects all srcs and dests from port.
void port_verify_src_and_dests(Port* self)
Verifies that the srcs and dests are correct for project ports.
void port_apply_pan_stereo(Port* l, Port* r, float pan, PanLaw pan_law, PanAlgorithm pan_algo)
Applies the pan to the given L/R ports.
void port_apply_pan(Port* port, float pan, PanLaw pan_law, PanAlgorithm pan_algo, nframes_t start_frame, const nframes_t nframes)
Applies the pan to the given port.

Defines

#define PORT_NOT_OWNED
Special ID for owner_pl, owner_ch, etc.

Define documentation

#define PORT_NOT_OWNED

Special ID for owner_pl, owner_ch, etc.

to indicate that the port is not owned.