friz
An animation control system for JUCE
Loading...
Searching...
No Matches
friz::AnimationType Class Referenceabstract

Abstract base class; all the real action happens in the derived templated Animation class, below. More...

#include <animation.h>

Inheritance diagram for friz::AnimationType:

Public Types

enum class  Status { processing , finished }
 
using CompletionFn = std::function< void(int, bool)>
 callback on completion of this effect
 

Public Member Functions

 AnimationType (int id)
 
int getId () const
 
void setDelay (int delay)
 
virtual bool setValue (size_t, std::unique_ptr< AnimatedValue >)
 
virtual Status gotoTime (juce::int64 timeInMs)=0
 Advance all active animations to this point in time.
 
virtual void cancel (bool moveToEndPosition)=0
 Cancel an in-progress animation, optionally moving directly to its end value.
 
virtual bool isFinished ()=0
 
virtual bool isReady () const =0
 
virtual AnimatedValuegetValue (size_t index)=0
 Retrieve a pointer to one of this animation's value objects.
 
void onCompletion (CompletionFn complete)
 

Public Attributes

CompletionFn completionFn
 function to call when the animation is completed or canceled.
 

Protected Attributes

int animationId { 0 }
 optional ID value for this animation.
 
int preDelay { 0 }
 an optional pre-delay before beginning to execute the effect.
 

Detailed Description

Abstract base class; all the real action happens in the derived templated Animation class, below.

Member Typedef Documentation

◆ CompletionFn

using friz::AnimationType::CompletionFn = std::function<void (int, bool)>

callback on completion of this effect

Parameters
intid – ID of this animation.
boolwasCanceled – true if the completion is because of cancellation.

Member Enumeration Documentation

◆ Status

enum class friz::AnimationType::Status
strong
Enumerator
processing 

The animation is running right now.

finished 

Finished running, okay to clean up.

Member Function Documentation

◆ cancel()

virtual void friz::AnimationType::cancel ( bool  moveToEndPosition)
pure virtual

Cancel an in-progress animation, optionally moving directly to its end value.

Parameters
moveToEndPositionif true, go immediately to the end value.

Implemented in friz::Animation< ValueCount >, and friz::Chain.

◆ getId()

int friz::AnimationType::getId ( ) const
inline
Returns
ID value for this Animation.

◆ getValue()

virtual AnimatedValue * friz::AnimationType::getValue ( size_t  index)
pure virtual

Retrieve a pointer to one of this animation's value objects.

Parameters
index
Returns
AnimatedValue*

Implemented in friz::Animation< ValueCount >, and friz::Chain.

◆ gotoTime()

virtual Status friz::AnimationType::gotoTime ( juce::int64  timeInMs)
pure virtual

Advance all active animations to this point in time.

Parameters
timeInMsTime since some fixed event; only used internally to calculate deltas.
Returns
Status either processing or finished.

Implemented in friz::Animation< ValueCount >, and friz::Chain.

◆ isFinished()

virtual bool friz::AnimationType::isFinished ( )
pure virtual
Returns
true if the effect has completed.

Implemented in friz::Animation< ValueCount >, and friz::Chain.

◆ isReady()

virtual bool friz::AnimationType::isReady ( ) const
pure virtual
Returns
true if the animation is ready to be executed (e.g. has all its values set to valid AnimatedValue objects.)

Implemented in friz::Animation< ValueCount >, and friz::Chain.

◆ onCompletion()

void friz::AnimationType::onCompletion ( CompletionFn  complete)
inline

Set the (optional) function that will be called once when this animation is complete. completionFn is public, so you can also just assign to it directly.

Parameters
completeCompletionFn function.

◆ setDelay()

void friz::AnimationType::setDelay ( int  delay)
inline

Set a number of frames to delay before starting to execute this animation.

Parameters
delay# of delay frames.

◆ setValue()

virtual bool friz::AnimationType::setValue ( size_t  ,
std::unique_ptr< AnimatedValue  
)
inlinevirtual

Reimplemented in friz::Animation< ValueCount >.


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