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

Public Types

enum class  Type : std::uint8_t {
  Linear , Toggle , Integer , GainAmplitude ,
  Logarithmic , Enumeration , Trigger
}
enum class  Unit : std::uint8_t {
  None , Hz , MHz , Db ,
  Degrees , Seconds , Ms , Us
}
 Unit to be displayed in the UI. More...

Public Member Functions

 ParameterRange (Type type, float min, float max, float zero=0.f, float def=0.f)
constexpr float clamp_to_range (float val) const
Q_INVOKABLE float convertFrom0To1 (float normalized_val) const
Q_INVOKABLE float convertTo0To1 (float real_val) const
bool is_toggled (float normalized_val) const

Static Public Member Functions

static utils::Utf8String unit_to_string (Unit unit)
static ParameterRange make_toggle (bool default_val)
static ParameterRange make_gain (float max_val)

Data Fields

NLOHMANN_DEFINE_TYPE_INTRUSIVE(ParameterRange, type_, minf_, maxf_, zerof_, deff_, unit_) public Unit unit_ {}
 Parameter unit.
float minf_ { 0.f }
 Minimum, maximum and zero values for this parameter.
float maxf_ { 1.f }
float zerof_ { 0.f }
 The zero position of the port.
float deff_ { 0.f }
 Default value.

Detailed Description

Definition at line 19 of file parameter.h.

Member Enumeration Documentation

◆ Type

enum class zrythm::dsp::ParameterRange::Type : std::uint8_t
strong
Enumerator
Linear 

Linearly-scaled float parameter.

Toggle 

Whether the port is a toggle (on/off).

See also
Trigger
Integer 

Whether the port is an integer.

GainAmplitude 

Parameter is a gain amplitude (0-2.0).

Note
This is a special logarithmic-scaled parameter for gain parameters.
Logarithmic 

Logarithmic-scaled float parameter.

Enumeration 

Port's only reasonable values are its scale points.

Trigger 

Trigger parameters are set to on to trigger a change during processing and then turned off at the end of each cycle.

Used trigger eg, transport play/pause.

Definition at line 24 of file parameter.h.

◆ Unit

enum class zrythm::dsp::ParameterRange::Unit : std::uint8_t
strong

Unit to be displayed in the UI.

Enumerator
Ms 

Milliseconds.

Us 

Microseconds.

Definition at line 67 of file parameter.h.

Constructor & Destructor Documentation

◆ ParameterRange()

zrythm::dsp::ParameterRange::ParameterRange ( Type type,
float min,
float max,
float zero = 0.f,
float def = 0.f )
inline

Definition at line 94 of file parameter.h.

Member Function Documentation

◆ clamp_to_range()

float zrythm::dsp::ParameterRange::clamp_to_range ( float val) const
inlineconstexpr

Definition at line 109 of file parameter.h.

◆ convertFrom0To1()

Q_INVOKABLE float zrythm::dsp::ParameterRange::convertFrom0To1 ( float normalized_val) const
inline

Definition at line 114 of file parameter.h.

◆ convertTo0To1()

Q_INVOKABLE float zrythm::dsp::ParameterRange::convertTo0To1 ( float real_val) const
inline

Definition at line 140 of file parameter.h.

◆ is_toggled()

bool zrythm::dsp::ParameterRange::is_toggled ( float normalized_val) const
inline

Definition at line 167 of file parameter.h.

◆ make_gain()

ParameterRange zrythm::dsp::ParameterRange::make_gain ( float max_val)
inlinestatic

Definition at line 104 of file parameter.h.

◆ make_toggle()

ParameterRange zrythm::dsp::ParameterRange::make_toggle ( bool default_val)
inlinestatic

Definition at line 100 of file parameter.h.

◆ unit_to_string()

utils::Utf8String zrythm::dsp::ParameterRange::unit_to_string ( Unit unit)
inlinestatic

Definition at line 83 of file parameter.h.

Field Documentation

◆ deff_

float zrythm::dsp::ParameterRange::deff_ { 0.f }

Default value.

Definition at line 204 of file parameter.h.

◆ maxf_

float zrythm::dsp::ParameterRange::maxf_ { 1.f }

Definition at line 192 of file parameter.h.

◆ minf_

float zrythm::dsp::ParameterRange::minf_ { 0.f }

Minimum, maximum and zero values for this parameter.

Definition at line 191 of file parameter.h.

◆ unit_

NLOHMANN_DEFINE_TYPE_INTRUSIVE ( ParameterRange, type_, minf_, maxf_, zerof_, deff_, unit_) public Unit zrythm::dsp::ParameterRange::unit_ {}

Parameter unit.

Definition at line 186 of file parameter.h.

◆ zerof_

float zrythm::dsp::ParameterRange::zerof_ { 0.f }

The zero position of the port.

For example, in balance controls, this will be the middle.

Definition at line 199 of file parameter.h.


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