Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
zrythm::dsp::Port Class Referenceabstract

A base class for ports used for connecting processors in the DSP graph. More...

#include <src/dsp/port.h>

Inheritance diagram for zrythm::dsp::Port:
Collaboration diagram for zrythm::dsp::Port:

Public Types

using FullDesignationProvider

Public Member Functions

void set_full_designation_provider (FullDesignationProvider provider)
void set_full_designation_provider (const auto *owner)
 Convenience helper for providers that contain a get_full_designation_for_port() method.
bool is_input () const
bool is_output () const
bool is_midi () const
bool is_cv () const
bool is_audio () const
utils::Utf8String get_label () const
auto get_symbol () const
void set_symbol (const utils::Utf8String &sym)
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 offset, std::size_t nframes)=0
 Clears the port buffer.
utils::Utf8String get_full_designation () const
 Gets a full designation of the port in the format "Track/Port" or "Track/Plugin/Port".
bool has_label () const
PortType type () const
PortFlow flow () const
Public Member Functions inherited from zrythm::dsp::graph::IProcessable
virtual void prepare_for_processing (const GraphNode *node, units::sample_rate_t sample_rate, nframes_t max_block_length)
 Called to allocate resources required for processing.
virtual void process_block (EngineProcessTimeInfo time_nfo, const dsp::ITransport &transport) noexcept
virtual void release_resources ()
 Called to release resources allocated by prepare_for_processing().
Public Member Functions inherited from zrythm::utils::UuidIdentifiableObject< Port >
UuidIdentifiableObject & operator= (const UuidIdentifiableObject &other)=default
auto get_uuid () const

Protected Member Functions

 Port (utils::Utf8String label, PortType type={}, PortFlow flow={})

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)

Detailed Description

A base class for ports used for connecting processors in the DSP graph.

Ports can be of different types (audio, MIDI, CV) 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 processors in the audio processing graph, such as tracks, plugins, etc., and ports themselves are part of the processing graph.

Definition at line 27 of file port.h.

Member Typedef Documentation

◆ FullDesignationProvider

using zrythm::dsp::Port::FullDesignationProvider
Initial value:
std::function<utils::Utf8String (const Port &port)>
Lightweight UTF-8 string wrapper with safe conversions.
Definition utf8_string.h:38

Definition at line 33 of file port.h.

Member Function Documentation

◆ clear_buffer()

virtual void zrythm::dsp::Port::clear_buffer ( std::size_t offset,
std::size_t nframes )
pure virtual

Clears the port buffer.

Implemented in zrythm::dsp::AudioPort, zrythm::dsp::CVPort, and zrythm::dsp::MidiPort.

◆ flow()

PortFlow zrythm::dsp::Port::flow ( ) const
inline

Definition at line 98 of file port.h.

◆ get_full_designation()

utils::Utf8String zrythm::dsp::Port::get_full_designation ( ) const
inline

Gets a full designation of the port in the format "Track/Port" or "Track/Plugin/Port".

Definition at line 91 of file port.h.

◆ get_label()

utils::Utf8String zrythm::dsp::Port::get_label ( ) const
inline

Definition at line 61 of file port.h.

◆ get_node_name()

utils::Utf8String zrythm::dsp::Port::get_node_name ( ) const
inlineoverridevirtual

Returns a human friendly name of the node.

Implements zrythm::dsp::graph::IProcessable.

Definition at line 70 of file port.h.

◆ get_single_playback_latency()

nframes_t zrythm::dsp::Port::get_single_playback_latency ( ) const
inlineoverridevirtual

Ports have no latency.

Reimplemented from zrythm::dsp::graph::IProcessable.

Definition at line 78 of file port.h.

◆ get_symbol()

auto zrythm::dsp::Port::get_symbol ( ) const
inline

Definition at line 63 of file port.h.

◆ has_label()

bool zrythm::dsp::Port::has_label ( ) const
inline

Definition at line 96 of file port.h.

◆ is_audio()

bool zrythm::dsp::Port::is_audio ( ) const
inline

Definition at line 59 of file port.h.

◆ is_cv()

bool zrythm::dsp::Port::is_cv ( ) const
inline

Definition at line 58 of file port.h.

◆ is_input()

bool zrythm::dsp::Port::is_input ( ) const
inline

Definition at line 54 of file port.h.

◆ is_midi()

bool zrythm::dsp::Port::is_midi ( ) const
inline

Definition at line 57 of file port.h.

◆ is_output()

bool zrythm::dsp::Port::is_output ( ) const
inline

Definition at line 55 of file port.h.

◆ set_full_designation_provider() [1/2]

void zrythm::dsp::Port::set_full_designation_provider ( const auto * owner)
inline

Convenience helper for providers that contain a get_full_designation_for_port() method.

Definition at line 47 of file port.h.

◆ set_full_designation_provider() [2/2]

void zrythm::dsp::Port::set_full_designation_provider ( FullDesignationProvider provider)
inline

Definition at line 38 of file port.h.

◆ set_symbol()

void zrythm::dsp::Port::set_symbol ( const utils::Utf8String & sym)
inline

Definition at line 64 of file port.h.

◆ type()

PortType zrythm::dsp::Port::type ( ) const
inline

Definition at line 97 of file port.h.

◆ from_json

void from_json ( const nlohmann::json & j,
Port & p )
friend

Definition at line 120 of file port.h.

◆ to_json

void to_json ( nlohmann::json & j,
const Port & p )
friend

Definition at line 112 of file port.h.


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