Emergency 20 Dokumentation  4.1.0
Public Member Functions | Protected Member Functions | List of all members
qsf::logic::SequencePlayer Class Reference

Sequence player class. More...

#include <SequencePlayer.h>

Inheritance diagram for qsf::logic::SequencePlayer:
Inheritance graph
[legend]
Collaboration diagram for qsf::logic::SequencePlayer:
Collaboration graph
[legend]

Public Member Functions

 SequencePlayer ()
 Default constructor. More...
 
virtual ~SequencePlayer ()
 Destructor. More...
 
PlaySequenceComponentgetOwnerComponent () const
 
void setOwnerComponent (PlaySequenceComponent *component)
 
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, const StringHash &jobManagerId=getUninitialized< StringHash >())
 
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.

Constructor & Destructor Documentation

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

Default constructor.

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

Destructor.

Reimplemented in em5::SequencePlayer.

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 sequence 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
PlaySequenceComponent * qsf::logic::SequencePlayer::getOwnerComponent ( ) const
inline
float qsf::logic::SequencePlayer::getPlaybackSpeed ( ) const
inline
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).
float qsf::logic::SequencePlayer::getTime ( ) const
inline

Return the internal playhead time.

bool qsf::logic::SequencePlayer::isPlaying ( ) const
inline
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
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
void qsf::logic::SequencePlayer::setOwnerComponent ( PlaySequenceComponent component)
inline
void qsf::logic::SequencePlayer::setPlaybackSpeed ( float  newSpeed)
inline
void qsf::logic::SequencePlayer::setSequence ( Sequence sequence,
const StringHash jobManagerId = getUninitializedStringHash >() 
)

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