- cinder::TimelineItem
- cinder::Timeline
Public Member Functions
-
voidstep (float timestep)
Advances time a specified amount and evaluates items.
-
voidstepTo (float absoluteTime)
Goes to a specific time and evaluates items.
-
floatgetCurrentTime () const
Returns the timeline's most recent current time.
-
Tween< T >::Optionsapply (Anim< T > *target, T endValue, float duration, EaseFn easeFunction=easeNone, typename Tween< T >::LerpFn lerpFunction=&tweenLerp< T >)
Replaces any existing tweens on the target with a new tween at the timeline's current time.
-
Tween< T >::Optionsapply (Anim< T > *target, T startValue, T endValue, float duration, EaseFn easeFunction=easeNone, typename Tween< T >::LerpFn lerpFunction=&tweenLerp< T >)
Replaces any existing tweens on the target with a new tween at the timeline's current time.
-
Tween< T >::OptionsappendTo (Anim< T > *target, T endValue, float duration, EaseFn easeFunction=easeNone, typename Tween< T >::LerpFn lerpFunction=&tweenLerp< T >)
Creates a new tween and adds it to the end of the last tween on target , or if no existing tween matches the target, the current time.
-
Tween< T >::OptionsappendTo (Anim< T > *target, T startValue, T endValue, float duration, EaseFn easeFunction=easeNone, typename Tween< T >::LerpFn lerpFunction=&tweenLerp< T >)
Creates a new tween and adds it to the end of the last tween on target , or if no existing tween matches the target, the current time.
-
Tween< T >::OptionsapplyPtr (T *target, T endValue, float duration, EaseFn easeFunction=easeNone, typename Tween< T >::LerpFn lerpFunction=&tweenLerp< T >)
Replaces any existing tweens on the target with a new tween at the timeline's current time. Consider the apply( Anim<T>* ) variant unless you have an advanced use case.
-
Tween< T >::OptionsapplyPtr (T *target, T startValue, T endValue, float duration, EaseFn easeFunction=easeNone, typename Tween< T >::LerpFn lerpFunction=&tweenLerp< T >)
Replaces any existing tweens on the target with a new tween at the timeline's current time. Consider the apply( Anim<T>* ) variant unless you have an advanced use case.
-
Tween< T >::OptionsappendToPtr (T *target, T endValue, float duration, EaseFn easeFunction=easeNone, typename Tween< T >::LerpFn lerpFunction=&tweenLerp< T >)
Creates a new tween and adds it to the end of the last tween on target , or if no existing tween matches the target, the current time. Consider the appendTo( Anim<T>* ) variant unless you have an advanced use case.
-
Tween< T >::OptionsappendToPtr (T *target, T startValue, T endValue, float duration, EaseFn easeFunction=easeNone, typename Tween< T >::LerpFn lerpFunction=&tweenLerp< T >)
Creates a new tween and adds it to the end of the last tween on target , or if no existing tween matches the target, the current time. Consider the appendTo( Anim<T>* ) variant unless you have an advanced use case.
-
add (const std::function< void()> &action, float atTime)
add a cue to the Timeline add the start-time atTime
-
FnTweenRef< T >applyFn (const std::function< void(T)> &fn, T startValue, T endValue, float duration, const EaseFn &easeFunction=easeNone, const typename Tween< T >::LerpFn &lerpFunction=&tweenLerp< T >)
-
voidappendPingPong ()
Appends to the end of the timeline mirror images of all items.
-
voidapply (TimelineItemRef item)
Replaces any existing TimelineItems that match item's target and adds item to the timeline. Safe to use from callback fn's.
-
voidadd (TimelineItemRef item)
add an item to the timeline at the current time. Safe to use from callback fn's.
-
voidinsert (TimelineItemRef item)
adds an item to the timeline. Its start time is not modified. Safe to use from callback fn's.
-
voidinsert (TimelineItemRef item, float atTime)
adds an item to the timeline, setting its startTime to be at atTime . Safe to use from callback fn's.
-
size_tgetNumItems () const
Returns the number of items in the Timeline .
-
boolempty () const
Returns true if there are no items in the Timeline .
-
find (void *target) const
Returns the first item in the timeline the target of which matches target .
-
findLast (void *target) const
Returns the latest-starting item in the timeline the target of which matches target .
-
findLastEnd (void *target) const
Returns the latest-end item in the timeline the target of which matches target .
-
floatfindEndTimeOf (void *target, bool *found=NULL) const
Returns the end of the latest-ending item in the timeline the target of which matches target , or the current time if it's not found. found can store whether a related item was found.
-
voidremove (TimelineItemRef item)
Removes the TimelineItem item from the Timeline . Safe to use from callback fn's.
-
voidremoveTarget (void *target)
Removes all TimelineItems whose target matches target .
-
voidcloneAndReplaceTarget (void *target, void *replacementTarget)
Clones all TimelineItems whose target matches target , but replacing their target with replacementTarget .
-
voidreplaceTarget (void *target, void *replacementTarget)
Replaces the target of all TimelineItems whose target matches target , with replacementTarget .
-
voidclear ()
Remove all tweens from the Timeline . Do not call from callback fn's.
-
voidreset (bool unsetStarted=false)
Sets the time to zero, marks all tweens as not completed, and if unsetStarted , marks the tweens as not started. Do not call from callback fn's.
-
voidsetDefaultAutoRemove (bool defaultAutoRemove)
Sets the default autoRemove value for all future TimelineItems added to the Timeline .
-
boolgetDefaultAutoRemove () const
Returns the default autoRemove value for all future TimelineItems added to the Timeline .
-
voiditemTimeChanged (TimelineItem *item)
Call this to notify the Timeline if the item's start-time or duration has changed. Advanced use cases only.
-
thisRef ()
-
void *getTarget () const
Returns the item's target pointer.
-
floatgetStartTime () const
Returns the item's start time.
-
voidsetStartTime (float newTime)
Set the items's start time to newTime .
-
floatgetDuration () const
Returns the item's duration.
-
voidsetDuration (float newDuration)
Sets the item's duration to newDuration .
-
boolgetLoop () const
Returns whether the item starts over when it is complete.
-
voidsetLoop (bool doLoop=true)
Sets whether the item starts over when it is complete.
-
boolgetPingPong () const
Returns whether the item alternates between forward and reverse. Overrides loop when true.
-
voidsetPingPong (bool pingPong=true)
Sets whether the item alternates between forward and reverse. Overrides loop when true.
-
boolgetInfinite () const
Returns whether the item ever is marked as complete.
-
voidsetInfinite (bool infinite=true)
Sets whether the item ever is marked as complete.
-
floatgetEndTime () const
Returns the time of the item's competion, equivalent to getStartTime() + getDuration() .
-
class Timeline *getParent () const
Returns a pointer to the item's parent Timeline .
-
voidremoveSelf ()
Removes the item from its parent Timeline .
-
boolhasStarted () const
Returns whether the item has started.
-
boolisComplete ()
Returns whether the item has completed.
-
boolgetAutoRemove () const
Should the item remove itself from the Timeline when it is complete.
-
voidsetAutoRemove (bool autoRemove=true)
Sets whether the item will remove itself from the Timeline when it is complete.
-
boolupdateAtLoopStart ()
Call update() only at the beginning of each loop (for example Cues exhibit require this behavior)
-
voidstepTo (float time, bool reverse)
go to a specific time, generally called by the parent Timeline only. If reverse then playhead is interpreted as retreating rather than advancing.
Static Public Member Functions
Protected Member Functions
-
Timeline ()
-
voidreverse ()
-
cloneReverse () const
Creates a cloned item which runs in reverse relative to a timeline of duration timelineDuration .
-
clone () const
Creates a clone of the item.
-
voidstart (bool)
-
voidloopStart ()
-
voidupdate (float absTime)
-
voidcomplete (bool)
-
voideraseMarked ()
-
floatcalcDuration () const
-
voidsetDurationDirty ()
-
voidupdateDuration () const
-
floatloopTime (float absTime)
Converts time from absolute to absolute based on item's looping attributes.
-
voidsetTarget (void *target)
Protected Attributes
-
boolmDefaultAutoRemove
-
floatmCurrentTime
-
std::multimap< void *, TimelineItemRef >mItems
-
class Timeline *mParent
-
void *mTarget
-
floatmStartTime
-
boolmHasStarted
-
boolmHasReverseStarted
-
boolmComplete
-
boolmReverseComplete
-
boolmMarkedForRemoval
-
boolmInfinite
-
boolmLoop
-
boolmPingPong
-
boolmUseAbsoluteTime
-
boolmAutoRemove
-
int32_tmLastLoopIteration