Murl::Logic::ITimeline Interface Referenceabstract

The ITimeline interface. More...

#include "murl_logic_i_timeline.h"

Inheritance diagram for Murl::Logic::ITimeline:

Public Member Functions

virtual IStepablePtr GetStepable ()=0
 Get the stepable interface. More...
 
virtual Bool SetAppTimeline (IAppTimelinePtr appTimeline)=0
 Set the timeline callback object. More...
 
virtual void Evaluate ()=0
 Evaluate the current time immediately. More...
 
virtual void Reset ()=0
 Reset the timeline. More...
 
virtual void ResetTo (Real startTime)=0
 Reset the timeline to a specified start time. More...
 
virtual Bool Start ()=0
 Start or continue the timeline. More...
 
virtual Bool Start (Real startTime, Real endTime)=0
 Start the timeline with specified parameters. More...
 
virtual Bool Start (Real startTime, Real endTime, SInt32 numberOfLoops)=0
 Start the timeline with specified parameters. More...
 
virtual Bool Start (Real startTime, Real endTime, Real loopStartTime, Real loopEndTime, SInt32 numberOfLoops)=0
 Start the timeline with specified parameters. More...
 
virtual Bool Pause ()=0
 Pause the timeline. More...
 
virtual Bool Stop ()=0
 Stop the timeline. More...
 
virtual Bool Rewind ()=0
 Rewind the timeline. More...
 
virtual void SetStartTime (Real startTime)=0
 Set the start time. More...
 
virtual Real GetStartTime () const =0
 Get the start time. More...
 
virtual void SetEndTime (Real endTime)=0
 Set the end time. More...
 
virtual Real GetEndTime () const =0
 Get the end time. More...
 
virtual void SetLoopStartTime (Real startTime)=0
 Set the loop start time. More...
 
virtual Real GetLoopStartTime () const =0
 Get the loop start time. More...
 
virtual void SetLoopEndTime (Real endTime)=0
 Set the loop end time. More...
 
virtual Real GetLoopEndTime () const =0
 Get the loop end time. More...
 
virtual void SetNumberOfLoops (SInt32 numberOfLoops)=0
 Set the number of loops. More...
 
virtual SInt32 GetNumberOfLoops () const =0
 Get the number of loops. More...
 
virtual void SetTimeScale (Real timeScale)=0
 Set the time scale factor. More...
 
virtual Real GetTimeScale () const =0
 Get the time scale factor. More...
 
virtual void SetAutoRewindEnabled (Bool enabled)=0
 Enable/disable automatic rewind. More...
 
virtual Bool IsAutoRewindEnabled () const =0
 Check if automatic rewind is enabled. More...
 
virtual Bool IsRunning () const =0
 Check if the timeline is running. More...
 
virtual Bool IsPaused () const =0
 Check if the timeline is paused. More...
 
virtual Bool IsStopped () const =0
 Check if the timeline is stopped. More...
 
virtual Bool WasStarted () const =0
 Check if the timeline was started from stopped state. More...
 
virtual Bool WasRunning () const =0
 Check if the timeline has stopped running. More...
 
virtual Bool IsOrWasRunning () const =0
 Check if the timeline is or was running. More...
 
virtual Bool HasPassedTime (Real time) const =0
 Check if the current time has passed a specified time within the most recent tick. More...
 
virtual Bool HasPassedLoop (SInt32 loop) const =0
 Check if the current loop has passed a specified loop number within the most recent tick. More...
 
virtual Double GetCurrentTime () const =0
 Get the current time. More...
 
virtual Double GetRemainingTime () const =0
 Get the remaining time. More...
 
virtual void SetCurrentTime (Double time)=0
 Set the current time. More...
 
virtual SInt32 GetCurrentLoop () const =0
 Get the current loop. More...
 
virtual SInt32 GetRemainingLoops () const =0
 Get the remaining loops. More...
 
virtual Bool SetCurrentLoop (SInt32 loop)=0
 Set the current loop. More...
 
virtual IEnums::AnimationState GetCurrentState () const =0
 Get the current animation state. More...
 

Detailed Description

The ITimeline interface.

The timeline is evaluated each logic tick using the IStepable interface.
A simple timeline is specified by a start/end time.
The timeline can be controlled by Start(), Pause() and Stop() calls.
All setters are taking effect immediately even if the timeline is running.

A more detailed timeline can use a loop start/end time, resulting in 3 phases:

  • Intro running from start to loop start time.
  • Loop running from loop start to loop end time several times.
  • Outro running from loop end to end time.

The number of loops specifies the counter for of the loop phase.
Endless looping can be achieved by setting number of loops to < 0.
If number of loops is 0 the loop start/end time is ignored which means the timeline simply runs from start to end time.
If the start time is equal to the loop start time the intro phase is skipped.
If the end time is equal to the loop end time the outro phase is skipped.

