Skip to content

daisy::MappedIntValue

#include <MappedValue.h>

Inherits from daisy::MappedValue

Public Functions

Name
MappedIntValue(int min, int max, int defaultValue, int stepSizeFine, int stepSizeCoarse, const char * unitStr ="", bool forceSign =false)
~MappedIntValue() override
int Get() const
const int * GetPtr() const
void Set(int newValue)
operator int() const
MappedIntValue & operator=(int val)
virtual void AppentToString(FixedCapStrBase< char > & string) const override
virtual void ResetToDefault() override
virtual float GetAs0to1() const override
virtual void SetFrom0to1(float normalizedValue0to1) override
virtual void Step(int16_t numStepsUp, bool useCoarseStepSize) override

Additional inherited members

Public Functions inherited from daisy::MappedValue

Name
virtual ~MappedValue()

Public Functions Documentation

function MappedIntValue

MappedIntValue(
    int min,
    int max,
    int defaultValue,
    int stepSizeFine,
    int stepSizeCoarse,
    const char * unitStr ="",
    bool forceSign =false
)

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
  • stepSizeFine A fine step size to use in the [Step()](/libDaisy/Classes/classdaisy_1_1_mapped_int_value/#function-step) function
  • stepSizeCoarse A coarse step size to use in the [Step()](/libDaisy/Classes/classdaisy_1_1_mapped_int_value/#function-step) function
  • unitStr A string for the unit, e.g. "Hz"
  • forceSign Controls whether AppendToString() always prints the sign, even for positive numbers

Creates a MappedIntValue.


function ~MappedIntValue

inline ~MappedIntValue() override

function Get

inline int Get() const

Returns the current value.


function GetPtr

inline const int * GetPtr() const

Returns a const pointer to the current value.


function Set

void Set(
    int newValue
)

Sets the value, clamping it to the valid range.


function operator int

inline operator int() const

Returns the current value.


function operator=

inline MappedIntValue & operator=(
    int val
)

Sets the value, clamping it to the valid range.


function AppentToString

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

Parameters:

  • string The string to add to

Reimplements: daisy::MappedValue::AppentToString

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


function ResetToDefault

virtual void ResetToDefault() override

Reimplements: daisy::MappedValue::ResetToDefault

Resets the value to its default.


function GetAs0to1

virtual float GetAs0to1() const override

Reimplements: daisy::MappedValue::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
) override

Reimplements: daisy::MappedValue::SetFrom0to1

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


function Step

virtual void Step(
    int16_t numStepsUp,
    bool useCoarseStepSize
) override

Reimplements: daisy::MappedValue::Step

Steps the value up or down using the step sizes specified in the constructor.

---

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