Port struct

Must ONLY be created via port_new()

Contents

Public variables

int exposed_to_backend
Flag to indicate that this port is exposed to the backend.
float* buf
Buffer to be reallocated every time the buffer size changes.
MidiEvents* midi_events
Contains raw MIDI data (MIDI ports only)
struct Port** srcs
Caches filled when recalculating the graph.
struct Port** dests
Caches filled when recalculating the graph.
const PortConnection** src_connections
Caches filled when recalculating the graph.
const PortConnection** dest_connections
Caches filled when recalculating the graph.
PortInternalType internal_type
Indicates whether data or lv2_port should be used.
float minf
Minimum, maximum and zero values for this port.
float zerof
The zero position of the port.
float deff
Default value, only used for controls.
int carla_param_id
Index of the control parameter (for Carla plugin ports).
void* data
Pointer to arbitrary data.
ZixSem mme_connections_sem
Semaphore for changing the connections atomically.
gint64 last_midi_dequeue
Last time the port finished dequeueing MIDI events.
PortScalePoint** scale_points
Scale points.
float control
The control value if control port, otherwise 0.0f.
float unsnapped_control
Unsnapped value, used by widgets.
bool value_changed_from_reading
Flag that the value of the port changed from reading automation.
gint64 last_change
Last timestamp the control changed.
Plugin* plugin
Pointer to owner plugin, if any.
Transport* transport
Pointer to owner transport, if any.
ChannelSend* channel_send
Pointer to owner channel send, if any.
AudioEngine* engine
Pointer to owner engine, if any.
Fader* fader
Pointer to owner fader, if any.
Track* track
Pointer to owner track, if any.
ModulatorMacroProcessor* modulator_macro_processor
Pointer to owner modulator macro processor, if any.
Plugin* tmp_plugin
Temporary plugin pointer (used when the plugin doesn't exist yet in its supposed slot).
int initialized
used when loading projects FIXME needed?
float base_value
For control ports, when a modulator is attached to the port the previous value will be saved here.
long capture_latency
Capture latency.
long playback_latency
Playback latency.
int deleting
Port undergoing deletion.
bool write_ring_buffers
Flag to indicate if the ring buffers below should be filled or not.
int has_midi_events
Whether the port has midi events not yet processed by the UI.
gint64 last_midi_event_time
Used by the UI to detect when unprocessed MIDI events exist.
ZixRing* audio_ring
Ring buffer for saving the contents of the audio buffer to be used in the UI instead of directly accessing the buffer.
ZixRing* midi_ring
Ring buffer for saving MIDI events to be used in the UI instead of directly accessing the events.
float peak
Max amplitude during processing, if audio (fabsf).
gint64 peak_timestamp
Last time Port.max_amp was set.
midi_byte_t last_midi_status
Last known MIDI status byte received.
const LilvPort* lilv_port
LV2 port.
LV2_URID value_type
Float for LV2 control ports, declared type for LV2 parameters.
LV2_Evbuf* evbuf
For MIDI ports, otherwise NULL.
PluginGtkController* widget
Control widget, if applicable.
size_t min_buf_size
Minimum buffer size that the port wants, or 0.
int lilv_port_index
Port index in the lilv plugin, if non-parameter.
bool received_ui_event
Whether the port received a UI event from the plugin UI in this cycle.
float last_sent_control
The last known control value sent to the UI (if control).
bool automating
Whether this value was set via automation.
bool old_api
True for event, false for atom.
AutomationTrack* at
Automation track this port is attached to.
ExtPort* ext_port
Pointer to ExtPort, if hw.
int magic
Magic number to identify that this is a Port.

Variable documentation

float* Port::buf

Buffer to be reallocated every time the buffer size changes.

The buffer size is AUDIO_ENGINE->block_length.

float Port::minf

Minimum, maximum and zero values for this port.

Note that for audio, this is the amp (0 - 2) and not the actual values.

float Port::zerof

The zero position of the port.

For example, in balance controls, this will be the middle. In audio ports, this will be 0 amp (silence), etc.

void* Port::data

Pointer to arbitrary data.

Use internal_type to check what data it is.

FIXME just add the various data structs here and remove this ambiguity.

gint64 Port::last_midi_dequeue

Last time the port finished dequeueing MIDI events.

Used for some backends only.

float Port::control

The control value if control port, otherwise 0.0f.

FIXME for fader, this should be the fader_val (0.0 to 1.0) and not the amplitude.

This value will be snapped (eg, if integer or toggle).

gint64 Port::last_change

Last timestamp the control changed.

This is used when recording automation in "touch" mode.

Track* Port::track

Pointer to owner track, if any.

Also used for channel and track processor ports.

Plugin* Port::tmp_plugin

Temporary plugin pointer (used when the plugin doesn't exist yet in its supposed slot).

FIXME delete

float Port::base_value

For control ports, when a modulator is attached to the port the previous value will be saved here.

Automation in AutomationTrack's will overwrite this value.

long Port::capture_latency

Capture latency.

See page 116 of "The Ardour DAW - Latency Compensation and Anywhere-to-Anywhere Signal Routing Systems".

long Port::playback_latency

Playback latency.

See page 116 of "The Ardour DAW - Latency Compensation and Anywhere-to-Anywhere Signal Routing Systems".

bool Port::write_ring_buffers

Flag to indicate if the ring buffers below should be filled or not.

If a UI element that needs them becomes mapped (visible), this should be set to 1, and when unmapped (invisible) it should be set to 0.

ZixRing* Port::audio_ring

Ring buffer for saving the contents of the audio buffer to be used in the UI instead of directly accessing the buffer.

This should contain blocks of block_length samples and should maintain at least 10 cycles' worth of buffers.

This is also used for CV.

ZixRing* Port::midi_ring

Ring buffer for saving MIDI events to be used in the UI instead of directly accessing the events.

This should keep pushing MidiEvent's whenever they occur and the reader should empty it after cheking if there are any events.

Currently there is only 1 reader for each port so this wont be a problem for now, but we should have one ring for each reader.

midi_byte_t Port::last_midi_status

Last known MIDI status byte received.

Used for running status (see http://midi.teragonaudio.com/tech/midispec/run.htm).

Not needed for JACK.

PluginGtkController* Port::widget

Control widget, if applicable.

Only used for generic UIs.

size_t Port::min_buf_size

Minimum buffer size that the port wants, or 0.

Used by LV2 plugin ports.

bool Port::received_ui_event

Whether the port received a UI event from the plugin UI in this cycle.

This is used to avoid re-sending that event to the plugin.

float Port::last_sent_control

The last known control value sent to the UI (if control).

Also used by track processor for MIDI controls.

@seealso lv2_ui_send_control_val_event_from_plugin_to_ui().

AutomationTrack* Port::at

Automation track this port is attached to.

To be set at runtime only (not serialized).