libDaisy
Hardware Library for Daisy
Loading...
Searching...
No Matches
daisy::MappedStringListValue Class Reference

#include <MappedValue.h>

Inheritance diagram for daisy::MappedStringListValue:
daisy::MappedValue

Public Member Functions

 MappedStringListValue (const char **itemStrings, uint16_t numItems, uint32_t defaultIndex)
 
 ~MappedStringListValue () override
 
int GetIndex () const
 
const charGetString () const
 
const uint32_tGetIndexPtr () const
 
void SetIndex (uint32_t index)
 
 operator int () const
 
 operator const char * () const
 
MappedStringListValueoperator= (int index)
 
void AppentToString (FixedCapStrBase< char > &string) const override
 
void ResetToDefault () override
 
float GetAs0to1 () const override
 
void SetFrom0to1 (float normalizedValue0to1) override
 
void Step (int16_t numStepsUp, bool useCoarseStepSize) override
 
- Public Member Functions inherited from daisy::MappedValue
virtual ~MappedValue ()
 

Constructor & Destructor Documentation

◆ MappedStringListValue()

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

Creates a MappedStringListValue.

Parameters
itemStringsAn Array of strings, one for each possible item.
numItemsThe number of possible items
defaultIndexThe default index

◆ ~MappedStringListValue()

daisy::MappedStringListValue::~MappedStringListValue ( )
inlineoverride

Member Function Documentation

◆ AppentToString()

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

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

Parameters
stringThe string to add to

Implements daisy::MappedValue.

◆ GetAs0to1()

float daisy::MappedStringListValue::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.

◆ GetIndex()

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

Returns the current item index.

◆ GetIndexPtr()

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

Returns a pointer to the current item index.

◆ GetString()

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

Returns the current item string.

◆ operator const char *()

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

Returns the current item string.

◆ operator int()

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

Returns the current item index.

◆ operator=()

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

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

◆ ResetToDefault()

void daisy::MappedStringListValue::ResetToDefault ( )
overridevirtual

Resets the value to its default.

Implements daisy::MappedValue.

◆ SetFrom0to1()

void daisy::MappedStringListValue::SetFrom0to1 ( float  normalizedValue0to1)
overridevirtual

Sets the value so that GetAs0to1() returns normalizedValue0to1.

Implements daisy::MappedValue.

◆ SetIndex()

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

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

◆ Step()

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

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.


The documentation for this class was generated from the following file: