AME
ame::LinearSmoothedValue< FloatType > Class Template Reference

Smooth values linearly. More...

#include <ame_Util.hpp>

Public Member Functions

 LinearSmoothedValue (FloatType initialValue, const int rampSteps)
 
bool isSmoothing () const noexcept
 Returns true if the current value is currently being interpolated.
 
FloatType getCurrentValue () const noexcept
 Returns the current value to the ramp.
 
FloatType getTargetValue () const noexcept
 Returns the target value towards which the smoothed value is currently moving.
 
void reset (FloatType newValue) noexcept
 Reset the currentValue, targetValue and ramp count. More...
 
void setRampLength (const int numSteps) noexcept
 Set a new ramp length in samples. More...
 
void setTargetValue (FloatType newValue) noexcept
 Set the next value to ramp towards. More...
 
FloatType getNextValue () noexcept
 Compute the smoothed value. More...
 

Detailed Description

template<std::floating_point FloatType>
class ame::LinearSmoothedValue< FloatType >

Smooth values linearly.

Template Parameters
FloatTypefloat or double

Member Function Documentation

◆ getNextValue()

template<std::floating_point FloatType>
FloatType ame::LinearSmoothedValue< FloatType >::getNextValue ( )
inlinenoexcept

Compute the smoothed value.

Returns
FloatType Smoothed value

◆ reset()

template<std::floating_point FloatType>
void ame::LinearSmoothedValue< FloatType >::reset ( FloatType  newValue)
inlinenoexcept

Reset the currentValue, targetValue and ramp count.

Parameters
newValueThe new current and target value.

◆ setRampLength()

template<std::floating_point FloatType>
void ame::LinearSmoothedValue< FloatType >::setRampLength ( const int  numSteps)
inlinenoexcept

Set a new ramp length in samples.


Parameters
numStepsThe number of samples to ramp.

◆ setTargetValue()

template<std::floating_point FloatType>
void ame::LinearSmoothedValue< FloatType >::setTargetValue ( FloatType  newValue)
inlinenoexcept

Set the next value to ramp towards.


Parameters
newValueThe new target value to ramp.

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