#include <MappedValue.h>
◆ Mapping
The availablke mapping functions
Enumerator |
---|
lin | The value is mapped linearly between min and max.
|
log | The value is mapped logarithmically. Note that the valid values must be strictly larger than zero, so: min > 0, max > 0
|
pow2 | The value is mapped with a square law
|
◆ MappedFloatValue()
Creates a MappedFloatValue.
- Parameters
-
min | The lower end of the range of possible values |
max | The upper end of the range of possible values |
defaultValue | The default value |
mapping | The Mapping to use. Note that for Mapping::log min , max and `defaultValue must be > 0 |
unitStr | A string for the unit, e.g. "Hz" |
numDecimals | Controls the number of decimals in AppendToString() |
forceSign | Controls whether AppendToString() always prints the sign, even for positive numbers |
◆ ~MappedFloatValue()
daisy::MappedFloatValue::~MappedFloatValue |
( |
| ) |
|
|
inlineoverride |
◆ AppentToString()
Generates a string representation and adds it to an existing string.
- Parameters
-
string | The string to add to |
Implements daisy::MappedValue.
◆ Get()
float daisy::MappedFloatValue::Get |
( |
| ) |
const |
|
inline |
Returns the current value.
◆ GetAs0to1()
float daisy::MappedFloatValue::GetAs0to1 |
( |
| ) |
const |
|
overridevirtual |
Returns the 0..1 normalized representation of the value, e.g. to display a slider/knob on a UI.
Implements daisy::MappedValue.
◆ GetPtr()
const float * daisy::MappedFloatValue::GetPtr |
( |
| ) |
const |
|
inline |
Returns a const pointer to the current value.
◆ operator float()
daisy::MappedFloatValue::operator float |
( |
| ) |
const |
|
inline |
Returns the current value.
◆ operator=()
Sets the value, clamping it to the valid range.
◆ ResetToDefault()
void daisy::MappedFloatValue::ResetToDefault |
( |
| ) |
|
|
overridevirtual |
◆ Set()
void daisy::MappedFloatValue::Set |
( |
float |
newValue | ) |
|
Sets the value, clamping it to the valid range.
◆ SetFrom0to1()
void daisy::MappedFloatValue::SetFrom0to1 |
( |
float |
normalizedValue0to1 | ) |
|
|
overridevirtual |
◆ Step()
void daisy::MappedFloatValue::Step |
( |
int16_t |
numStepsUp, |
|
|
bool |
useCoarseStepSize |
|
) |
| |
|
overridevirtual |
Steps the 0..1 normalized representation of the value up or down in 1% or 5% steps.
Implements daisy::MappedValue.
The documentation for this class was generated from the following file: