You.i Engine
CYIAbstractTimeline Class Reference

Detailed Description

The base class for the timeline framework.

This class provides an interface for any timeline or timeline group. The basic operations that can be performed on any item in the timeline framework include the playback methods, as well as the ability to query duration, direction, and amount completed.

This class cannot be instantiated.

#include <animation/YiAbstractTimeline.h>

Inheritance diagram for CYIAbstractTimeline:

Public Types

enum  YI_FRAME_MODE {
  YI_ABSOLUTE,
  YI_RELATIVE
}
 
enum  STATUS {
  STOPPED,
  PLAYING
}
 
enum  DIRECTION {
  FORWARD,
  REVERSE
}
 

Public Member Functions

virtual ~CYIAbstractTimeline ()
 
void Start ()
 
void Finish ()
 
void Pause ()
 
void Continue ()
 
void SetDirection (DIRECTION direction)
 
DIRECTION GetDirection () const
 
STATUS GetStatus () const
 
uint64_t GetStartTime () const
 
uint64_t GetCurrentTime () const
 
float GetTimeAsPercentage () const
 
uint64_t GetTotalTime () const
 
void SeekToPercentage (float fPercentage)
 
void SeekToTime (uint64_t uMillis)
 
void Abort ()
 
void SetDisablesInput (bool bDisablesInput)
 
void Track ()
 
void Untrack ()
 
void StartForward ()
 
void StartReverse ()
 
void ContinueForward ()
 
void ContinueReverse ()
 
void SetDirectionForward ()
 
void SetDirectionReverse ()
 
void SetFrameModes (YI_FRAME_MODE eStartFrameMode, YI_FRAME_MODE eEndFrameMode)
 
bool SetSourcePositions (CYISceneNode *pNode, const glm::vec3 &vPosition)
 
bool ClearSourcePositions (CYISceneNode *pNode)
 
bool SetTargetPositions (CYISceneNode *pNode, const glm::vec3 &vPosition)
 
bool ClearTargetPositions (CYISceneNode *pNode)
 
const std::shared_ptr< CYITimelineProxy > & GetProxy () const
 
void SetRootNode (CYISceneNode *pRootNode)
 
const std::shared_ptr< CYISceneNodeProxy > & GetRootNode () const
 
- Public Member Functions inherited from CYISignalHandler
 CYISignalHandler ()
 
 CYISignalHandler (const CYISignalHandler &rSignalHandler)
 
virtual ~CYISignalHandler ()
 
CYISignalHandleroperator= (const CYISignalHandler &rSignalHandler)
 
void MoveToThread (CYIThread *pThread)
 This function allows the user to override the default thread affinity to any CYIThread that may or may not be running. More...
 
CYIThreadHandle GetThreadAffinity () const
 
void SetThreadAffinity (const CYIThreadHandle &rThreadAffinity)
 
virtual bool IsConnected () const
 
virtual bool IsConnected (const CYISignalBase &rSignal) const
 
void Disconnect (CYISignalBase &rSignal)
 
void DisconnectFromAllSignals ()
 
- Public Member Functions inherited from CYIThread::Listener
 Listener ()
 
virtual ~Listener ()
 
virtual void OnThreadStarted (CYIThread *)
 
virtual void OnThreadTerminated (CYIThread *)
 
virtual void OnThreadFinished (CYIThread *)
 
- Public Member Functions inherited from CYIScriptableRTTIObject
 CYIScriptableRTTIObject ()
 
virtual ~CYIScriptableRTTIObject ()
 
virtual const CYIRuntimeTypeInfoGetRuntimeTypeInfoForScriptObject () const override
 
- Public Member Functions inherited from CYIScriptableObject
 CYIScriptableObject ()
 
 CYIScriptableObject (const CYIScriptableObject &other)
 
CYIScriptableObjectoperator= (const CYIScriptableObject &other)
 
virtual ~CYIScriptableObject ()
 
CYIBindingImplementationGetBindingImplementation () const
 
void SetBindingImplementation (CYIBindingImplementation *pBindingImplementation)
 

Public Attributes

CYISignal Playing
 called whenever the timeline starts playing (from any position) More...
 
