Skip to content

Class daisy::MappedStringListValue

ClassList > daisy > MappedStringListValue

Inherits the following classes: daisy::MappedValue

Public Functions

Type Name
virtual void AppentToString (FixedCapStrBase< char > & string) override const
virtual float GetAs0to1 () override const
int GetIndex () const
const uint32_t * GetIndexPtr () const
const char * GetString () const
MappedStringListValue (const char ** itemStrings, uint16_t numItems, uint32_t defaultIndex)
virtual void ResetToDefault () override
virtual void SetFrom0to1 (float normalizedValue0to1) override
void SetIndex (uint32_t index)
virtual void Step (int16_t numStepsUp, bool useCoarseStepSize) override
operator const char * () const
operator int () const
MappedStringListValue & operator= (int index)
~MappedStringListValue () override

Public Functions inherited from daisy::MappedValue

See daisy::MappedValue

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

Public Functions Documentation

function AppentToString

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

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

Parameters:

  • string The string to add to

Implements daisy::MappedValue::AppentToString


function GetAs0to1

virtual float daisy::MappedStringListValue::GetAs0to1 () override const

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

Implements daisy::MappedValue::GetAs0to1


function GetIndex

inline int daisy::MappedStringListValue::GetIndex () const

Returns the current item index.


function GetIndexPtr

inline const  uint32_t * daisy::MappedStringListValue::GetIndexPtr () const

Returns a pointer to the current item index.


function GetString

inline const  char * daisy::MappedStringListValue::GetString () const

Returns the current item string.


function MappedStringListValue

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

Creates a MappedStringListValue.

Parameters:

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

function ResetToDefault

virtual void daisy::MappedStringListValue::ResetToDefault () override

Resets the value to its default.

Implements daisy::MappedValue::ResetToDefault


function SetFrom0to1

virtual void daisy::MappedStringListValue::SetFrom0to1 (
    float normalizedValue0to1
) override

Sets the value so that GetAs0to1() returns normalizedValue0to1.

Implements daisy::MappedValue::SetFrom0to1


function SetIndex

void daisy::MappedStringListValue::SetIndex (
    uint32_t index
) 

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


function Step

virtual void daisy::MappedStringListValue::Step (
    int16_t numStepsUp,
    bool useCoarseStepSize
) override

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

Implements daisy::MappedValue::Step


function operator const char *

inline daisy::MappedStringListValue::operator const char * () const

Returns the current item string.


function operator int

inline daisy::MappedStringListValue::operator int () const

Returns the current item index.


function operator=

inline MappedStringListValue & daisy::MappedStringListValue::operator= (
    int index
) 

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


function ~MappedStringListValue

inline daisy::MappedStringListValue::~MappedStringListValue () override


The documentation for this class was generated from the following file external-docs/libDaisy/src/util/MappedValue.h