|
Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
|
External port. More...
#include <src/gui/dsp/ext_port.h>


Public Types | |
| enum class | Type { JACK , ALSA , WindowsMME , RtMidi , RtAudio } |
| External port type. More... | |
| using | PortType = zrythm::dsp::PortType |
| using | PortFlow = zrythm::dsp::PortFlow |
Public Types inherited from IPortOwner | |
| using | TrackUuid = dsp::PortIdentifier::TrackUuid |
| using | PluginUuid = dsp::PortIdentifier::PluginUuid |
| using | PortUuid = dsp::PortIdentifier::PortUuid |
Public Member Functions | |
| bool | is_in_active_project () const override |
| void | set_port_metadata_from_owner (dsp::PortIdentifier &id, PortRange &range) const override |
| Function that will be called by the Port to update the identifier's relevant members based on this port owner. | |
| utils::Utf8String | get_full_designation_for_port (const dsp::PortIdentifier &id) const override |
| void | init_loaded (HardwareProcessor *hw_processor) |
| Inits the ExtPort after loading a project. | |
| void | print () const |
| Prints the port info. | |
| bool | matches_backend () const |
| Returns if the ext port matches the current backend. | |
| utils::Utf8String | get_id () const |
| Returns a unique identifier (full name prefixed with backend type). | |
| utils::Utf8String | get_friendly_name () const |
| Returns a user-friendly display name (eg, to be used in dropdowns). | |
| float * | get_buffer (nframes_t nframes) const |
| Returns the buffer of the external port. | |
| void | clear_buffer (nframes_t nframes) |
| Clears the buffer of the external port. | |
| void | disconnect (Port *port, int src) |
| Disconnects the Port from the ExtPort. | |
| bool | activate (Port *port, bool activate) |
| Activates the port (starts receiving data) or deactivates it. | |
| bool | get_enabled () const |
| Checks in the GSettings whether this port is marked as enabled by the user. | |
Public Member Functions inherited from IPortOwner | |
| virtual void | on_control_change_event (const PortUuid &port_uuid, const dsp::PortIdentifier &id, float val) |
| Will be called when a control port's value changes. | |
| virtual void | on_midi_activity (const dsp::PortIdentifier &id) |
| Called during processing if the MIDI port contains new MIDI events. | |
| virtual bool | should_sum_data_from_backend () const |
| Whether during processing, the port should sum the data from its backend buffers coming in. | |
| virtual bool | should_bounce_to_master (utils::audio::BounceStep step) const |
| Whether the port should add its data to the master output when bouncing. | |
| virtual bool | are_events_on_midi_channel_approved (midi_byte_t channel) const |
| Returns whether MIDI events on this channel on an input port should be processed (not ignored). | |
Static Public Member Functions | |
| static void | ext_ports_get (PortType type, PortFlow flow, bool hw, std::vector< ExtPort > &ports, AudioEngine &engine) |
| Collects external ports of the given type. | |
Data Fields | |
| void * | jport_ = nullptr |
| JACK port. | |
| utils::Utf8String | full_name_ |
| Full port name, used also as ID. | |
| utils::Utf8String | short_name_ |
| Short port name. | |
| utils::Utf8String | alias1_ |
| Alias #1 if any. | |
| utils::Utf8String | alias2_ |
| Alias #2 if any. | |
| int | num_aliases_ = 0 |
| Type | type_ = (Type) 0 |
| bool | is_midi_ = false |
| True if MIDI, false if audio. | |
| int | hw_processor_index_ = -1 |
| Index in the HW processor (cache for real-time use) | |
| HardwareProcessor * | hw_processor_ = nullptr |
| Pointer to owner hardware processor, if any. | |
| bool | active_ = false |
| Whether the port is active and receiving events (for use by hw processor). | |
| bool | pending_reconnect_ = false |
| Set to true when a hardware port is disconnected. | |
| Port * | port_ = nullptr |
| Temporary port to receive data. | |
Friends | |
| bool | operator== (const ExtPort &a, const ExtPort &b) |
| void | to_json (nlohmann::json &j, const ExtPort &port) |
| void | from_json (const nlohmann::json &j, ExtPort &port) |
| bool | operator== (const ExtPort &a, const ExtPort &b) |
External port.
Definition at line 35 of file ext_port.h.
| using ExtPort::PortFlow = zrythm::dsp::PortFlow |
Definition at line 51 of file ext_port.h.
| using ExtPort::PortType = zrythm::dsp::PortType |
Definition at line 50 of file ext_port.h.
|
strong |
External port type.
Definition at line 41 of file ext_port.h.
| bool ExtPort::activate | ( | Port * | port, |
| bool | activate ) |
Activates the port (starts receiving data) or deactivates it.
| port | Port to send the output to. |
| void ExtPort::disconnect | ( | Port * | port, |
| int | src ) |
|
static |
Collects external ports of the given type.
| flow | The signal flow. Note that this is inverse to what Zrythm sees. E.g., to get MIDI inputs like MIDI keyboards, pass Z_PORT_FLOW_OUTPUT here. |
| hw | Hardware or not. |
| bool ExtPort::get_enabled | ( | ) | const |
Checks in the GSettings whether this port is marked as enabled by the user.
|
overridevirtual |
Reimplemented from IPortOwner.
|
inline |
Inits the ExtPort after loading a project.
Definition at line 70 of file ext_port.h.
|
overridevirtual |
Implements IPortOwner.
|
overridevirtual |
Function that will be called by the Port to update the identifier's relevant members based on this port owner.
| id | The identifier to update. |
Implements IPortOwner.
|
friend |
Definition at line 183 of file ext_port.h.
Definition at line 194 of file ext_port.h.
|
friend |
Definition at line 171 of file ext_port.h.
| bool ExtPort::active_ = false |
Whether the port is active and receiving events (for use by hw processor).
Definition at line 234 of file ext_port.h.
| utils::Utf8String ExtPort::alias1_ |
Alias #1 if any.
Definition at line 214 of file ext_port.h.
| utils::Utf8String ExtPort::alias2_ |
Alias #2 if any.
Definition at line 217 of file ext_port.h.
| utils::Utf8String ExtPort::full_name_ |
Full port name, used also as ID.
Definition at line 208 of file ext_port.h.
| HardwareProcessor* ExtPort::hw_processor_ = nullptr |
Pointer to owner hardware processor, if any.
Definition at line 230 of file ext_port.h.
| int ExtPort::hw_processor_index_ = -1 |
Index in the HW processor (cache for real-time use)
Definition at line 227 of file ext_port.h.
| bool ExtPort::is_midi_ = false |
True if MIDI, false if audio.
Definition at line 224 of file ext_port.h.
| void* ExtPort::jport_ = nullptr |
JACK port.
Definition at line 204 of file ext_port.h.
| int ExtPort::num_aliases_ = 0 |
Definition at line 219 of file ext_port.h.
| bool ExtPort::pending_reconnect_ = false |
Set to true when a hardware port is disconnected.
Hardware processor will then attempt to reconnect next scan.
Definition at line 241 of file ext_port.h.
| Port* ExtPort::port_ = nullptr |
Temporary port to receive data.
Definition at line 246 of file ext_port.h.
| utils::Utf8String ExtPort::short_name_ |
Short port name.
Definition at line 211 of file ext_port.h.
Definition at line 221 of file ext_port.h.