Mozzi  version v1.1.0
sound synthesis library for Arduino
AutoRange< T > Class Template Reference

Keeps a running calculation of the range of the input values it receives. More...

#include <AutoRange.h>

Public Member Functions

 AutoRange (T min_expected, T max_expected)
 Constructor. More...
 
void next (T n)
 Updates the current range. More...
 
getMin ()
 Returns the current minimum. More...
 
getMax ()
 Returns the current maximum. More...
 
getRange ()
 Returns the current range. More...
 

Detailed Description

template<class T>
class AutoRange< T >

Keeps a running calculation of the range of the input values it receives.

Definition at line 18 of file AutoRange.h.

Constructor & Destructor Documentation

◆ AutoRange()

template<class T>
AutoRange< T >::AutoRange ( min_expected,
max_expected 
)
inline

Constructor.

Template Parameters
Tthe type of numbers to to use, eg. int, unsigned int, float etc.
Parameters
min_expectedthe minimum possible input value.
max_expectedthe maximum possible input value.

Definition at line 27 of file AutoRange.h.

Member Function Documentation

◆ getMax()

template<class T>
T AutoRange< T >::getMax ( )
inline

Returns the current maximum.

Returns
maximum

Definition at line 64 of file AutoRange.h.

◆ getMin()

template<class T>
T AutoRange< T >::getMin ( )
inline

Returns the current minimum.

Returns
minimum

Definition at line 55 of file AutoRange.h.

◆ getRange()

template<class T>
T AutoRange< T >::getRange ( )
inline

Returns the current range.

Returns
range

Definition at line 73 of file AutoRange.h.

◆ next()

template<class T>
void AutoRange< T >::next ( n)
inline

Updates the current range.

Parameters
nthe next value to include in the range calculation.

Definition at line 35 of file AutoRange.h.