6#include "zrythm-config.h"
8#include "utils/icloneable.h"
9#include "utils/types.h"
10#include "utils/uuid_identifiable_object.h"
12namespace zrythm::structure::tracks
16namespace zrythm::gui::old_dsp::plugins
125 StereoL = UINT64_C (1) << 0,
126 StereoR = UINT64_C (1) << 1,
127 PianoRoll = UINT64_C (1) << 2,
230 Hw = UINT64_C (1) << 26,
257 TransportStop = UINT64_C (1) << 31,
258 TransportBackward = UINT64_C (1) << 32,
259 TransportForward = UINT64_C (1) << 33,
260 TransportLoopToggle = UINT64_C (1) << 34,
261 TransportRecToggle = UINT64_C (1) << 35,
341 bool is_control ()
const {
return type_ == PortType::Control; }
342 bool is_midi ()
const {
return type_ == PortType::Event; }
343 bool is_cv ()
const {
return type_ == PortType::CV; }
344 bool is_audio ()
const {
return type_ == PortType::Audio; }
346 bool is_input ()
const {
return flow_ == PortFlow::Input; }
347 bool is_output ()
const {
return flow_ == PortFlow::Output; }
349 bool is_monitor_fader_stereo_in_or_out_port ()
const
352 && (ENUM_BITSET_TEST (
flags_, Flags::StereoL) || ENUM_BITSET_TEST (
flags_, Flags::StereoR));
355 auto get_track_id ()
const {
return track_id_; }
356 void set_track_id (TrackUuid track_id) {
track_id_ = track_id; }
357 auto get_plugin_id ()
const {
return plugin_id_; }
358 void set_plugin_id (PluginUuid plugin_id) {
plugin_id_ = plugin_id; }
359 auto get_symbol ()
const {
return sym_; }
361 std::string print_to_str ()
const;
363 size_t get_hash ()
const;
365 static utils::Utf8String port_unit_to_string (PortUnit unit);
367 friend void init_from (
369 const PortIdentifier &other,
386 PortType
type_{ PortType::Unknown };
388 PortFlow
flow_{ PortFlow::Unknown };
406 std::optional<utils::Utf8String>
uri_;
420 friend void to_json (nlohmann::json &j,
const PortIdentifier &port)
424 {
"symbol", port.
sym_ },
425 {
"uri", port.
uri_ },
428 {
"type", port.
type_ },
429 {
"flow", port.
flow_ },
430 {
"unit", port.
unit_ },
440 friend void from_json (
const nlohmann::json &j,
PortIdentifier &port)
442 j.at (
"label").get_to (port.
label_);
443 j.at (
"symbol").get_to (port.
sym_);
444 j.at (
"uri").get_to (port.
uri_);
445 j.at (
"comment").get_to (port.
comment_);
447 j.at (
"type").get_to (port.
type_);
448 j.at (
"flow").get_to (port.
flow_);
449 j.at (
"unit").get_to (port.
unit_);
450 j.at (
"flags").get_to (port.
flags_);
451 j.at (
"trackId").get_to (port.
track_id_);
The Port class represents a port in the audio processing graph.
Struct used to identify Ports in the project.
PortType type_
Data type (e.g.
PortIdentifier::Flags flags_
Flags (e.g.
std::optional< utils::Utf8String > uri_
URI, if LV2 property.
std::optional< utils::Utf8String > comment_
Comment, if any.
std::optional< PluginUuid > plugin_id_
Identifier of plugin.
@ Plugin
zrythm::gui::old_dsp::plugins::Plugin owner.
@ ModulatorMacroProcessor
Modulator macro processor owner.
@ ChannelSend
Channel send.
@ HardwareProcessor
Port is part of a HardwareProcessor.
@ Transport
Port is owned by engine transport.
@ MidiChannelPressure
MIDI channel pressure.
@ ChannelSendEnabled
Channel send enabled.
@ FaderListen
Fader listen.
@ SampleProcessorTrack
Port is owned by sample processor track/channel (including faders owned by those tracks/channels).
@ Prefader
Port is owned by prefader.
@ Automatable
Port has an automation track.
@ MonitorFader
Port is owned by monitor fader.
@ Enumeration
Port's only reasonable values are its scale points.
@ SampleProcessorFader
Port is owned by the sample processor fader.
@ TrackRecording
Track recording.
@ Logarithmic
Logarithmic.
@ SupportsPatchMessage
LV2 control atom port supports patch messages.
@ ModulatorMacro
Port is part of a modulator macro processor.
@ UriParam
Parameter port's value type is URI.
@ SendReceivable
Channels can send to this port (ie, this port is a track processor midi/stereo in or a plugin sidecha...
@ Sequence
Atom port buffer type is sequence.
@ FaderMute
Port is for fader mute.
@ StereoBalance
Port controls the stereo balance.
@ MidiAutomatable
MIDI automatable control, such as modwheel or pitch bend.
@ IsProperty
zrythm::gui::old_dsp::plugins::Plugin control is a property (changes are set via atom message on the ...
@ WantPosition
Whether the port wants to receive position events.
@ FaderSwapPhase
Fader swap phase.
@ FaderMonoCompat
Fader mono compat.
@ ChannelFader
Port is for channel fader.
@ ChannelSendAmount
Channel send amount.
@ ReportsLatency
Used for plugin ports.
@ TpMonitorAudio
Track processor monitor audio.
@ TpInputGain
Track processor input gain.
@ Hw
Port is a hardware port.
@ ManualPress
Piano roll user (piano) key press.
@ TransportRoll
Transport ports.
@ Integer
Whether the port is an integer.
@ Toggle
Whether the port is a toggle (on/off).
@ SupportsMidi
Atom or event port supports MIDI.
@ PluginGain
This is the plugin gain.
@ Freewheel
Whether port is for letting the plugin know that we are in freewheeling (export) mode.
@ Sidechain
See http://lv2plug.in/ns/ext/port-groups/port-groups.html#sideChainOf.
@ MainPort
See http://lv2plug.in/ns/ext/port-groups/port-groups.html#mainInput and http://lv2plug....
@ PluginControl
Port is a plugin control.
@ MidiPolyKeyPressure
MIDI poly key pressure.
@ Postfader
Port is owned by postfader.
@ TpOutputGain
Track processor output gain.
@ NotOnGui
Port should not be visible to users.
@ GenericPluginPort
Generic plugin port not belonging to the underlying plugin.
@ PluginEnabled
Port is a switch for plugin enabled.
@ Amplitude
Amplitude port.
@ Trigger
Trigger ports will be set to 0 at the end of each cycle.
@ TpMono
Track processor input mono switch.
@ MidiPitchBend
MIDI pitch bend.
utils::Utf8String label_
Human readable label.
PortFlow flow_
Flow (IN/OUT).
std::optional< midi_byte_t > midi_channel_
MIDI channel if MIDI CC port, starting from 1 (so [1, 16]).
std::optional< utils::Utf8String > port_group_
Port group this port is part of (only applicable for LV2 plugin ports).
std::optional< utils::Utf8String > ext_port_id_
ExtPort ID (type + full name), if hw port.
utils::Utf8String sym_
Unique symbol.
std::optional< TrackUuid > track_id_
Track identifier.
size_t port_index_
Index (e.g.
PortIdentifier::OwnerType owner_type_
Owner type.
This class provides the core functionality for managing a plugin, including creating/initializing the...
Represents a track in the project.
Lightweight UTF-8 string wrapper with safe conversions.
Base class for objects that need to be uniquely identified by UUID.