Skip to content

daisy::MappedStringListValue

#include <MappedValue.h>

Inherits from daisy::MappedValue

Public Functions

Name
MappedStringListValue(const char ** itemStrings, uint16_t numItems, uint32_t defaultIndex)
~MappedStringListValue() override
int GetIndex() const
const char * GetString() const
const uint32_t * GetIndexPtr() const
void SetIndex(uint32_t index)
operator int() const
operator const char *() const
MappedStringListValue & operator=(int index)
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 MappedStringListValue

MappedStringListValue(
    const char ** itemStrings,
    uint16_t numItems,
    uint32_t defaultIndex
)

Parameters:

  • itemStrings An Array of strings, one for each possible item.
  • numItems The number of possible items
  • defaultIndex The default index

Creates a MappedStringListValue.


function ~MappedStringListValue

inline ~MappedStringListValue() override

function GetIndex

inline int GetIndex() const

Returns the current item index.


function GetString

inline const char * GetString() const

Returns the current item string.


function GetIndexPtr

inline const uint32_t * GetIndexPtr() const

Returns a pointer to the current item index.


function SetIndex

void SetIndex(
    uint32_t index
)

Sets the current item index, clamping it to a valid item index.


function operator int

inline operator int() const

Returns the current item index.


function operator const char *

inline operator const char *() const

Returns the current item string.


function operator=

inline MappedStringListValue & operator=(
    int index
)

Sets the current item index, clamping it to a valid item index.


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_string_list_value/#function-getas0to1) returns normalizedValue0to1.


function Step

virtual void Step(
    int16_t numStepsUp,
    bool useCoarseStepSize
) override

Reimplements: daisy::MappedValue::Step

Steps through the items up or down. If the coarse step size is used, the value will jump to the first or last item.

---

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