CYISignal Paused
 called whenever the timeline stops playing, including if the timeline execution completes normally More...
 
CYISignal Aborted
 called when the timeline execution is aborted by the Abort() function More...
 
CYISignal Started
 called when playback of the timeline is initiated by one of the Start() functions More...
 
CYISignal Completed
 called when playback of the timeline completes normally (or when the Finish() function is called) More...
 
CYISignal PlayingForward
 same as Playing, but triggered only when direction is forward More...
 
CYISignal PlayingReverse
 same as Playing, but triggered only when direction is reverse More...
 
CYISignal PausedForward
 same as Paused, but triggered only when direction is forward More...
 
CYISignal PausedReverse
 same as Paused, but triggered only when direction is reverse More...
 
CYISignal StartedForward
 same as Started, but triggered only when direction is forward More...
 
CYISignal StartedReverse
 same as Started, but triggered only when direction is reverse More...
 
CYISignal CompletedForward
 same as Completed, but triggered only when direction is forward More...
 
CYISignal CompletedReverse
 same as Completed, but triggered only when direction is reverse More...
 

Protected Member Functions

 CYIAbstractTimeline (CYIAbstractTimelinePriv *pPriv)
 
- Protected Member Functions inherited from CYIScriptableRTTIObject
virtual std::pair< const CYIRuntimeTypeInfo *, const void * > GetRuntimeTypeInfoWithObject () const =0
 

Protected Attributes

CYIAbstractTimelinePriv * m_pPriv
 

Friends

class CYITimelineGroup
 
class CYISerialTimelineGroup
 
class CYIParallelTimelineGroup
 
class CYITimelineLoop
 

Member Enumeration Documentation

The current direction of playback for this timeline

Enumerator
FORWARD 
REVERSE 

The current playing status of this timeline

Enumerator
STOPPED 
PLAYING 

A frame mode, which is used to indicate how a frame's value should be interpreted.

Enumerator
YI_ABSOLUTE 

The frame's value is absolute and should be used as-is.

YI_RELATIVE 

The frame's value is relative to another value.

Constructor & Destructor Documentation

virtual CYIAbstractTimeline::~CYIAbstractTimeline ( )
virtual
CYIAbstractTimeline::CYIAbstractTimeline ( CYIAbstractTimelinePriv *  pPriv)
protected

Member Function Documentation

void CYIAbstractTimeline::Abort ( )

Pauses this timeline at its current execution point. Does not reset position. Unlike Pause(), this function does not trigger the PausedSig signals. Instead, the Aborted signal is triggered.

bool CYIAbstractTimeline::ClearSourcePositions ( CYISceneNode pNode)

A helper function to remove the source value of any track that uses the target node pNode and affects nodes' position. Has no effect if no track has the provided target node and affects positions.

Note
If this timeline represents a timeline group, the ClearSourcePositions function will be called recursively on all of its children.
Returns
true if any of the tracks in this timeline (or child timelines) were affected.
See also
SetSourcePositions
bool CYIAbstractTimeline::ClearTargetPositions ( CYISceneNode pNode)

A helper function to remove the target value of any track that uses the target node pNode and affects nodes' position. Has no effect if no track has the provided target node and affects positions.

Note
If this timeline represents a timeline group, the ClearTargetPositions function will be called recursively on all of its children.
Returns
true if any of the tracks in this timeline (or child timelines) were affected.
See also
SetTargetPositions
void CYIAbstractTimeline::Continue ( )

Resumes playback of this timeline from the current execution point in the current direction. The PlaySig signal will be triggered, along with the PlayForwardSig or PlayReverseSig signal (depending on the current direction.)

void CYIAbstractTimeline::ContinueForward ( )

Resumes playback of this timeline from the current execution point in the forward direction. This is equivalent to calling "SetDirection(FORWARD); Continue();". The PlaySig and PlayForwardSig signals will be triggered.

void CYIAbstractTimeline::ContinueReverse ( )

Resumes playback of this timeline from the current execution point in the reverse direction. This is equivalent to calling "SetDirection(REVERSE); Continue();". The PlaySig and PlayReverseSig signals will be triggered.

