Sound Byte Libs 0.5.1-340-gab5b79a
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
sbl::control::Selector< Positions > Class Template Reference

Detailed Description

template<uint8_t Positions>
class sbl::control::Selector< Positions >

select() with hysteresis: the position changes only once the control is past a boundary by margin of one position's share of the travel.

Definition at line 42 of file selector.hpp.

#include <selector.hpp>

Public Member Functions

constexpr Selector (float margin=0.1f)
 
uint8_t update (float control)
 
uint8_t position () const
 
void reset ()
 

Constructor & Destructor Documentation

◆ Selector()

template<uint8_t Positions>
constexpr sbl::control::Selector< Positions >::Selector ( float  margin = 0.1f)
inlineexplicitconstexpr
Parameters
marginthe hysteresis, as a share of one position's width, in [0, 0.5)

Definition at line 47 of file selector.hpp.

Member Function Documentation

◆ update()

template<uint8_t Positions>
uint8_t sbl::control::Selector< Positions >::update ( float  control)
inline

The position for the control's value now. The first call takes select()'s answer.

Definition at line 50 of file selector.hpp.

References sbl::control::select().

◆ position()

template<uint8_t Positions>
uint8_t sbl::control::Selector< Positions >::position ( ) const
inline

Definition at line 69 of file selector.hpp.

◆ reset()

template<uint8_t Positions>
void sbl::control::Selector< Positions >::reset ( )
inline

Forget the position; the next update() takes select()'s answer.

Definition at line 72 of file selector.hpp.


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