Member Function Documentation

◆ GetStepable()

virtual IStepablePtr Murl::Logic::ITimeline::GetStepable ( )
pure virtual

Get the stepable interface.

The ITimeline conforms to the IStepable interface.

Returns
The stepable interface shared pointer.

Implemented in Murl::Logic::Timeline.

◆ SetAppTimeline()

virtual Bool Murl::Logic::ITimeline::SetAppTimeline ( IAppTimelinePtr  appTimeline)
pure virtual

Set the timeline callback object.

The IAppTimeline::OnEvaluate() callback method is processed if the timeline's current time is set by IStepable::ProcessTick() or Rewind().

Parameters
appTimelineThe timeline callback object.
Returns
true if successful.

Implemented in Murl::Logic::Timeline.

◆ Evaluate()

virtual void Murl::Logic::ITimeline::Evaluate ( )
pure virtual

Evaluate the current time immediately.

Process the IAppTimeline::OnEvaluate() callback method immediately. This method is rarely used after modifying the timeline's current time. This method is typically called when the timeline's current time was evaluated by IStepable::ProcessTick() within each logic tick. This method is called immediately by Reset(), ResetTo(), Rewind(), Start() with parameters and Stop() if auto rewind is enabled.

Implemented in Murl::Logic::Timeline.

◆ Reset()

virtual void Murl::Logic::ITimeline::Reset ( )
pure virtual

Reset the timeline.

Stop the timeline, reset the WasRunning() state and call Rewind(). Finally Evaluate() is called.

Implemented in Murl::Logic::Timeline, Murl::Logic::SoundFader, Murl::Logic::Animation< DataType >, and Murl::Logic::Animation< Vector >.

◆ ResetTo()

virtual void Murl::Logic::ITimeline::ResetTo ( Real  startTime)
pure virtual

Reset the timeline to a specified start time.

Set the start time and call Reset(). Finally Evaluate() is called.

Parameters
startTimeThe start time in seconds.

Implemented in Murl::Logic::Timeline.

◆ Start() [1/4]

virtual Bool Murl::Logic::ITimeline::Start ( )
pure virtual

Start or continue the timeline.

Reset the WasRunning() state. Does not modify the current time and loop.

Returns
true if successful.

Implemented in Murl::Logic::Timeline.

◆ Start() [2/4]

virtual Bool Murl::Logic::ITimeline::Start ( Real  startTime,
Real  endTime 
)
pure virtual

Start the timeline with specified parameters.

Set start/end time, calls Rewind() and Start(). Finally Evaluate() is called.

Parameters
startTimeThe start time in seconds.
endTimeThe end time in seconds.
Returns
true if successful.

Implemented in Murl::Logic::Timeline.

◆ Start() [3/4]

virtual Bool Murl::Logic::ITimeline::Start ( Real  startTime,
Real  endTime,
SInt32  numberOfLoops 
)
pure virtual

Start the timeline with specified parameters.

Set start/end time, number of loops, calls Rewind() and Start(). Finally Evaluate() is called.

Parameters
startTimeThe start time in seconds.
endTimeThe end time in seconds.
numberOfLoopsNumber of loops.
Returns
true if successful.

Implemented in Murl::Logic::Timeline.

◆ Start() [4/4]

virtual Bool Murl::Logic::ITimeline::Start ( Real  startTime,
Real  endTime,
Real  loopStartTime,
Real  loopEndTime,
SInt32  numberOfLoops 
)
pure virtual

Start the timeline with specified parameters.

Set start/end time, loop start/end time, number of loops, calls Rewind() and Start(). Finally Evaluate() is called.

Parameters
startTimeThe start time in seconds.
endTimeThe end time in seconds.
loopStartTimeThe loop start time in seconds.
loopEndTimeThe loop end time in seconds.
numberOfLoopsNumber of loops.
Returns
true if successful.

Implemented in Murl::Logic::Timeline.

◆ Pause()

virtual Bool Murl::Logic::ITimeline::Pause ( )
pure virtual

Pause the timeline.

Returns
true if timeline was paused, false if timeline is not running.

Implemented in Murl::Logic::Timeline.

◆ Stop()

virtual Bool Murl::Logic::ITimeline::Stop ( )
pure virtual

Stop the timeline.

Rewind() is called if auto rewind is enabled. Finally Evaluate() is called if auto rewind is enabled.

Returns
true if timeline was stopped, false if timeline is already stopped.

Implemented in Murl::Logic::Timeline.

◆ Rewind()

virtual Bool Murl::Logic::ITimeline::Rewind ( )
pure virtual

