friz
An animation control system for JUCE
Loading...
Searching...
No Matches
friz::TimedValue Class Referenceabstract
Inheritance diagram for friz::TimedValue:

Public Member Functions

 TimedValue (float startVal, float endVal, int duration_)
 
float getNextValue (int msElapsed, int) override
 
bool isFinished () override
 
- Public Member Functions inherited from friz::AnimatedValue
 AnimatedValue (float startVal_, float endVal_)
 Base class init for the animated value classes.
 
virtual float getNextValue (int msElapsed, int msSinceLastUpdate)=0
 
float getEndValue () const
 get the ending state of this value object. When we cancel an in-progress animation, we may need to snap to the end value, and this gives a way to get there immediately.
 
virtual bool isFinished ()=0
 
virtual bool updateTarget (float)
 Attempt to change the end value of an animation that's currently in process.
 
void cancel (bool moveToEndPosition)
 Cancel an in-progress animation.
 

Protected Member Functions

float scale (float curvePoint)
 Given a fractional curve point (typically) in the range (0.f..1.f), interpolate this point between this value's start and end points.
 

Protected Attributes

int duration
 duration of the event in ms.
 
- Protected Attributes inherited from friz::AnimatedValue
float startVal
 
float endVal
 
float currentVal
 
bool canceled { false }
 
bool finished { false }
 

Private Member Functions

virtual float generateNextValue (float progress)=0
 generate the value according to progress in time.
 

Member Function Documentation

◆ generateNextValue()

virtual float friz::TimedValue::generateNextValue ( float  progress)
privatepure virtual

generate the value according to progress in time.

Parameters
progressposition in the animation (0.0..1.0)
Returns
next value.

Implemented in friz::Constant, friz::Linear, friz::Parametric, and friz::Sinusoid.

◆ getNextValue()

float friz::TimedValue::getNextValue ( int  msElapsed,
int  msSinceLastUpdate 
)
inlineoverridevirtual

Derived classes should do whatever is needed to generate and return the next value.

Parameters
msElapsedtime since this value started running. (used by 'time-based' values)
msSinceLastUpdatetime since we were last evaluated (used by threshold-based values)
Returns
next value (or last value if we're finished)

Implements friz::AnimatedValue.

◆ isFinished()

bool friz::TimedValue::isFinished ( )
inlineoverridevirtual

Have we reached the end of this animation sequence? By default, we're done when the current value is within tolerance of the endValue (or if we've been canceled...)

Returns
true if this value has reached the end of its animation.

Implements friz::AnimatedValue.

◆ scale()

float friz::TimedValue::scale ( float  curvePoint)
inlineprotected

Given a fractional curve point (typically) in the range (0.f..1.f), interpolate this point between this value's start and end points.

Parameters
curvePoint
Returns
float

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