audio/port.h file

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

Contents

Classes

struct PortScalePoint
Scale point.
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 PortScalePoint = struct PortScalePoint
Scale point.
using Port = struct Port
Must ONLY be created via port_new()
using StereoPorts = struct StereoPorts
L & R port, for convenience.

Functions

auto port_init_loaded(Port* self, bool is_project) -> NONNULL void
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) -> NONNULL Port*
Creates port.
auto stereo_ports_new_from_existing(Port* l, Port* r) -> NONNULL 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.
auto stereo_ports_connect(StereoPorts* src, StereoPorts* dest, int locked) -> NONNULL void
Connects the internal ports using port_connect().
auto port_get_value_from_symbol(const char* port_sym, void* user_data, uint32_t* size, uint32_t* type) -> const void*
Function to get a port's value from its string symbol.
auto port_get_full_designation(Port* self, char* buf) -> NONNULL void
Copies a full designation of self in the format "Track/Port" or "Track/Plugin/Port" in buf.
void port_get_all(Port*** ports, size_t* 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, bool update_automation_track)
To be called when the port's identifier changes to update corresponding identifiers.
static auto port_get_dest_index(Port* self, Port* dest) -> NONNULL int
Returns the index of the destination in the dest array.
static auto port_get_src_index(Port* self, Port* src) -> NONNULL int
Returns the index of the source in the source array.
static auto port_set_multiplier_by_index(Port* port, int idx, float val) -> NONNULL void
Set the multiplier for a destination by its index in the dest array.
static auto port_set_src_multiplier_by_index(Port* port, int idx, float val) -> NONNULL void
Set the multiplier for a destination by its index in the dest array.
static auto port_get_multiplier_by_index(Port* port, int idx) -> NONNULL float
Get the multiplier for a destination by its index in the dest array.
auto port_disconnect_hw_inputs(Port* self) -> NONNULL void
Disconnects all hardware inputs from the port.
auto port_free(Port* port) -> NONNULL void
Deletes port, doing required cleanup and updating counters.
auto port_set_expose_to_backend(Port* self, int expose) -> NONNULL void
Sets whether to expose the port to the backend and exposes it or removes it.
auto port_is_exposed_to_backend(const Port* self) -> NONNULL int
Returns if the port is exposed to the backend.
auto port_rename_backend(Port* self) -> NONNULL void
Renames the port on the backend side.
auto port_set_control_value(Port* self, const float val, const bool is_normalized, const bool forward_event) -> NONNULL void
Sets the given control value to the corresponding underlying structure in the Port.
auto port_get_control_value(Port* self, const bool normalize) -> NONNULL float
Gets the given control value from the corresponding underlying structure in the Port.
auto port_connect(Port* src, Port* dest, const int locked) -> NONNULL int
Connets src to dest.
auto port_disconnect(Port* src, Port* dest) -> NONNULL int
Disconnects src from dest.
static auto port_disconnect_dests(Port* src) -> NONNULL int
Disconnects dests of port.
auto port_get_num_unlocked_srcs(Port* port) -> NONNULL int
Returns the number of unlocked (user-editable) sources.
auto port_get_num_unlocked_dests(Port* port) -> NONNULL 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 auto port_apply_fader(Port* port, float amp, nframes_t start_frame, const nframes_t nframes) -> NONNULL void
Apply given fader value to port.
auto port_process(Port* port, const long g_start_frames, const nframes_t start_frame, const nframes_t nframes, const bool noroll) -> HOT NONNULL void
First sets port buf to 0, then sums the given port signal from its inputs.
auto port_set_owner_track(Port* port, Track* track) -> NONNULL void
Sets the owner track & its ID.
auto port_set_owner_track_from_channel(Port* port, Channel* ch) -> NONNULL void
Sets the owner track & its ID.
auto port_set_owner_track_processor(Port* port, TrackProcessor* track_processor) -> NONNULL void
Sets the owner track & its ID.
auto port_set_owner_sample_processor(Port* port, SampleProcessor* sample_processor) -> NONNULL void
Sets the owner sample processor.
auto port_set_owner_fader(Port* port, Fader* fader) -> NONNULL void
Sets the owner fader & its ID.
auto port_set_owner_plugin(Port* port, Plugin* pl) -> NONNULL void
Sets the owner plugin & its ID.
auto port_is_connection_locked(Port* src, Port* dest) -> NONNULL int
Returns if the connection from src to dest is locked or not.
auto ports_connected(Port* src, Port* dest) -> NONNULL bool
Returns if the two ports are connected or not.
auto ports_can_be_connected(const Port* src, const Port* dest) -> NONNULL bool
Returns whether the Port's can be connected (if the connection will be valid and won't break the acyclicity of the graph).
auto ports_disconnect(Port** ports, int num_ports, int deleting) -> NONNULL void
Disconnects all the given ports.
auto port_copy_metadata_from_project(Port* self, Port* project_port) -> NONNULL void
Copies the metadata from a project port to the given port.
auto port_restore_from_non_project(Port* self, Port* non_project) -> NONNULL void
Reverts the data on the corresponding project port for the given non-project port.
void port_print_connections_all(void)
Prints all connections.
auto port_clear_buffer(Port* port) -> HOT NONNULL void
Clears the port buffer.
auto port_disconnect_all(Port* port) -> NONNULL int
Disconnects all srcs and dests from port.
auto port_verify_src_and_dests(Port* self) -> NONNULL void
Verifies that the srcs and dests are correct for project ports.
auto port_apply_pan_stereo(Port* l, Port* r, float pan, PanLaw pan_law, PanAlgorithm pan_algo) -> NONNULL void
Applies the pan to the given L/R ports.
auto port_apply_pan(Port* port, float pan, PanLaw pan_law, PanAlgorithm pan_algo, nframes_t start_frame, const nframes_t nframes) -> NONNULL void
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.