#include <audio/utility/linearsmoothedvalue.h>
Public Member Functions | |
LinearSmoothedValue (const T &initValue, int stepCount) | |
void | reset (const T &initValue) |
void | setStepCount (int stepCount) |
void | setValue (const T &destination) |
T | getNextValue () |
T | getValue () const |
T | getDestination () const |
bool | isRamping () const |
Used to smooth changed to a value linearly over time, using a fixed smoothing time.
LinearSmoothedValue | ( | const T & | initValue, |
int | stepCount | ||
) |
T getDestination | ( | ) | const |
T getNextValue | ( | ) |
Take the next step in the current ramp. Should only be called from the audio thread.
T getValue | ( | ) | const |
Returns the current value. Should only be called from the audio thread
bool isRamping | ( | ) | const |
Returns true when currently playing a ramp. Should only be called from the audio thread.
void reset | ( | const T & | initValue | ) |
Quit all smoothing in progress and reset output to the passed value. Don't call this while getNextValue() can be called.
initValue | the new output value. |
void setStepCount | ( | int | stepCount | ) |
Change the number of steps the value takes to reach a new destination.
void setValue | ( | const T & | destination | ) |
Start a ramp
destination | the finishing value |