Skip to content

daisy::MappedValue

#include <MappedValue.h>

Inherited by daisy::MappedFloatValue, daisy::MappedIntValue, daisy::MappedStringListValue

Public Functions

Name
virtual ~MappedValue()
virtual void AppentToString(FixedCapStrBase< char > & string) const =0
virtual void ResetToDefault() =0
virtual float GetAs0to1() const =0
virtual void SetFrom0to1(float normalizedValue0to1) =0
virtual void Step(int16_t numStepsUp, bool useCoarseStepSize) =0

Public Functions Documentation

function ~MappedValue

inline virtual ~MappedValue()

function AppentToString

virtual void AppentToString(
    FixedCapStrBase< char > & string
) const =0

Parameters:

  • string The string to add to

Reimplemented by: daisy::MappedFloatValue::AppentToString, daisy::MappedIntValue::AppentToString, daisy::MappedStringListValue::AppentToString

Generates a string representation and adds it to an existing string.


function ResetToDefault

virtual void ResetToDefault() =0

Reimplemented by: daisy::MappedFloatValue::ResetToDefault, daisy::MappedIntValue::ResetToDefault, daisy::MappedStringListValue::ResetToDefault

Resets the value to its default.


function GetAs0to1

virtual float GetAs0to1() const =0

Reimplemented by: daisy::MappedFloatValue::GetAs0to1, daisy::MappedIntValue::GetAs0to1, daisy::MappedStringListValue::GetAs0to1

Returns the 0..1 normalized representation of the value, e.g. to display a slider/knob on a UI.


function SetFrom0to1

virtual void SetFrom0to1(
    float normalizedValue0to1
) =0

Reimplemented by: daisy::MappedFloatValue::SetFrom0to1, daisy::MappedIntValue::SetFrom0to1, daisy::MappedStringListValue::SetFrom0to1

Sets the value so that [GetAs0to1()](/libDaisy/Classes/classdaisy_1_1_mapped_value/#function-getas0to1) returns normalizedValue0to1.


function Step

virtual void Step(
    int16_t numStepsUp,
    bool useCoarseStepSize
) =0

Reimplemented by: daisy::MappedFloatValue::Step, daisy::MappedIntValue::Step, daisy::MappedStringListValue::Step

Steps the value up by whatever is appropriate. This function can be used to increment/decrement the value with buttons/encoders while making use of the specific mapping.

---

Updated on 2024-01-03 at 19:41:00 +0000