DISTRHO Plugin Framework
Public Member Functions | Public Attributes | List of all members
ParameterRanges Struct Reference

#include <DistrhoDetails.hpp>

Public Member Functions

constexpr ParameterRanges () noexcept
 
constexpr ParameterRanges (const float df, const float mn, const float mx) noexcept
 
void fixDefault () noexcept
 
void fixValue (float &value) const noexcept
 
float getFixedValue (const float value) const noexcept
 
float getNormalizedValue (const float value) const noexcept
 
double getNormalizedValue (const double &value) const noexcept
 
float getFixedAndNormalizedValue (const float value) const noexcept
 
double getFixedAndNormalizedValue (const double value) const noexcept
 
float getUnnormalizedValue (const float value) const noexcept
 
double getUnnormalizedValue (const double value) const noexcept
 

Public Attributes

float def
 
float min
 
float max
 

Detailed Description

Parameter ranges.
This is used to set the default, minimum and maximum values of a parameter.

By default a parameter has 0.0 as minimum, 1.0 as maximum and 0.0 as default.
When changing this struct values you must ensure maximum > minimum and default is within range.

Constructor & Destructor Documentation

◆ ParameterRanges() [1/2]

constexpr ParameterRanges::ParameterRanges ( )
inlineconstexprnoexcept

Default constructor, using 0.0 as default, 0.0 as minimum, 1.0 as maximum.

◆ ParameterRanges() [2/2]

constexpr ParameterRanges::ParameterRanges ( const float  df,
const float  mn,
const float  mx 
)
inlineconstexprnoexcept

Constructor using custom values.

Member Function Documentation

◆ fixDefault()

void ParameterRanges::fixDefault ( )
inlinenoexcept

Fix the default value within range.

◆ fixValue()

void ParameterRanges::fixValue ( float &  value) const
inlinenoexcept

Fix a value within range.

◆ getFixedValue()

float ParameterRanges::getFixedValue ( const float  value) const
inlinenoexcept

Get a fixed value within range.

◆ getNormalizedValue() [1/2]

float ParameterRanges::getNormalizedValue ( const float  value) const
inlinenoexcept

Get a value normalized to 0.0<->1.0.

◆ getNormalizedValue() [2/2]

double ParameterRanges::getNormalizedValue ( const double &  value) const
inlinenoexcept

Get a value normalized to 0.0<->1.0. Overloaded function using double precision values.

◆ getFixedAndNormalizedValue() [1/2]

float ParameterRanges::getFixedAndNormalizedValue ( const float  value) const
inlinenoexcept

Get a value normalized to 0.0<->1.0, fixed within range.

◆ getFixedAndNormalizedValue() [2/2]

double ParameterRanges::getFixedAndNormalizedValue ( const double  value) const
inlinenoexcept

Get a value normalized to 0.0<->1.0, fixed within range. Overloaded function using double precision values.

◆ getUnnormalizedValue() [1/2]

float ParameterRanges::getUnnormalizedValue ( const float  value) const
inlinenoexcept

Get a proper value previously normalized to 0.0<->1.0.

◆ getUnnormalizedValue() [2/2]

double ParameterRanges::getUnnormalizedValue ( const double  value) const
inlinenoexcept

Get a proper value previously normalized to 0.0<->1.0. Overloaded function using double precision values.

Member Data Documentation

◆ def

float ParameterRanges::def

Default value.

◆ min

float ParameterRanges::min

Minimum value.

◆ max

float ParameterRanges::max

Maximum value.


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