Iridescence 1.00
Embedded Graphic Framework
Loading...
Searching...
No Matches
DsValueBase Class Referenceabstract

DsValueBase is a base class that contains a float value. More...

#include <ds_value_base.h>

Inheritance diagram for DsValueBase:
[legend]

Public Member Functions

void setValueRange (float min, float max)
 Sets the value range.
 
void setValue (float value)
 Sets the value.
 
float getValue (void) const
 Returns the value.
 
void setOnChangeCallback (const lambda< void(float value, bool in_motion, bool user_input)> &cb)
 

Protected Member Functions

float getNormalizedValue (float value)
 
void notifyValueChange (bool in_motion)
 
virtual float onValueChange (float value)=0
 

Protected Attributes

float mMinValue
 
float mMaxValue
 
float mValue
 

Detailed Description

DsValueBase is a base class that contains a float value.

Member Function Documentation

◆ getValue()

float DsValueBase::getValue ( void  ) const

Returns the value.

Returns
Value

◆ setOnChangeCallback()

void DsValueBase::setOnChangeCallback ( const lambda< void(float value, bool in_motion, bool user_input)> &  cb)

Sets the lambda that will receive value change events.

Parameters
actionLambda of type void(float value, bool in_motion, bool user_input) that will be called whenever the value of the control changes.
  • value is the new value of the control.
  • in_motion is true if the control is still in motion and false when the motion stopped and the user lifted the finger off the control.
  • user_input is true if the change happened as a result of the user manipulating the control or false if the control was changed programatically by calling the setValue() method.

◆ setValue()

void DsValueBase::setValue ( float  value)

Sets the value.

Parameters
stateNew value. It will be saturated in the interval [min, max] set by setValueRange()

◆ setValueRange()

void DsValueBase::setValueRange ( float  min,
float  max 
)

Sets the value range.

Parameters
minMinimum value. Default is 0.
maxMaximum value. Default is 1.0.

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