Emergency 2017 Dokumentation  v3.0.1
qsf::logic::SequencePlayer Class Reference

Sequence player class. More...

#include <SequencePlayer.h>

Public Member Functions

 SequencePlayer ()
 Default constructor. More...
 
virtual ~SequencePlayer ()
 Destructor. More...
 
bool isPlaying () const
 
float getPlaybackSpeed () const
 
void setPlaybackSpeed (float newSpeed)
 
bool getIsLooping () const
 
void setIsLooping (bool isLooping)
 
SequencegetSequence () const
 Change the sequence this player is operating on. More...
 
void setSequence (Sequence *sequence)
 
bool advancePlayhead (float deltaTime)
 Advance the playhead and evaluates the sequence. More...
 
void modifyTime (float newTime)
 Will only record the time as the internal current time state. More...
 
float getTime () const
 Return the internal playhead time. More...
 

Protected Member Functions

virtual void onStartSequence ()
 
virtual void onEndSequence ()
 
virtual void onNotifyTimePassed (float oldTime, float newTime)
 

Detailed Description

Sequence player class.

Definition at line 46 of file SequencePlayer.h.

Constructor & Destructor Documentation

qsf::logic::SequencePlayer::SequencePlayer ( )
inline

Default constructor.

Definition at line 16 of file SequencePlayer-inl.h.

qsf::logic::SequencePlayer::~SequencePlayer ( )
inlinevirtual

Destructor.

Reimplemented in em5::SequencePlayer.

Definition at line 25 of file SequencePlayer-inl.h.

Member Function Documentation

bool qsf::logic::SequencePlayer::advancePlayhead ( float  deltaTime)

Advance the playhead and evaluates the sequence.

Parameters
[in]deltaTimeTime passed since last playhead advancement (frame time delta) in seconds
Returns
"true" in case the sequnce is going to continue playback, "false" if it has ended and should be removed
Todo:
  • TODO(co) We might want to use our "qsf::Time"-class in here
bool qsf::logic::SequencePlayer::getIsLooping ( ) const
inline

Definition at line 45 of file SequencePlayer-inl.h.

float qsf::logic::SequencePlayer::getPlaybackSpeed ( ) const
inline

Definition at line 35 of file SequencePlayer-inl.h.

Sequence * qsf::logic::SequencePlayer::getSequence ( ) const
inline

Change the sequence this player is operating on.

Remarks
Changes the sequence this player is operating on, which can be a null pointer. In case of a valid sequence reference, the sequence will be evaluated immediately at the current playhead time. The playhead time will be adjusted beforehand to stay in the valid range. Might expose some funny behavior when looping is enabled and the playhead is not at the start of the sequence. The sequence informative data is evaluated and applied to the current player settings (e.g. looping and playback speed).

Definition at line 55 of file SequencePlayer-inl.h.

float qsf::logic::SequencePlayer::getTime ( ) const
inline

Return the internal playhead time.

Definition at line 65 of file SequencePlayer-inl.h.

bool qsf::logic::SequencePlayer::isPlaying ( ) const
inline

Definition at line 30 of file SequencePlayer-inl.h.

void qsf::logic::SequencePlayer::modifyTime ( float  newTime)
inline

Will only record the time as the internal current time state.

Parameters
[in]newTimeZero-based timestamp in seconds where the playhead is set to
Note
  • If you need to play randomly inside a sequence, use "modifyTime()" to change the playhead at once which won't evaluate the sequence
Todo:
  • TODO(co) We might want to use our "qsf::Time"-class in here

Definition at line 60 of file SequencePlayer-inl.h.

virtual void qsf::logic::SequencePlayer::onEndSequence ( )
protectedvirtual

Reimplemented in em5::SequencePlayer.

virtual void qsf::logic::SequencePlayer::onNotifyTimePassed ( float  oldTime,
float  newTime 
)
protectedvirtual

Reimplemented in em5::SequencePlayer.

virtual void qsf::logic::SequencePlayer::onStartSequence ( )
protectedvirtual

Reimplemented in em5::SequencePlayer.

void qsf::logic::SequencePlayer::setIsLooping ( bool  isLooping)
inline

Definition at line 50 of file SequencePlayer-inl.h.

void qsf::logic::SequencePlayer::setPlaybackSpeed ( float  newSpeed)
inline

Definition at line 40 of file SequencePlayer-inl.h.

void qsf::logic::SequencePlayer::setSequence ( Sequence sequence)

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