Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
Port Struct Reference

Must ONLY be created via port_new() More...

#include <dsp/port.h>

Collaboration diagram for Port:

Data Fields

int schema_version
 
PortIdentifier id
 
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.
 
MidiEventsmidi_events
 Contains raw MIDI data (MIDI ports only)
 
struct Port ** srcs
 Caches filled when recalculating the graph.
 
int num_srcs
 
size_t srcs_size
 
struct Port ** dests
 Caches filled when recalculating the graph.
 
int num_dests
 
size_t dests_size
 
const PortConnection ** src_connections
 Caches filled when recalculating the graph.
 
int num_src_connections
 
size_t src_connections_size
 
const PortConnection ** dest_connections
 Caches filled when recalculating the graph.
 
int num_dest_connections
 
size_t dest_connections_size
 
PortInternalType internal_type
 Indicates whether data or lv2_port should be used.
 
float minf
 Minimum, maximum and zero values for this port.
 
float maxf
 
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.
 
void * mme_connections [40]
 
int num_mme_connections
 
ZixSem mme_connections_sem
 Semaphore for changing the connections atomically.
 
gint64 last_midi_dequeue
 Last time the port finished dequeueing MIDI events.
 
void * rtmidi_ins [128]
 
int num_rtmidi_ins
 
void * rtmidi_outs [128]
 
int num_rtmidi_outs
 
void * rtaudio_ins [128]
 
int num_rtaudio_ins
 
PortScalePoint ** scale_points
 Scale points.
 
int num_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.
 
Pluginplugin
 Pointer to owner plugin, if any.
 
Transporttransport
 Pointer to owner transport, if any.
 
ChannelSendchannel_send
 Pointer to owner channel send, if any.
 
AudioEngineengine
 Pointer to owner engine, if any.
 
Faderfader
 Pointer to owner fader, if any.
 
Tracktrack
 Pointer to owner track, if any.
 
ModulatorMacroProcessormodulator_macro_processor
 Pointer to owner modulator macro processor, if any.
 
Plugintmp_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.
 
PluginGtkControllerwidget
 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.
 
AutomationTrackat
 Automation track this port is attached to.
 
midi_byte_t midi_channel
 MIDI channel, starting from 1.
 
midi_byte_t midi_cc_no
 MIDI CC number, if not pitchbend/poly key/channel pressure.
 
ExtPortext_port
 Pointer to ExtPort, if hw.
 
int magic
 Magic number to identify that this is a Port.
 
size_t last_buf_sz
 Last allocated buffer size (used for audio ports).
 

Detailed Description

Must ONLY be created via port_new()

Definition at line 139 of file port.h.

Field Documentation

◆ at

AutomationTrack* Port::at

Automation track this port is attached to.

To be set at runtime only (not serialized).

Definition at line 513 of file port.h.

◆ audio_ring

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.

Definition at line 415 of file port.h.

◆ automating

bool Port::automating

Whether this value was set via automation.

Definition at line 501 of file port.h.

◆ base_value

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.

Definition at line 367 of file port.h.

◆ buf

float* Port::buf

Buffer to be reallocated every time the buffer size changes.

The buffer size is AUDIO_ENGINE->block_length.

Definition at line 157 of file port.h.

◆ capture_latency

long Port::capture_latency

Capture latency.

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

Definition at line 375 of file port.h.

◆ carla_param_id

int Port::carla_param_id

Index of the control parameter (for Carla plugin ports).

Definition at line 218 of file port.h.

◆ channel_send

ChannelSend* Port::channel_send

Pointer to owner channel send, if any.

Definition at line 329 of file port.h.

◆ control

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).

Definition at line 306 of file port.h.

◆ data

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.

Definition at line 228 of file port.h.

◆ deff

float Port::deff

Default value, only used for controls.

Definition at line 214 of file port.h.

◆ deleting

int Port::deleting

Port undergoing deletion.

Definition at line 386 of file port.h.