void CYIAbstractTimeline::Finish ( )

Stops playback of this timeline and moves to the end of the timeline (or beginning, depending on the playback direction). The Paused and Completed signals will be triggered, along with either PausedForward and CompletedForward, or PausedReverse and CompletedReverse (depending on the current direction).

uint64_t CYIAbstractTimeline::GetCurrentTime ( ) const

Returns the current position in this timeline, in milliseconds.

DIRECTION CYIAbstractTimeline::GetDirection ( ) const

Returns the current direction of the timeline.

const std::shared_ptr<CYITimelineProxy>& CYIAbstractTimeline::GetProxy ( ) const

Returns a proxy object which protects the caller against deletion of the CYITimeline object. This should only be used from non-UI threads.

const std::shared_ptr<CYISceneNodeProxy>& CYIAbstractTimeline::GetRootNode ( ) const

Returns the root scene node that this timeline is associated with.

See also
SetRootNode
uint64_t CYIAbstractTimeline::GetStartTime ( ) const

Returns the start time for this timeline. It is important to note that the time will be in the time space of the backing store attached to this timeline.

STATUS CYIAbstractTimeline::GetStatus ( ) const

Returns the current status of the timeline.

float CYIAbstractTimeline::GetTimeAsPercentage ( ) const

Calculates and returns the percentage of the current position of the timeline. Returns values between 0.0 and 1.0 inclusively.

uint64_t CYIAbstractTimeline::GetTotalTime ( ) const

Returns the length of this timeline in milliseconds.

void CYIAbstractTimeline::Pause ( )

Pauses this timeline at its current execution point. Does not reset position. The Paused signal will be triggered, along with the PausedForward or PausedReverse signal (depending on the current direction.)

void CYIAbstractTimeline::SeekToPercentage ( float  fPercentage)

Seeks to the given percentage within the timeline. Values of fPercentage must be between 0.0 and 1.0.

Warning
This function ignores the playback direction of the timeline.
void CYIAbstractTimeline::SeekToTime ( uint64_t  uMillis)

Seeks to the given time within the timeline. Values of uMillis < 0 will be interpreted as 0. Values of uMillis > total time will be interpreted as total time.

Warning
This function ignores the playback direction of the timeline.
void CYIAbstractTimeline::SetDirection ( DIRECTION  direction)

Sets the playback direction to the provided direction. Changing the playback direction of a currently-playing timeline may result in unexpected behaviours.

void CYIAbstractTimeline::SetDirectionForward ( )

Sets the playback direction to Forward. Changing the playback direction of a currently-playing timeline may result in unexpected behaviours.

void CYIAbstractTimeline::SetDirectionReverse ( )

Sets the playback direction to Reverse. Changing the playback direction of a currently-playing timeline may result in unexpected behaviours.

void CYIAbstractTimeline::SetDisablesInput ( bool  bDisablesInput)

Set disables input setting

void CYIAbstractTimeline::SetFrameModes ( YI_FRAME_MODE  eStartFrameMode,
YI_FRAME_MODE  eEndFrameMode 
)

Sets the frame modes for the start and end frames of this timeline to eStartFrameMode and eEndFrameMode.

Note
If this timeline represents a timeline group, the SetFrameModes function will be called recursively on all of its children.
Warning
Setting both eStartFrameMode and eEndFrameMode to YI_FRAME_MODE::YI_RELATIVE is not supported and will result in undefined behaviour.
See also
YI_FRAME_MODE
CYITimeline
void CYIAbstractTimeline::SetRootNode ( CYISceneNode pRootNode)

Sets the root scene node that this timeline is associated with. This is typically the owner of the timeline.

See also
GetRootNode
CYISceneView::GetTimeline(const CYIString &)
CYITimelineTrack::GetTargetID
bool CYIAbstractTimeline::SetSourcePositions ( CYISceneNode pNode,
const glm::vec3 &  vPosition 
)

A helper function to set the source value of any track that uses the target node pNode and affects nodes' position to vPosition. Has no effect if no track has the provided target node and affects positions.

