Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
ChannelSend Class Referencefinal

Channel send. More...

#include <src/gui/dsp/channel_send.h>

Inheritance diagram for ChannelSend:
Collaboration diagram for ChannelSend:

Data Structures

struct  SlotTag
 

Public Types

using PortType = dsp::PortType
 
using PortConnection = dsp::PortConnection
 
- Public Types inherited from IPortOwner
using TrackUuid = dsp::PortIdentifier::TrackUuid
 
using PluginUuid = dsp::PortIdentifier::PluginUuid
 
using PortUuid = dsp::PortIdentifier::PortUuid
 

Public Member Functions

 ChannelSend (ChannelTrack &track, TrackRegistry &track_registry, PortRegistry &port_registry, int slot)
 To be used when creating a new (identity) ChannelSend.
 
 ChannelSend (ChannelTrack &track, TrackRegistry &track_registry, PortRegistry &port_registry)
 To be used when deserializing.
 
 ChannelSend (TrackRegistry &track_registry, PortRegistry &port_registry)
 To be used when instantiating or cloning an existing identity.
 
void init_loaded (ChannelTrack *track)
 
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
 
bool is_prefader () const
 
ChannelTrackget_track () const
 Gets the owner track.
 
utils::Utf8String get_node_name () const override
 Returns a human friendly name of the node.
 
bool is_enabled () const
 
bool is_empty () const
 
bool is_target_sidechain ()
 Returns whether the channel send target is a sidechain port (rather than a target track).
 
Trackget_target_track ()
 Gets the target track.
 
float get_amount_for_widgets () const
 Gets the amount to be used in widgets (0.0-1.0).
 
void set_amount_from_widget (float val)
 Sets the amount from a widget amount (0.0-1.0).
 
float get_amount_value () const
 
bool connect_stereo (AudioPort &l, AudioPort &r, bool sidechain, bool recalc_graph, bool validate)
 Connects a send to stereo ports.
 
bool connect_midi (MidiPort &port, bool recalc_graph, bool validate)
 Connects a send to a midi port.
 
void disconnect (bool recalc_graph)
 Removes the connection at the given send.
 
void set_amount (float amount)
 
std::pair< AudioPort &, AudioPort & > get_stereo_in_ports () const
 
MidiPortget_midi_in_port () const
 
std::pair< AudioPort &, AudioPort & > get_stereo_out_ports () const
 
MidiPortget_midi_out_port () const
 
ControlPortget_amount_port () const
 
ControlPortget_enabled_port () const
 
utils::Utf8String get_dest_name () const
 Get the name of the destination, or a placeholder text if empty.
 
void copy_values_from (const ChannelSend &other)
 
void init_after_cloning (const ChannelSend &other, ObjectCloneType clone_type) override
 Initializes the cloned object.
 
void connect_to_owner ()
 Connects the ports to the owner track if not connected.
 
void append_ports (std::vector< Port * > &ports)
 
int append_connection (const zrythm::dsp::PortConnectionsManager *mgr, std::vector< PortConnection * > &arr) const
 Appends the connection(s), if non-empty, to the given array (if not nullptr) and returns the number of connections added.
 
void prepare_process (std::size_t block_length)
 
void process_block (EngineProcessTimeInfo time_nfo) override
 
bool is_connected_to (std::pair< PortUuid, PortUuid > stereo) const
 
bool is_connected_to (const PortUuid &midi) const
 
ChannelSendfind_in_project () const
 Finds the project send from a given send instance.
 
bool is_audio () const
 
bool is_midi () const
 
bool validate ()
 
- Public Member Functions inherited from ICloneable< ChannelSend >
std::unique_ptr< ChannelSendclone_unique (ObjectCloneType clone_type=ObjectCloneType::Snapshot, Args &&... args) const
 
std::shared_ptr< ChannelSendclone_shared (ObjectCloneType clone_type=ObjectCloneType::Snapshot, Args &&... args) const
 
ChannelSendclone_raw_ptr (ObjectCloneType clone_type=ObjectCloneType::Snapshot, Args &&... args) const
 
ChannelSendclone_qobject (QObject *parent, ObjectCloneType clone_type=ObjectCloneType::Snapshot, Args &&... args) const
 
QScopedPointer< ChannelSendclone_unique_qobject (QObject *parent, ObjectCloneType clone_type=ObjectCloneType::Snapshot, Args &&... args) const
 
- Public Member Functions inherited from zrythm::dsp::graph::IProcessable
virtual nframes_t get_single_playback_latency () const
 Returns the latency of only the given processable, without adding the previous/next latencies.
 
