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.
 
PluginGtkControllerwidget
 Control widget, if applicable.
 
bool received_ui_event
 Whether the port received a UI event from the plugin UI in this cycle.
 
bool automating
 Whether this value was set via automation.
 
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 135 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 470 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 410 of file port.h.

◆ automating

bool Port::automating

Whether this value was set via automation.

Definition at line 463 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 362 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 153 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 370 of file port.h.

◆ carla_param_id

int Port::carla_param_id

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

Definition at line 213 of file port.h.

◆ channel_send

ChannelSend* Port::channel_send

Pointer to owner channel send, if any.

Definition at line 324 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 301 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 223 of file port.h.

◆ deff

float Port::deff

Default value, only used for controls.

Definition at line 209 of file port.h.

◆ deleting

int Port::deleting

Port undergoing deletion.

Definition at line 381 of file port.h.

◆ dest_connections

const PortConnection** Port::dest_connections

Caches filled when recalculating the graph.

Definition at line 179 of file port.h.

◆ dest_connections_size

size_t Port::dest_connections_size

Definition at line 181 of file port.h.

◆ dests

struct Port** Port::dests

Caches filled when recalculating the graph.

Definition at line 168 of file port.h.

◆ dests_size

size_t Port::dests_size

Definition at line 170 of file port.h.

◆ engine

AudioEngine* Port::engine

Pointer to owner engine, if any.

Definition at line 327 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 145 of file port.h.

◆ ext_port

ExtPort* Port::ext_port

Pointer to ExtPort, if hw.

Definition at line 485 of file port.h.

◆ fader

Fader* Port::fader

Pointer to owner fader, if any.

Definition at line 330 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 394 of file port.h.

◆ id

PortIdentifier Port::id

Definition at line 139 of file port.h.

◆ initialized

int Port::initialized

used when loading projects FIXME needed?

Definition at line 354 of file port.h.

◆ internal_type

PortInternalType Port::internal_type

Indicates whether data or lv2_port should be used.

Definition at line 187 of file port.h.

◆ last_buf_sz

size_t Port::last_buf_sz

Last allocated buffer size (used for audio ports).

Definition at line 492 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 315 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 251 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 398 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 442 of file port.h.

◆ magic

int Port::magic

Magic number to identify that this is a Port.

Definition at line 488 of file port.h.

◆ maxf

float Port::maxf

Definition at line 197 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 482 of file port.h.

◆ midi_channel

midi_byte_t Port::midi_channel

MIDI channel, starting from 1.

Definition at line 479 of file port.h.

◆ midi_events

MidiEvents* Port::midi_events

Contains raw MIDI data (MIDI ports only)

Definition at line 158 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 425 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 196 of file port.h.

◆ mme_connections

void* Port::mme_connections[40]

Definition at line 237 of file port.h.

◆ mme_connections_sem

ZixSem Port::mme_connections_sem

Semaphore for changing the connections atomically.

Definition at line 243 of file port.h.

◆ modulator_macro_processor

ModulatorMacroProcessor* Port::modulator_macro_processor

Pointer to owner modulator macro processor, if any.

Definition at line 342 of file port.h.

◆ num_dest_connections

int Port::num_dest_connections

Definition at line 180 of file port.h.

◆ num_dests

int Port::num_dests

Definition at line 169 of file port.h.

◆ num_mme_connections

int Port::num_mme_connections

Definition at line 238 of file port.h.

◆ num_rtaudio_ins

int Port::num_rtaudio_ins

Definition at line 283 of file port.h.

◆ num_rtmidi_ins

int Port::num_rtmidi_ins

Definition at line 268 of file port.h.

◆ num_rtmidi_outs

int Port::num_rtmidi_outs

Definition at line 270 of file port.h.

◆ num_scale_points

int Port::num_scale_points

Definition at line 288 of file port.h.

◆ num_src_connections

int Port::num_src_connections

Definition at line 174 of file port.h.

◆ num_srcs

int Port::num_srcs

Definition at line 163 of file port.h.

◆ peak

float Port::peak

Max amplitude during processing, if audio (fabsf).

Definition at line 429 of file port.h.

◆ peak_timestamp

gint64 Port::peak_timestamp

Last time Port.max_amp was set.

Definition at line 432 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 378 of file port.h.

◆ plugin

Plugin* Port::plugin

Pointer to owner plugin, if any.

Definition at line 318 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 460 of file port.h.

◆ rtaudio_ins

void* Port::rtaudio_ins[128]

Definition at line 282 of file port.h.

◆ rtmidi_ins

void* Port::rtmidi_ins[128]

Definition at line 267 of file port.h.

◆ rtmidi_outs

void* Port::rtmidi_outs[128]

Definition at line 269 of file port.h.

◆ scale_points

PortScalePoint** Port::scale_points

Scale points.

Definition at line 287 of file port.h.

◆ schema_version

int Port::schema_version

Definition at line 137 of file port.h.

◆ src_connections

const PortConnection** Port::src_connections

Caches filled when recalculating the graph.

Definition at line 173 of file port.h.

◆ src_connections_size

size_t Port::src_connections_size

Definition at line 175 of file port.h.

◆ srcs

struct Port** Port::srcs

Caches filled when recalculating the graph.

Definition at line 162 of file port.h.

◆ srcs_size

size_t Port::srcs_size

Definition at line 164 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 351 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 338 of file port.h.

◆ transport

Transport* Port::transport

Pointer to owner transport, if any.

Definition at line 321 of file port.h.

◆ unsnapped_control

float Port::unsnapped_control

Unsnapped value, used by widgets.

Definition at line 304 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 308 of file port.h.

◆ widget

PluginGtkController* Port::widget

Control widget, if applicable.

Only used for generic UIs.

Definition at line 449 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 391 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 206 of file port.h.


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