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

The last source to move wins. More...

Detailed Description

template<uint8_t N>
class sbl::control::Latest< N >

The last source to move wins.

Continuous sources (a pot polled every tick) report through update(): a report counts as a write only when the source has moved more than the threshold since its own last write, so a resting knob's noise cannot take the parameter from a CC. The first report from a source sets its baseline without taking ownership. Event sources (a CC) report through write(): every call is a write.

Definition at line 85 of file merge.hpp.

#include <merge.hpp>

Public Member Functions

 Latest (float threshold=0.001f)
 
void update (uint8_t source, float value)
 
void write (uint8_t source, float value)
 
float value () const
 
int8_t owner () const
 Source that wrote last, or -1 before any write.
 

Constructor & Destructor Documentation

◆ Latest()

template<uint8_t N>
sbl::control::Latest< N >::Latest ( float  threshold = 0.001f)
inlineexplicit

Definition at line 89 of file merge.hpp.

Member Function Documentation

◆ update()

template<uint8_t N>
void sbl::control::Latest< N >::update ( uint8_t  source,
float  value 
)
inline

Definition at line 91 of file merge.hpp.

References sbl::control::Latest< N >::value().

◆ write()

template<uint8_t N>
void sbl::control::Latest< N >::write ( uint8_t  source,
float  value 
)
inline

Definition at line 103 of file merge.hpp.

References sbl::control::Latest< N >::value().

◆ value()

template<uint8_t N>
float sbl::control::Latest< N >::value ( ) const
inline

◆ owner()

template<uint8_t N>
int8_t sbl::control::Latest< N >::owner ( ) const
inline

Source that wrote last, or -1 before any write.

Definition at line 112 of file merge.hpp.


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