audio/port.h file

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

Contents

Classes

struct PortIdentifier
Struct used to identify Ports in the project.
struct Port
Must ONLY be created via port_new()
struct StereoPorts
L & R port, for convenience.

Enums

enum PortFlow { FLOW_UNKNOWN, FLOW_INPUT, FLOW_OUTPUT }
Direction of the signal.
enum PortType { TYPE_UNKNOWN, TYPE_CONTROL, TYPE_AUDIO, TYPE_EVENT, TYPE_CV }
Type of signals the Port handles.
enum PortOwnerType { PORT_OWNER_TYPE_BACKEND, PORT_OWNER_TYPE_PLUGIN, PORT_OWNER_TYPE_TRACK, PORT_OWNER_TYPE_PREFADER, PORT_OWNER_TYPE_FADER, PORT_OWNER_TYPE_SAMPLE_PROCESSOR }
Type of owner.
enum PortFlags { PORT_FLAG_STEREO_L = 0x01, PORT_FLAG_STEREO_R = 0x02, PORT_FLAG_PIANO_ROLL = 0x04, PORT_FLAG_SIDECHAIN = 0x08, PORT_FLAG_MAIN_PORT = 0x10, PORT_FLAG_MANUAL_PRESS = 0x20, OPT_F = 0x40 }
Port flags.
enum PortInternalType { INTERNAL_NONE, INTERNAL_LV2_PORT, INTERNAL_JACK_PORT, INTERNAL_PA_PORT }
What the internal data is.

Typedefs

using PortFlow = enum PortFlow
Direction of the signal.
using PortType = enum PortType
Type of signals the Port handles.
using PortOwnerType = enum PortOwnerType
Type of owner.
using PortFlags = enum PortFlags
Port flags.
using PortInternalType = enum PortInternalType
What the internal data is.
using PortIdentifier = struct PortIdentifier
Struct used to identify Ports in the project.
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* port)
This function finds the Ports corresponding to the PortIdentifiers for srcs and dests.
auto port_find_from_identifier(PortIdentifier* id) -> Port*
Finds the Port corresponding to the identifier.
auto port_new(char* label) -> Port*
Creates port.
auto port_new_with_type(PortType type, PortFlow flow, char* label) -> Port*
Creates port.
auto port_new_with_data(PortInternalType internal_type, PortType type, PortFlow flow, char* label, void* data) -> Port*
Creates port and adds given data to it.
auto stereo_ports_new(Port* l, Port* r) -> StereoPorts*
Creates stereo ports.
void port_receive_midi_events_from_jack(Port* port, int start_frames, int nframes)
Receives MIDI data from the port's exposed JACK port (if any) into the port.
void port_receive_audio_data_from_jack(Port* port, int start_frames, int nframes)
Receives audio data from the port's exposed JACK port (if any) into the port.
void port_send_midi_events_to_jack(Port* port, int start_frames, int nframes)
Sends MIDI data from the port to its exposed JACK port (if any).
void port_send_audio_data_to_jack(Port* port, int start_frames, int nframes)
Sends audio data from the port to its exposed JACK port (if any).
void port_sum_data_from_jack(Port* port, const int start_frames, const int nframes)
Sums the inputs coming in from JACK, before the port is processed.
void port_send_data_to_jack(Port* self, const int start_frame, const int nframes)
Sends the port data to JACK, after the port is processed.
auto port_get_full_designation(Port* self) -> char*
Returns a full designation of the port in the format "Track/Port" or "Track/Plugin/Port".
void port_get_all(Port** ports, int* size)
Gathers all ports in the project and puts them in the given array and size.
static auto port_get_dest_index(Port* port, Port* dest) -> int
Returns the index of the destination in the dest 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 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.
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.
void port_apply_fader(Port* port, float amp, const int start_frame, const int nframes)
Apply given fader value to port.
void port_sum_signal_from_inputs(Port* port, const int start_frame, const int nframes, const int 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_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_prefader(Port* port, PassthroughProcessor* fader)
Sets the owner fader & its ID.
void port_set_owner_plugin(Port* port, Plugin* pl)
Sets the owner plugin & its ID.
auto ports_connected(Port* src, Port* dest) -> int
Returns if the two ports are connected or not.
auto ports_can_be_connected(const Port* src, const Port* dest) -> int
Returns whether the Port's can be connected (if the connection will be valid and won't break the acyclicity of the graph).
static 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()
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_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, const int start_frame, const int 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.