◆ dest_connections

const PortConnection** Port::dest_connections

Caches filled when recalculating the graph.

Definition at line 184 of file port.h.

◆ dest_connections_size

size_t Port::dest_connections_size

Definition at line 186 of file port.h.

◆ dests

struct Port** Port::dests

Caches filled when recalculating the graph.

Definition at line 172 of file port.h.

◆ dests_size

size_t Port::dests_size

Definition at line 174 of file port.h.

◆ engine

AudioEngine* Port::engine

Pointer to owner engine, if any.

Definition at line 332 of file port.h.

◆ evbuf

LV2_Evbuf* Port::evbuf

For MIDI ports, otherwise NULL.

Definition at line 459 of file port.h.

◆ exposed_to_backend

int Port::exposed_to_backend

Flag to indicate that this port is exposed to the backend.

Definition at line 149 of file port.h.

◆ ext_port

ExtPort* Port::ext_port

Pointer to ExtPort, if hw.

Definition at line 528 of file port.h.

◆ fader

Fader* Port::fader

Pointer to owner fader, if any.

Definition at line 335 of file port.h.

◆ has_midi_events

int Port::has_midi_events

Whether the port has midi events not yet processed by the UI.

Definition at line 399 of file port.h.

◆ id

PortIdentifier Port::id

Definition at line 143 of file port.h.

◆ initialized

int Port::initialized

used when loading projects FIXME needed?

Definition at line 359 of file port.h.

◆ internal_type

PortInternalType Port::internal_type

Indicates whether data or lv2_port should be used.

Definition at line 192 of file port.h.

◆ last_buf_sz

size_t Port::last_buf_sz

Last allocated buffer size (used for audio ports).

Definition at line 535 of file port.h.

◆ last_change

gint64 Port::last_change

Last timestamp the control changed.

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

Definition at line 320 of file port.h.

◆ last_midi_dequeue

gint64 Port::last_midi_dequeue

Last time the port finished dequeueing MIDI events.

Used for some backends only.

Definition at line 256 of file port.h.

◆ last_midi_event_time

gint64 Port::last_midi_event_time

Used by the UI to detect when unprocessed MIDI events exist.

Definition at line 403 of file port.h.

◆ last_midi_status

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.

Definition at line 447 of file port.h.

◆ last_sent_control

float Port::last_sent_control

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

Note
Only used in the original LV2 implementation.
See also
lv2_ui_send_control_val_event_from_plugin_to_ui().

Definition at line 498 of file port.h.

◆ lilv_port

const LilvPort* Port::lilv_port

LV2 port.

Definition at line 452 of file port.h.

◆ lilv_port_index

int Port::lilv_port_index

Port index in the lilv plugin, if non-parameter.

Definition at line 478 of file port.h.

◆ magic

int Port::magic

Magic number to identify that this is a Port.

Definition at line 531 of file port.h.

◆ maxf

float Port::maxf

Definition at line 202 of file port.h.

◆ midi_cc_no

midi_byte_t Port::midi_cc_no

MIDI CC number, if not pitchbend/poly key/channel pressure.

Definition at line 525 of file port.h.

◆ midi_channel

midi_byte_t Port::midi_channel

MIDI channel, starting from 1.

Definition at line 522 of file port.h.

◆ midi_events

MidiEvents* Port::midi_events

Contains raw MIDI data (MIDI ports only)

Definition at line 162 of file port.h.

◆ midi_ring

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 checking 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.

Definition at line 430 of file port.h.

◆ min_buf_size

size_t Port::min_buf_size

Minimum buffer size that the port wants, or 0.

Used by LV2 plugin ports.

Definition at line 474 of file port.h.

◆ minf

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.

Definition at line 201 of file port.h.

◆ mme_connections

void* Port::mme_connections[40]

Definition at line 242 of file port.h.

◆ mme_connections_sem

ZixSem Port::mme_connections_sem

Semaphore for changing the connections atomically.

