1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Added a couple of methods to LinearSmoothedValue

This commit is contained in:
jules 2016-03-21 09:12:36 +00:00
parent 09be38bc46
commit a5ec538596

View file

@ -59,7 +59,6 @@ public:
countdown = 0;
}
//==============================================================================
/** Set a new target value. */
void setValue (FloatType newValue) noexcept
{
@ -75,7 +74,6 @@ public:
}
}
//==============================================================================
/** Compute the next value. */
FloatType getNextValue() noexcept
{
@ -87,6 +85,18 @@ public:
return currentValue;
}
/** Returns true if the current value is currently being interpolated. */
bool isSmoothing() const noexcept
{
return countdown > 0;
}
/** Returns the target value towards which the smoothed value is currently moving. */
FloatType getTargetValue() const noexcept
{
return target;
}
private:
//==============================================================================
FloatType currentValue, target, step;