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

Public Member Functions

 PortRange (float min, float max, float zero=0.f)
float clamp_to_range (float val) const

Data Fields

float minf_ = 0.f
 Minimum, maximum and zero values for this port.
float maxf_ = 1.f
float zerof_ = 0.f
 The zero position of the port.

Friends

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

Detailed Description

Definition at line 24 of file port.h.

Constructor & Destructor Documentation

◆ PortRange()

PortRange::PortRange ( float min,
float max,
float zero = 0.f )
inline

Definition at line 29 of file port.h.

Member Function Documentation

◆ clamp_to_range()

float PortRange::clamp_to_range ( float val) const
inline

Definition at line 34 of file port.h.

◆ from_json

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

Definition at line 49 of file port.h.

◆ to_json

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

Definition at line 43 of file port.h.

Field Documentation

◆ maxf_

float PortRange::maxf_ = 1.f

Definition at line 64 of file port.h.

◆ minf_

float PortRange::minf_ = 0.f

Minimum, maximum and zero values for this port.

Note that for audio, this is the amplitude (0 - 2) and not the actual values.

Definition at line 63 of file port.h.

◆ zerof_

float PortRange::zerof_ = 0.f

The zero position of the port.

For example, in balance controls, this will be the middle. In audio ports, this will be 0 amp (silence), etc.

Definition at line 72 of file port.h.


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