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

A connection between two ports. More...

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

Inheritance diagram for PortConnection:
Collaboration diagram for PortConnection:

Public Types

using PortUuid = dsp::PortIdentifier::PortUuid
 

Public Member Functions

 PortConnection (QObject *parent=nullptr)
 
 PortConnection (const PortUuid &src, const PortUuid &dest, float multiplier, bool locked, bool enabled, QObject *parent=nullptr)
 
void init_after_cloning (const PortConnection &other, ObjectCloneType clone_type) override
 Initializes the cloned object.
 
void update (float multiplier, bool locked, bool enabled)
 
- Public Member Functions inherited from ICloneable< PortConnection >
std::unique_ptr< PortConnectionclone_unique (ObjectCloneType clone_type=ObjectCloneType::Snapshot, Args &&... args) const
 
std::shared_ptr< PortConnectionclone_shared (ObjectCloneType clone_type=ObjectCloneType::Snapshot, Args &&... args) const
 
PortConnectionclone_raw_ptr (ObjectCloneType clone_type=ObjectCloneType::Snapshot, Args &&... args) const
 
PortConnectionclone_qobject (QObject *parent, ObjectCloneType clone_type=ObjectCloneType::Snapshot, Args &&... args) const
 

Data Fields

PortUuid src_id_
 
PortUuid dest_id_
 
float multiplier_ = 1.0f
 Multiplier to apply, where applicable.
 
bool locked_ = false
 Whether the connection can be removed or the multiplier edited by the user.
 
bool enabled_ = true
 Whether the connection is enabled.
 
float base_value_ = 0.0f
 Used for CV -> control port connections.
 
- Data Fields inherited from ICloneable< PortConnection >
friend Derived
 

Friends

void to_json (nlohmann::json &j, const PortConnection &port_connection)
 
void from_json (const nlohmann::json &j, PortConnection &port_connection)
 

Detailed Description

A connection between two ports.

Definition at line 19 of file port_connection.h.

Member Typedef Documentation

◆ PortUuid

Member Function Documentation

◆ init_after_cloning()

void PortConnection::init_after_cloning ( const PortConnection & 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< PortConnection >.

◆ update()

void PortConnection::update ( float multiplier,
bool locked,
bool enabled )
inline

Definition at line 41 of file port_connection.h.

Friends And Related Symbol Documentation

◆ from_json

void from_json ( const nlohmann::json & j,
PortConnection & port_connection )
friend

Definition at line 66 of file port_connection.h.

◆ to_json

void to_json ( nlohmann::json & j,
const PortConnection & port_connection )
friend

Definition at line 56 of file port_connection.h.

Field Documentation

◆ base_value_

float PortConnection::base_value_ = 0.0f

Used for CV -> control port connections.

Definition at line 104 of file port_connection.h.

◆ dest_id_

PortUuid PortConnection::dest_id_

Definition at line 78 of file port_connection.h.

◆ enabled_

bool PortConnection::enabled_ = true

Whether the connection is enabled.

Note
The user can disable port connections only if they are not locked.

Definition at line 101 of file port_connection.h.

◆ locked_

bool PortConnection::locked_ = false

Whether the connection can be removed or the multiplier edited by the user.

Ignored when connecting things internally and only used to deter the user from breaking necessary connections.

Definition at line 94 of file port_connection.h.

◆ multiplier_

float PortConnection::multiplier_ = 1.0f

Multiplier to apply, where applicable.

Range: 0 to 1. Default: 1.

Definition at line 86 of file port_connection.h.

◆ src_id_

PortUuid PortConnection::src_id_

Definition at line 77 of file port_connection.h.


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