Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
|
The Port class represents a port in the audio processing graph. More...
#include <src/gui/dsp/port.h>
Public Types | |
using | PortIdentifier = dsp::PortIdentifier |
using | PortType = dsp::PortType |
using | PortFlow = dsp::PortFlow |
using | PortConnection = dsp::PortConnection |
Public Member Functions | |
void | init_loaded (IPortOwner &owner) |
This function finds the Ports corresponding to the PortIdentifiers for srcs and dests. | |
void | set_owner (IPortOwner &owner) |
utils::Utf8String | get_label () const |
bool | is_control () const |
bool | is_audio () const |
bool | is_cv () const |
bool | is_event () const |
bool | is_midi () const |
bool | is_input () const |
bool | is_output () const |
utils::Utf8String | get_node_name () const override |
Returns a human friendly name of the node. | |
nframes_t | get_single_playback_latency () const override |
Ports have no latency. | |
virtual void | clear_buffer (std::size_t block_length)=0 |
Clears the port buffer. | |
virtual bool | has_sound () const |
If MIDI port, returns if there are any events, if audio port, returns if there is sound in the buffer. | |
utils::Utf8String | get_full_designation () const |
Gets a full designation of the port in the format "Track/Port" or "Track/Plugin/Port". | |
void | change_track (IPortOwner::TrackUuid new_track_id) |
Updates the owner track identifier. | |
bool | has_label () const |
PortType | get_type () const |
PortFlow | get_flow () const |
![]() | |
virtual void | prepare_for_processing (sample_rate_t sample_rate, nframes_t max_block_length) |
Called to allocate resources required for processing. | |
virtual void | process_block (EngineProcessTimeInfo time_nfo) |
virtual void | release_resources () |
Called to release resources allocated by prepare_for_processing(). | |
![]() | |
UuidIdentifiableObject (const Uuid &id) | |
UuidIdentifiableObject (const UuidIdentifiableObject &other)=default | |
UuidIdentifiableObject (UuidIdentifiableObject &&other)=default | |
UuidIdentifiableObject & | operator= (const UuidIdentifiableObject &other)=default |
UuidIdentifiableObject & | operator= (UuidIdentifiableObject &&other)=default |
auto | get_uuid () const |
Data Fields | |
std::unique_ptr< PortIdentifier > | id_ |
Owned pointer. | |
IPortOwner * | owner_ {} |
PortRange | range_ |
Protected Member Functions | |
Port (utils::Utf8String label, PortType type={}, PortFlow flow={}, float minf=0.f, float maxf=1.f, float zerof=0.f) | |
Friends | |
void | init_from (Port &obj, const Port &other, utils::ObjectCloneType clone_type) |
void | to_json (nlohmann::json &j, const Port &p) |
void | from_json (const nlohmann::json &j, Port &p) |
The Port class represents a port in the audio processing graph.
Ports can be of different types (audio, MIDI, CV, control) and can be inputs or outputs. They are used to connect different components of the audio processing graph, such as tracks, plugins, and the audio engine.
Ports are owned by various components in the audio processing graph, such as tracks, plugins, and the audio engine. The set_owner()
method is used to set the owner of the port.
|
pure virtual |
Clears the port buffer.
Implemented in AudioPort, ControlPort, CVPort, and MidiPort.
|
inline |
|
inlineoverridevirtual |
Returns a human friendly name of the node.
Implements zrythm::dsp::graph::IProcessable.
|
inlineoverridevirtual |
Ports have no latency.
Reimplemented from zrythm::dsp::graph::IProcessable.
|
inlinevirtual |
|
inline |
std::unique_ptr<PortIdentifier> Port::id_ |
IPortOwner* Port::owner_ {} |