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>
Public Types | |
enum | FrameMode : uint8_t { FrameMode::Absolute, FrameMode::Relative } |
enum | Status : uint8_t { Status::Stopped, Status::Playing } |
enum | Direction : uint8_t { Direction::Forward, Direction::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 percentage) |
void | SeekToTime (uint64_t millis) |
void | Abort () |
void | SetDisablesInput (bool disablesInput) |
void | Track () |
void | Untrack () |
void | StartForward () |
void | StartReverse () |
void | ContinueForward () |
void | ContinueReverse () |
void | SetDirectionForward () |
void | SetDirectionReverse () |
void | SetFrameModes (FrameMode startFrameMode, FrameMode endFrameMode) |
bool | SetSourcePositions (CYISceneNode *pNode, const glm::vec3 &position) |
bool | ClearSourcePositions (CYISceneNode *pNode) |
bool | SetTargetPositions (CYISceneNode *pNode, const glm::vec3 &position) |
bool | ClearTargetPositions (CYISceneNode *pNode) |
bool | SetSourceScales (CYISceneNode *pNode, const glm::vec3 &scale) |
bool | ClearSourceScales (CYISceneNode *pNode) |
void | SetLooping (bool isLooping) |
bool | GetLooping () const |
const std::shared_ptr< CYITimelineProxy > & | GetProxy () const |
void | SetRootNode (CYISceneNode *pRootNode) |
const std::shared_ptr< CYISceneNodeProxy > & | GetRootNode () const |
![]() | |
CYISignalHandler () | |
CYISignalHandler (const CYISignalHandler &rSignalHandler) | |
virtual | ~CYISignalHandler () |
CYISignalHandler & | operator= (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 () |
![]() | |
Listener () | |
virtual | ~Listener () |
virtual void | OnThreadStarted (CYIThread *) |
virtual void | OnThreadTerminated (CYIThread *) |
virtual void | OnThreadFinished (CYIThread *) |
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 | TimelineLooped |
called whenever a loop completes and the next loop starts 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 (std::unique_ptr< CYIAbstractTimelinePriv > pPriv) | |
Protected Attributes | |
std::unique_ptr< CYIAbstractTimelinePriv > | m_pPriv |
Friends | |
class | CYITimelineGroup |
class | CYISerialTimelineGroup |
class | CYIParallelTimelineGroup |
class | CYITimelineLoop |
|
strong |
|
strong |
|
strong |
|
virtual |
|
protected |
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.
bool CYIAbstractTimeline::ClearSourceScales | ( | CYISceneNode * | pNode | ) |
A helper function to remove the source value of any track that uses the target node pNode and affects nodes' scale. Has no effect if no track has the provided target node and affects scale.
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.
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(Direction::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(Direction::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.
bool CYIAbstractTimeline::GetLooping | ( | ) | const |
Gets whether the timeline is set to loop indefinitely.
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.
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 | percentage | ) |
Seeks to the given percentage within the timeline. Values of percentage must be between 0.0 and 1.0.
void CYIAbstractTimeline::SeekToTime | ( | uint64_t | millis | ) |
Seeks to the given time within the timeline. Values of millis < 0 will be interpreted as 0. Values of millis > total time will be interpreted as total time.
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 | disablesInput | ) |
Set disables input setting
Sets the frame modes for the start and end frames of this timeline to startFrameMode and endFrameMode.
void CYIAbstractTimeline::SetLooping | ( | bool | isLooping | ) |
Sets the timeline to loop indefinitely.
void CYIAbstractTimeline::SetRootNode | ( | CYISceneNode * | pRootNode | ) |
Sets the root scene node that this timeline is associated with. This is typically the owner of the timeline.
bool CYIAbstractTimeline::SetSourcePositions | ( | CYISceneNode * | pNode, |
const glm::vec3 & | position | ||
) |
A helper function to set the source value of any track that uses the target node pNode and affects nodes' position to position. Has no effect if no track has the provided target node and affects positions.
bool CYIAbstractTimeline::SetSourceScales | ( | CYISceneNode * | pNode, |
const glm::vec3 & | scale | ||
) |
A helper function to set the source value of any track that uses the target node pNode and affects nodes' scale to scale. Has no effect if no track has the provided target node and affects scale.
bool CYIAbstractTimeline::SetTargetPositions | ( | CYISceneNode * | pNode, |
const glm::vec3 & | position | ||
) |
A helper function to set the target value of any track that uses the target node pNode and affects nodes' position to position. Has no effect if no track has the provided target node and affects positions.
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(Direction::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(Direction::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 | ( | ) |
|
friend |
|
friend |
|
friend |
|
friend |
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
|
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
CYISignal CYIAbstractTimeline::TimelineLooped |
called whenever a loop completes and the next loop starts