#include <audio/utility/rampedvalue.h>
Public Member Functions | |
RampedValue (const T &initValue) | |
void | setValue (const T &value) |
void | ramp (const T &destination, int stepCount, RampMode mode=RampMode::Linear) |
void | stop () |
T | getNextValue () |
T | getValue () const |
bool | isRamping () const |
Public Attributes | |
nap::Signal< T > | destinationReachedSignal |
T | mIncrement |
T | mFactor |
Static Public Attributes | |
static constexpr T | smallestFactor = 0.0001f |
Used to make linear or exponential ramps up and down of a value in steps. The length of the ramp and the kind of ramp can be specified for each ramp.
RampedValue | ( | const T & | initValue | ) |
T getNextValue | ( | ) |
Take the next step in the current ramp. Should only be called from the audio thread.
T getValue | ( | ) | const |
bool isRamping | ( | ) | const |
void ramp | ( | const T & | destination, |
int | stepCount, | ||
RampMode | mode = RampMode::Linear |
||
) |
Start a ramp
destination | the finishing value |
stepCount | the number of steps |
mode | the ramp interpolation mode |
void setValue | ( | const T & | value | ) |
Stop the current ramp and set a value directly
void stop | ( | ) |
Stop the current ramp.
nap::Signal<T> destinationReachedSignal |
Signal emitted when the destination of a ramp has been reached.
T mFactor |
T mIncrement |
|
staticconstexpr |