virtual void clear_external_buffer (nframes_t block_length)
 
virtual bool needs_external_buffer_clear_on_early_return () const
 
- 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).
 

Data Fields

PortRegistryport_registry_
 
TrackRegistrytrack_registry_
 
int slot_ = 0
 Slot index in the channel sends.
 
std::optional< PortUuidReferencestereo_in_left_id_
 Stereo input if audio send.
 
std::optional< PortUuidReferencestereo_in_right_id_
 
std::optional< PortUuidReferencemidi_in_id_
 MIDI input if MIDI send.
 
std::optional< PortUuidReferencestereo_out_left_id_
 Stereo output if audio send.
 
std::optional< PortUuidReferencestereo_out_right_id_
 
std::optional< PortUuidReferencemidi_out_id_
 MIDI output if MIDI send.
 
std::optional< PortUuidReferenceamount_id_
 Send amount (amplitude), 0 to 2 for audio, velocity multiplier for MIDI.
 
std::optional< PortUuidReferenceenabled_id_
 Whether the send is currently enabled.
 
bool is_sidechain_ = false
 If the send is a sidechain.
 
TrackUuid track_id_
 Pointer back to owner track.
 
OptionalRef< ChannelTracktrack_
 Use this if set (via the new identity constructo).
 
- Data Fields inherited from ICloneable< ChannelSend >
friend Derived
 

Friends

void to_json (nlohmann::json &j, const ChannelSend &p)
 
void from_json (const nlohmann::json &j, ChannelSend &p)
 

Detailed Description

Channel send.

The actual connection is tracked separately by PortConnectionsManager.

Definition at line 70 of file channel_send.h.

Member Typedef Documentation

◆ PortConnection

◆ PortType

using ChannelSend::PortType = dsp::PortType

Definition at line 76 of file channel_send.h.

Constructor & Destructor Documentation

◆ ChannelSend() [1/3]

ChannelSend::ChannelSend ( ChannelTrack & track,
TrackRegistry & track_registry,
PortRegistry & port_registry,
int slot )
inline

To be used when creating a new (identity) ChannelSend.

Definition at line 90 of file channel_send.h.

◆ ChannelSend() [2/3]

ChannelSend::ChannelSend ( ChannelTrack & track,
TrackRegistry & track_registry,
PortRegistry & port_registry )
inline

To be used when deserializing.

Definition at line 102 of file channel_send.h.

◆ ChannelSend() [3/3]

ChannelSend::ChannelSend ( TrackRegistry & track_registry,
PortRegistry & port_registry )
inline

To be used when instantiating or cloning an existing identity.

Definition at line 113 of file channel_send.h.

Member Function Documentation

◆ connect_midi()

bool ChannelSend::connect_midi ( MidiPort & port,
bool recalc_graph,
bool validate )

Connects a send to a midi port.

Exceptions
ZrythmExceptionif the connection fails.

◆ connect_stereo()

bool ChannelSend::connect_stereo ( AudioPort & l,
AudioPort & r,
bool sidechain,
bool recalc_graph,
bool validate )

Connects a send to stereo ports.

Exceptions
ZrythmExceptionif the connection fails.

◆ connect_to_owner()

void ChannelSend::connect_to_owner ( )

Connects the ports to the owner track if not connected.

Only to be called on project sends.

◆ get_amount_port()

ControlPort & ChannelSend::get_amount_port ( ) const
inline

Definition at line 237 of file channel_send.h.

◆ get_amount_value()

float ChannelSend::get_amount_value ( ) const
inline

Definition at line 181 of file channel_send.h.

◆ get_enabled_port()

ControlPort & ChannelSend::get_enabled_port ( ) const
inline

Definition at line 241 of file channel_send.h.

◆ get_full_designation_for_port()

utils::Utf8String ChannelSend::get_full_designation_for_port ( const dsp::PortIdentifier & id) const
overridevirtual

Reimplemented from IPortOwner.

◆ get_midi_in_port()

MidiPort & ChannelSend::get_midi_in_port ( ) const
inline

Definition at line 219 of file channel_send.h.

◆ get_midi_out_port()

MidiPort & ChannelSend::get_midi_out_port ( ) const
inline

Definition at line 233 of file channel_send.h.

◆ get_node_name()

utils::Utf8String ChannelSend::get_node_name ( ) const
overridevirtual

Returns a human friendly name of the node.

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

◆ get_stereo_in_ports()

std::pair< AudioPort &, AudioPort & > ChannelSend::get_stereo_in_ports ( ) const
inline

Definition at line 209 of file channel_send.h.

◆ get_stereo_out_ports()

