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

A connection between two ports. More...

#include <src/dsp/port_connection.h>

Inheritance diagram for zrythm::dsp::PortConnection:
Collaboration diagram for zrythm::dsp::PortConnection:

Public Member Functions

 PortConnection (QObject *parent=nullptr)
 PortConnection (const PortUuid &src, const PortUuid &dest, float multiplier, bool locked, bool enabled, QObject *parent=nullptr)
void update (float multiplier, bool locked, bool enabled)
void set_bipolar (bool bipolar)
void set_channel_mapping (uint8_t source_channel, uint8_t destination_channel)
void unset_channel_mapping ()

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.
bool bipolar_ {}
 Range type for CV->CV connections, where the destination port is used for modulating parameters.
std::optional< std::pair< uint8_t, uint8_t > > source_ch_to_destination_ch_mapping_
 Optional source channel to destination channel mapping.

Friends

void to_json (nlohmann::json &j, const PortConnection &port_connection)
void from_json (const nlohmann::json &j, PortConnection &port_connection)
void init_from (PortConnection &obj, const PortConnection &other, utils::ObjectCloneType clone_type)
bool operator== (const PortConnection &lhs, const PortConnection &rhs)

Detailed Description

A connection between two ports.

Definition at line 16 of file port_connection.h.

Member Function Documentation

◆ set_bipolar()

void zrythm::dsp::PortConnection::set_bipolar ( bool bipolar)
inline

Definition at line 39 of file port_connection.h.

◆ set_channel_mapping()

void zrythm::dsp::PortConnection::set_channel_mapping ( uint8_t source_channel,
uint8_t destination_channel )
inline

Definition at line 41 of file port_connection.h.

◆ unset_channel_mapping()

void zrythm::dsp::PortConnection::unset_channel_mapping ( )
inline

Definition at line 46 of file port_connection.h.

◆ update()

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

Definition at line 32 of file port_connection.h.

◆ from_json

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

Definition at line 72 of file port_connection.h.

◆ operator==

bool operator== ( const PortConnection & lhs,
const PortConnection & rhs )
friend

Definition at line 89 of file port_connection.h.

◆ to_json

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

Definition at line 60 of file port_connection.h.

Field Documentation

◆ bipolar_

bool zrythm::dsp::PortConnection::bipolar_ {}

Range type for CV->CV connections, where the destination port is used for modulating parameters.

If true, modulation will be applied in bipolar fashion, where the midpoint is the base parameter value. Otherwise (and by default), modulation will be added to the base parameter value.

Note
only used for connections matching the above description.

Definition at line 131 of file port_connection.h.

◆ dest_id_

PortUuid zrythm::dsp::PortConnection::dest_id_

Definition at line 96 of file port_connection.h.

◆ enabled_

bool zrythm::dsp::PortConnection::enabled_ = true

Whether the connection is enabled.

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

Definition at line 119 of file port_connection.h.

◆ locked_

bool zrythm::dsp::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 112 of file port_connection.h.

◆ multiplier_

float zrythm::dsp::PortConnection::multiplier_ = 1.0f

Multiplier to apply, where applicable.

Range: 0 to 1. Default: 1.

Definition at line 104 of file port_connection.h.

◆ source_ch_to_destination_ch_mapping_

std::optional<std::pair<uint8_t, uint8_t> > zrythm::dsp::PortConnection::source_ch_to_destination_ch_mapping_

Optional source channel to destination channel mapping.

Used for audio ports. If this is nullopt for an audio port connection then the destination port is expected to use a reasonable approach to merge the source channels into the destination channels.

Definition at line 140 of file port_connection.h.

◆ src_id_

PortUuid zrythm::dsp::PortConnection::src_id_

Definition at line 95 of file port_connection.h.


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