Rewind the timeline.

Sets the current time to the start time and the current loop to the start loop. Does not affect the current running state. Finally Evaluate() is called.

Returns
true if successful.

Implemented in Murl::Logic::Timeline.

◆ SetStartTime()

virtual void Murl::Logic::ITimeline::SetStartTime ( Real  startTime)
pure virtual

Set the start time.

Parameters
startTimeThe start time in seconds.

Implemented in Murl::Logic::Timeline.

◆ GetStartTime()

virtual Real Murl::Logic::ITimeline::GetStartTime ( ) const
pure virtual

Get the start time.

Returns
The start time in seconds.

Implemented in Murl::Logic::Timeline.

◆ SetEndTime()

virtual void Murl::Logic::ITimeline::SetEndTime ( Real  endTime)
pure virtual

Set the end time.

Parameters
endTimeThe end time in seconds.

Implemented in Murl::Logic::Timeline.

◆ GetEndTime()

virtual Real Murl::Logic::ITimeline::GetEndTime ( ) const
pure virtual

Get the end time.

Returns
The end time in seconds.

Implemented in Murl::Logic::Timeline.

◆ SetLoopStartTime()

virtual void Murl::Logic::ITimeline::SetLoopStartTime ( Real  startTime)
pure virtual

Set the loop start time.

Parameters
startTimeThe loop start time in seconds.

Implemented in Murl::Logic::Timeline.

◆ GetLoopStartTime()

virtual Real Murl::Logic::ITimeline::GetLoopStartTime ( ) const
pure virtual

Get the loop start time.

Returns
The loop start time in seconds.

Implemented in Murl::Logic::Timeline.

◆ SetLoopEndTime()

virtual void Murl::Logic::ITimeline::SetLoopEndTime ( Real  endTime)
pure virtual

Set the loop end time.

Parameters
endTimeThe loop end time in seconds.

Implemented in Murl::Logic::Timeline.

◆ GetLoopEndTime()

virtual Real Murl::Logic::ITimeline::GetLoopEndTime ( ) const
pure virtual

Get the loop end time.

Returns
The loop end time in seconds.

Implemented in Murl::Logic::Timeline.

◆ SetNumberOfLoops()

virtual void Murl::Logic::ITimeline::SetNumberOfLoops ( SInt32  numberOfLoops)
pure virtual

Set the number of loops.

Parameters
numberOfLoopsNumber of loops.

Implemented in Murl::Logic::Timeline.

◆ GetNumberOfLoops()

virtual SInt32 Murl::Logic::ITimeline::GetNumberOfLoops ( ) const
pure virtual

Get the number of loops.

Returns
The number of loops.

Implemented in Murl::Logic::Timeline.

◆ SetTimeScale()

virtual void Murl::Logic::ITimeline::SetTimeScale ( Real  timeScale)
pure virtual

Set the time scale factor.

The recent tick duration is multiplied by the time scale factor and added to the current time each logic tick. The default time scale factor is 1.

Parameters
timeScaleThe time scale factor.

Implemented in Murl::Logic::Timeline.

◆ GetTimeScale()

virtual Real Murl::Logic::ITimeline::GetTimeScale ( ) const
pure virtual

Get the time scale factor.

Returns
true The time scale factor.

Implemented in Murl::Logic::Timeline.

◆ SetAutoRewindEnabled()

virtual void Murl::Logic::ITimeline::SetAutoRewindEnabled ( Bool  enabled)
pure virtual

Enable/disable automatic rewind.

Automatic rewind is calling Rewind() when the timeline is stopped.

Parameters
enabledEnable automatic rewind if true.

Implemented in Murl::Logic::Timeline.

◆ IsAutoRewindEnabled()

virtual Bool Murl::Logic::ITimeline::IsAutoRewindEnabled ( ) const
pure virtual

Check if automatic rewind is enabled.

Returns
true if automatic rewind.

Implemented in Murl::Logic::Timeline.

◆ IsRunning()

virtual Bool Murl::Logic::ITimeline::IsRunning ( ) const
pure virtual

Check if the timeline is running.

A timeline can be started by calling Start() and stopped by calling Stop().

Returns
true if running.

Implemented in Murl::Logic::Timeline.

◆ IsPaused()

virtual Bool Murl::Logic::ITimeline::IsPaused ( ) const
pure virtual

Check if the timeline is paused.

A timeline can be paused by calling Pause() and continued by calling Start().

Returns
true if paused.

Implemented in Murl::Logic::Timeline.

◆ IsStopped()

virtual Bool Murl::Logic::ITimeline::IsStopped ( ) const
pure virtual

Check if the timeline is stopped.

