Public Member Functions | Protected Member Functions | Protected Attributes | Friends
cinder::TimelineItem Class Reference

Base interface for anything that can go on a Timeline. More...

#include <TimelineItem.h>

Inherits enable_shared_from_this< TimelineItem >.

Inherited by cinder::Cue, cinder::Timeline, and cinder::TweenBase.

List of all members.

Public Member Functions

 TimelineItem (class Timeline *parent=0)
 TimelineItem (class Timeline *parent, void *target, float startTime, float duration)
virtual ~TimelineItem ()
void * getTarget () const
 Returns the item's target pointer.
float getStartTime () const
 Returns the item's start time.
void setStartTime (float newTime)
 Set the items's start time to newTime.
float getDuration () const
 Returns the item's duration.
void setDuration (float newDuration)
 Sets the item's duration to newDuration.
bool getLoop () const
 Returns whether the item starts over when it is complete.
void setLoop (bool doLoop=true)
 Sets whether the item starts over when it is complete.
bool getPingPong () const
 Returns whether the item alternates between forward and reverse. Overrides loop when true.
void setPingPong (bool pingPong=true)
 Sets whether the item alternates between forward and reverse. Overrides loop when true.
bool getInfinite () const
 Returns whether the item ever is marked as complete.
void setInfinite (bool infinite=true)
 Sets whether the item ever is marked as complete.
float getEndTime () const
 Returns the time of the item's competion, equivalent to getStartTime() + getDuration().
class TimelinegetParent () const
 Returns a pointer to the item's parent Timeline.
void removeSelf ()
 Removes the item from its parent Timeline.
virtual void reset (bool unsetStarted=false)
 Marks the item as not completed, and if unsetStarted, marks the item as not started.
bool hasStarted () const
 Returns whether the item has started.
bool isComplete ()
 Returns whether the item has completed.
bool getAutoRemove () const
 Should the item remove itself from the Timeline when it is complete.
void setAutoRemove (bool autoRemove=true)
 Sets whether the item will remove itself from the Timeline when it is complete.
virtual void start (bool reverse)=0
virtual void loopStart ()
virtual void update (float relativeTime)=0
virtual void complete (bool reverse)=0
virtual bool updateAtLoopStart ()
 Call update() only at the beginning of each loop (for example Cues exhibit require this behavior)
virtual float calcDuration () const
virtual void reverse ()=0
virtual TimelineItemRef clone () const =0
 Creates a clone of the item.
virtual TimelineItemRef cloneReverse () const =0
 Creates a cloned item which runs in reverse relative to a timeline of duration timelineDuration.
void stepTo (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.
TimelineItemRef thisRef ()

Protected Member Functions

void setDurationDirty ()
void updateDuration () const
float loopTime (float absTime)
 Converts time from absolute to absolute based on item's looping attributes.
void setTarget (void *target)

Protected Attributes

class TimelinemParent
void * mTarget
float mStartTime
bool mHasStarted
bool mHasReverseStarted
bool mComplete
bool mReverseComplete
bool mMarkedForRemoval
bool mInfinite
bool mLoop
bool mPingPong
bool mUseAbsoluteTime
bool mAutoRemove
int32_t mLastLoopIteration

Friends

class Timeline

Detailed Description

Base interface for anything that can go on a Timeline.


Constructor & Destructor Documentation

cinder::TimelineItem::TimelineItem ( class Timeline parent,
void *  target,
float  startTime,
float  duration 
)
virtual cinder::TimelineItem::~TimelineItem ( ) [virtual]

Member Function Documentation

Returns the item's target pointer.

Reimplemented in cinder::Tween< T >.

Returns the item's start time.

void cinder::TimelineItem::setStartTime ( float  newTime)

Set the items's start time to newTime.

Returns the item's duration.

void cinder::TimelineItem::setDuration ( float  newDuration)

Sets the item's duration to newDuration.

Returns whether the item starts over when it is complete.

void cinder::TimelineItem::setLoop ( bool  doLoop = true)

Sets whether the item starts over when it is complete.

Returns whether the item alternates between forward and reverse. Overrides loop when true.

void cinder::TimelineItem::setPingPong ( bool  pingPong = true)

Sets whether the item alternates between forward and reverse. Overrides loop when true.

Returns whether the item ever is marked as complete.

void cinder::TimelineItem::setInfinite ( bool  infinite = true)

Sets whether the item ever is marked as complete.

Returns the time of the item's competion, equivalent to getStartTime() + getDuration().

Returns a pointer to the item's parent Timeline.

Removes the item from its parent Timeline.

virtual void cinder::TimelineItem::reset ( bool  unsetStarted = false) [virtual]

Marks the item as not completed, and if unsetStarted, marks the item as not started.

Reimplemented in cinder::Timeline, and cinder::TweenBase.

Returns whether the item has started.

Returns whether the item has completed.

Should the item remove itself from the Timeline when it is complete.

void cinder::TimelineItem::setAutoRemove ( bool  autoRemove = true)

Sets whether the item will remove itself from the Timeline when it is complete.

virtual void cinder::TimelineItem::start ( bool  reverse) [pure virtual]
virtual void cinder::TimelineItem::loopStart ( ) [virtual]

Reimplemented in cinder::Cue, and cinder::Timeline.

virtual void cinder::TimelineItem::update ( float  relativeTime) [pure virtual]
virtual void cinder::TimelineItem::complete ( bool  reverse) [pure virtual]
virtual bool cinder::TimelineItem::updateAtLoopStart ( ) [virtual]

Call update() only at the beginning of each loop (for example Cues exhibit require this behavior)

Reimplemented in cinder::Cue.

virtual float cinder::TimelineItem::calcDuration ( ) const [virtual]

Reimplemented in cinder::Timeline.

virtual void cinder::TimelineItem::reverse ( ) [pure virtual]
virtual TimelineItemRef cinder::TimelineItem::clone ( ) const [pure virtual]

Creates a clone of the item.

Implemented in cinder::Cue, cinder::Tween< T >, and cinder::Timeline.

virtual TimelineItemRef cinder::TimelineItem::cloneReverse ( ) const [pure virtual]

Creates a cloned item which runs in reverse relative to a timeline of duration timelineDuration.

Implemented in cinder::Cue, cinder::Tween< T >, and cinder::Timeline.

void cinder::TimelineItem::stepTo ( 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.

Reimplemented in cinder::Timeline.

void cinder::TimelineItem::updateDuration ( ) const [protected]
float cinder::TimelineItem::loopTime ( float  absTime) [protected]

Converts time from absolute to absolute based on item's looping attributes.

void cinder::TimelineItem::setTarget ( void *  target) [protected]

Friends And Related Function Documentation

friend class Timeline [friend]

Member Data Documentation

void* cinder::TimelineItem::mTarget [protected]
bool cinder::TimelineItem::mLoop [protected]

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