std::pair< AudioPort &, AudioPort & > ChannelSend::get_stereo_out_ports ( ) const
inline

Definition at line 223 of file channel_send.h.

◆ init_after_cloning()

void ChannelSend::init_after_cloning ( const ChannelSend & other,
ObjectCloneType clone_type )
overridevirtual

Initializes the cloned object.

Note
Only final classes should implement this.
Exceptions
ZrythmExceptionIf the object could not be cloned.

Implements ICloneable< ChannelSend >.

◆ is_audio()

bool ChannelSend::is_audio ( ) const
inline

Definition at line 291 of file channel_send.h.

◆ is_connected_to() [1/2]

bool ChannelSend::is_connected_to ( const PortUuid & midi) const
inline

Definition at line 281 of file channel_send.h.

◆ is_connected_to() [2/2]

bool ChannelSend::is_connected_to ( std::pair< PortUuid, PortUuid > stereo) const
inline

Definition at line 277 of file channel_send.h.

◆ is_empty()

bool ChannelSend::is_empty ( ) const
inline

Definition at line 158 of file channel_send.h.

◆ is_in_active_project()

bool ChannelSend::is_in_active_project ( ) const
overridevirtual

Implements IPortOwner.

◆ is_midi()

bool ChannelSend::is_midi ( ) const
inline

Definition at line 292 of file channel_send.h.

◆ is_prefader()

bool ChannelSend::is_prefader ( ) const
inline

Definition at line 144 of file channel_send.h.

◆ process_block()

void ChannelSend::process_block ( EngineProcessTimeInfo time_nfo)
overridevirtual

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

◆ set_port_metadata_from_owner()

void ChannelSend::set_port_metadata_from_owner ( dsp::PortIdentifier & id,
PortRange & range ) const
overridevirtual

Function that will be called by the Port to update the identifier's relevant members based on this port owner.

Parameters
idThe identifier to update.

Implements IPortOwner.

Friends And Related Symbol Documentation

◆ from_json

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

Definition at line 324 of file channel_send.h.

◆ to_json

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

Definition at line 308 of file channel_send.h.

Field Documentation

◆ amount_id_

std::optional<PortUuidReference> ChannelSend::amount_id_

Send amount (amplitude), 0 to 2 for audio, velocity multiplier for MIDI.

Definition at line 394 of file channel_send.h.

◆ enabled_id_

std::optional<PortUuidReference> ChannelSend::enabled_id_

Whether the send is currently enabled.

If enabled, corresponding connection(s) will exist in PortConnectionsManager.

Definition at line 402 of file channel_send.h.

◆ is_sidechain_

bool ChannelSend::is_sidechain_ = false

If the send is a sidechain.

Definition at line 405 of file channel_send.h.

◆ midi_in_id_

std::optional<PortUuidReference> ChannelSend::midi_in_id_

MIDI input if MIDI send.

Prefader or fader MIDI out should connect here.

Definition at line 375 of file channel_send.h.

◆ midi_out_id_

std::optional<PortUuidReference> ChannelSend::midi_out_id_

MIDI output if MIDI send.

This should connect to the send destination, if any.

Definition at line 390 of file channel_send.h.

◆ port_registry_

PortRegistry& ChannelSend::port_registry_

Definition at line 356 of file channel_send.h.

◆ slot_

int ChannelSend::slot_ = 0

Slot index in the channel sends.

Definition at line 360 of file channel_send.h.

◆ stereo_in_left_id_

std::optional<PortUuidReference> ChannelSend::stereo_in_left_id_

Stereo input if audio send.

Prefader or fader stereo out should connect here.

Definition at line 367 of file channel_send.h.

◆ stereo_in_right_id_

std::optional<PortUuidReference> ChannelSend::stereo_in_right_id_

Definition at line 368 of file channel_send.h.

◆ stereo_out_left_id_

std::optional<PortUuidReference> ChannelSend::stereo_out_left_id_

Stereo output if audio send.

This should connect to the send destination, if any.

Definition at line 382 of file channel_send.h.

◆ stereo_out_right_id_

std::optional<PortUuidReference> ChannelSend::stereo_out_right_id_

Definition at line 383 of file channel_send.h.

◆ track_

OptionalRef<ChannelTrack> ChannelSend::track_

Use this if set (via the new identity constructo).

Definition at line 416 of file channel_send.h.

◆ track_id_

TrackUuid ChannelSend::track_id_

Pointer back to owner track.

Owner track ID.

Definition at line 411 of file channel_send.h.

◆ track_registry_

TrackRegistry& ChannelSend::track_registry_

Definition at line 357 of file channel_send.h.


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