A timeline can be stopped by calling Stop() and started by calling Start().

Returns
true if stopped.

Implemented in Murl::Logic::Timeline.

◆ WasStarted()

virtual Bool Murl::Logic::ITimeline::WasStarted ( ) const
pure virtual

Check if the timeline was started from stopped state.

Returns
true if started.

Implemented in Murl::Logic::Timeline.

◆ WasRunning()

virtual Bool Murl::Logic::ITimeline::WasRunning ( ) const
pure virtual

Check if the timeline has stopped running.

If the timeline is stopped this state is true within the current logic tick only and will be cleared at the next logic tick.
(!) This state remains unchanged if the processor holding the timeline's observer is set to inactive within the current logic tick. In such a case the Reset() method can be called to clear the state.

Returns
true if stopped.

Implemented in Murl::Logic::Timeline.

◆ IsOrWasRunning()

virtual Bool Murl::Logic::ITimeline::IsOrWasRunning ( ) const
pure virtual

Check if the timeline is or was running.

Returns (IsRunning() || WasRunning()) state.

Returns
true if IsRunning() or WasRunning() is true.

Implemented in Murl::Logic::Timeline.

◆ HasPassedTime()

virtual Bool Murl::Logic::ITimeline::HasPassedTime ( Real  time) const
pure virtual

Check if the current time has passed a specified time within the most recent tick.

Does not consider loops, for evaluating loops see HasPassedLoop().

Parameters
timeThe time to check in seconds.
Returns
true if the current time has passed a specified time within the most recent tick.

Implemented in Murl::Logic::Timeline.

◆ HasPassedLoop()

virtual Bool Murl::Logic::ITimeline::HasPassedLoop ( SInt32  loop) const
pure virtual

Check if the current loop has passed a specified loop number within the most recent tick.

If the loop number to check is negative, true is returned each time the current loop has changed.

Parameters
loopThe loop number to check.
Returns
true if the current loop has passed a specified loop within the most recent tick.

Implemented in Murl::Logic::Timeline.

◆ GetCurrentTime()

virtual Double Murl::Logic::ITimeline::GetCurrentTime ( ) const
pure virtual

Get the current time.

This method does not consider loops, for evaluating loops see GetCurrentLoop().

Returns
The current time in seconds.

Implemented in Murl::Logic::Timeline.

◆ GetRemainingTime()

virtual Double Murl::Logic::ITimeline::GetRemainingTime ( ) const
pure virtual

Get the remaining time.

This method calculates GetEndTime() - GetCurrentTime() which does not consider loops, for evaluating loops see GetCurrentLoop().

Returns
The remaining time in seconds.

Implemented in Murl::Logic::Timeline.

◆ SetCurrentTime()

virtual void Murl::Logic::ITimeline::SetCurrentTime ( Double  time)
pure virtual

Set the current time.

This method does not consider loops, for setting loops see SetCurrentLoop().

Parameters
timeThe current time to set in seconds.

Implemented in Murl::Logic::Timeline.

◆ GetCurrentLoop()

virtual SInt32 Murl::Logic::ITimeline::GetCurrentLoop ( ) const
pure virtual

Get the current loop.

The current loop provides the following information for n loops:

  • 0 Intro running from start to loop start time.
  • 1 .. n Loop running from loop start to loop end time.
  • n + 1 Outro running from loop end to end time.
Returns
The current loop, 0 if number of loops is 0.

Implemented in Murl::Logic::Timeline.

◆ GetRemainingLoops()

virtual SInt32 Murl::Logic::ITimeline::GetRemainingLoops ( ) const
pure virtual

Get the remaining loops.

Calculates GetNumberOfLoops() - GetCurrentLoop().

Returns
The remaining loops, -1 if number of loops is < 0, 0 if number of loops is 0 or intro/outro is running.

Implemented in Murl::Logic::Timeline.

◆ SetCurrentLoop()

virtual Bool Murl::Logic::ITimeline::SetCurrentLoop ( SInt32  loop)
pure virtual

Set the current loop.

The current loop represents the following information for n loops:

  • 0 Intro running from start to loop start time.
  • 1 .. n Loop running from loop start to loop end time.
  • n + 1 Outro running from loop end to end time.
Parameters
loopThe current loop to set.
Returns
true if successful, false if the loop number is out of range.

Implemented in Murl::Logic::Timeline.

◆ GetCurrentState()

virtual IEnums::AnimationState Murl::Logic::ITimeline::GetCurrentState ( ) const
pure virtual

Get the current animation state.

Returns
The current animation state.

Implemented in Murl::Logic::Timeline.


The documentation for this interface was generated from the following file:
  • murl_logic_i_timeline.h


Copyright © 2011-2024 Spraylight GmbH.