Note
If this timeline represents a timeline group, the SetSourcePositions function will be called recursively on all of its children.
Calling this function is equivalent to calling CYITimeline::SetTrackSource on each of the child CYITimeline instances which have the attribute types POSITION, SEP_POSITION_X, SEP_POSITION_Y and SEP_POSITION_Z.
Returns
true if any of the tracks in this timeline (or child timelines) were affected.
See also
CYITimeline::SetTrackSource(CYISceneNode *pNode, CYITimelineTrack::ATTRIBUTE_TYPE eType, const CYIVariant &source)
bool CYIAbstractTimeline::SetTargetPositions ( CYISceneNode pNode,
const glm::vec3 &  vPosition 
)

A helper function to set the target value of any track that uses the target node pNode and affects nodes' position to vPosition. Has no effect if no track has the provided target node and affects positions.

Note
If this timeline represents a timeline group, the SetTargetPositions function will be called recursively on all of its children.
Calling this function is equivalent to calling CYITimeline::SetTrackTarget on each of the child CYITimeline instances which have the attribute types POSITION, SEP_POSITION_X, SEP_POSITION_Y and SEP_POSITION_Z.
Returns
true if any of the tracks in this timeline (or child timelines) were affected.
See also
CYITimeline::SetTrackTarget(CYISceneNode *pNode, CYITimelineTrack::ATTRIBUTE_TYPE eType, const CYIVariant &target)
void CYIAbstractTimeline::Start ( )

Starts playback of this timeline from the beginning (or from the end if the current direction is Reverse). The Playing and Started signals will be triggered, along with either PlayingForward and StartedForward, or PlayingReverse and StartedReverse (depending on the current direction). Paused signals will NOT be triggered.

void CYIAbstractTimeline::StartForward ( )

Start playback of this timeline from the beginning in the forward direction. The PlaySig, PlayForwardSig, Started and StartedForward signals will be triggered. This is equivalent to calling "SetDirection(FORWARD); Start();".

void CYIAbstractTimeline::StartReverse ( )

Start playback of this timeline from the beginning in the reverse direction. The PlaySig, PlayReverseSig, Started and StartedReverse signals will be triggered. This is equivalent to calling "SetDirection(REVERSE); Start();".

void CYIAbstractTimeline::Track ( )

Starts tracking a timeline and all its updates. A log message will be printed on the console You can use Untrack() to stop tracking a timeline.

Note: The following attributes will not be tracked:

void CYIAbstractTimeline::Untrack ( )

Friends And Related Function Documentation

friend class CYIParallelTimelineGroup
friend
friend class CYISerialTimelineGroup
friend
friend class CYITimelineGroup
friend
friend class CYITimelineLoop
friend

Member Data Documentation

CYISignal CYIAbstractTimeline::Aborted

called when the timeline execution is aborted by the Abort() function

CYISignal CYIAbstractTimeline::Completed

called when playback of the timeline completes normally (or when the Finish() function is called)

CYISignal CYIAbstractTimeline::CompletedForward

same as Completed, but triggered only when direction is forward

CYISignal CYIAbstractTimeline::CompletedReverse

same as Completed, but triggered only when direction is reverse

CYIAbstractTimelinePriv* CYIAbstractTimeline::m_pPriv
protected
CYISignal CYIAbstractTimeline::Paused

called whenever the timeline stops playing, including if the timeline execution completes normally

CYISignal CYIAbstractTimeline::PausedForward

same as Paused, but triggered only when direction is forward

CYISignal CYIAbstractTimeline::PausedReverse

same as Paused, but triggered only when direction is reverse

CYISignal CYIAbstractTimeline::Playing

called whenever the timeline starts playing (from any position)

CYISignal CYIAbstractTimeline::PlayingForward

same as Playing, but triggered only when direction is forward

CYISignal CYIAbstractTimeline::PlayingReverse

same as Playing, but triggered only when direction is reverse

CYISignal CYIAbstractTimeline::Started

called when playback of the timeline is initiated by one of the Start() functions

CYISignal CYIAbstractTimeline::StartedForward

same as Started, but triggered only when direction is forward

CYISignal CYIAbstractTimeline::StartedReverse

same as Started, but triggered only when direction is reverse


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