Definition at line 248 of file port.h.

◆ modulator_macro_processor

ModulatorMacroProcessor* Port::modulator_macro_processor

Pointer to owner modulator macro processor, if any.

Definition at line 347 of file port.h.

◆ num_dest_connections

int Port::num_dest_connections

Definition at line 185 of file port.h.

◆ num_dests

int Port::num_dests

Definition at line 173 of file port.h.

◆ num_mme_connections

int Port::num_mme_connections

Definition at line 243 of file port.h.

◆ num_rtaudio_ins

int Port::num_rtaudio_ins

Definition at line 288 of file port.h.

◆ num_rtmidi_ins

int Port::num_rtmidi_ins

Definition at line 273 of file port.h.

◆ num_rtmidi_outs

int Port::num_rtmidi_outs

Definition at line 275 of file port.h.

◆ num_scale_points

int Port::num_scale_points

Definition at line 293 of file port.h.

◆ num_src_connections

int Port::num_src_connections

Definition at line 179 of file port.h.

◆ num_srcs

int Port::num_srcs

Definition at line 167 of file port.h.

◆ old_api

bool Port::old_api

True for event, false for atom.

Definition at line 504 of file port.h.

◆ peak

float Port::peak

Max amplitude during processing, if audio (fabsf).

Definition at line 434 of file port.h.

◆ peak_timestamp

gint64 Port::peak_timestamp

Last time Port.max_amp was set.

Definition at line 437 of file port.h.

◆ playback_latency

long Port::playback_latency

Playback latency.

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

Definition at line 383 of file port.h.

◆ plugin

Plugin* Port::plugin

Pointer to owner plugin, if any.

Definition at line 323 of file port.h.

◆ received_ui_event

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.

Note
for control ports only.

Definition at line 489 of file port.h.

◆ rtaudio_ins

void* Port::rtaudio_ins[128]

Definition at line 287 of file port.h.

◆ rtmidi_ins

void* Port::rtmidi_ins[128]

Definition at line 272 of file port.h.

◆ rtmidi_outs

void* Port::rtmidi_outs[128]

Definition at line 274 of file port.h.

◆ scale_points

PortScalePoint** Port::scale_points

Scale points.

Definition at line 292 of file port.h.

◆ schema_version

int Port::schema_version

Definition at line 141 of file port.h.

◆ src_connections

const PortConnection** Port::src_connections

Caches filled when recalculating the graph.

Definition at line 178 of file port.h.

◆ src_connections_size

size_t Port::src_connections_size

Definition at line 180 of file port.h.

◆ srcs

struct Port** Port::srcs

Caches filled when recalculating the graph.

Definition at line 166 of file port.h.

◆ srcs_size

size_t Port::srcs_size

Definition at line 168 of file port.h.

◆ tmp_plugin

Plugin* Port::tmp_plugin

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

FIXME delete

Definition at line 356 of file port.h.

◆ track

Track* Port::track

Pointer to owner track, if any.

Also used for channel and track processor ports.

Definition at line 343 of file port.h.

◆ transport

Transport* Port::transport

Pointer to owner transport, if any.

Definition at line 326 of file port.h.

◆ unsnapped_control

float Port::unsnapped_control

Unsnapped value, used by widgets.

Definition at line 309 of file port.h.

◆ value_changed_from_reading

bool Port::value_changed_from_reading

Flag that the value of the port changed from reading automation.

Definition at line 313 of file port.h.

◆ value_type

LV2_URID Port::value_type

Float for LV2 control ports, declared type for LV2 parameters.

Definition at line 456 of file port.h.

◆ widget

PluginGtkController* Port::widget

Control widget, if applicable.

Only used for generic UIs.

Definition at line 466 of file port.h.

◆ write_ring_buffers

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 true, and when unmapped (invisible) it should be set to false.

Definition at line 396 of file port.h.

◆ zerof

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.

Definition at line 211 of file port.h.


The documentation for this struct was generated from the following file: