VizKit  3.3.7
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
VizKit::VisualPlayerState Class Reference

Provides access to the state of the audio player host. More...

#include <VisualPlayerState.h>

List of all members.

Public Member Functions

bool isAudioPlaying (void) const
 Answers the question whether currently audio is playing.
AudioPlayState getAudioPlayState (void) const
 Returns the play state of the visual player.
PlayerShowMode getPlayerShowMode (void) const
 Returns the current mode of the show state.
uint32 getElapsedAudioTime (void) const
 Returns the number of milliseconds of the current audio track that have been passed.
bool remainingAudioTimeIsKnown (void) const
 Answers the question whether the remaining time of the current audio track is known.
uint32 getRemainingAudioTime (void) const
 Returns the number of milliseconds of the current audio track that are waiting to be played.
bool fadeOutEventShouldBeSent (void)
 Returns true if the fadeOut event should be sent because the remaining time is less than kAudioPlayReachedFadeOutTimeEvt.
uint32 getElapsedAudioPlayStartTime (void) const
 Returns the actual number of milliseconds that have passed since the last audio play start event.
uint32 getElapsedAudioPlayStopTime (void) const
 Returns the actual number of milliseconds that have passed since the last audio play stop event.
bool isInDebugMode (void) const
 Returns true if player is in debug mode, false otherwise.
void setAudioPlayState (const AudioPlayState playState)
 Stores the state of audio play.
void setPlayerShowMode (const PlayerShowMode aShowMode)
 Stores the current mode of the show state.
void setDebugMode (bool requestedDebugMode)
 Sets the debug mode.
void setTrackPlayPositionInMS (const uint32 positionInMS)
 The play position of the current track is set.

Static Public Member Functions

static VisualPlayerStategetInstance (void)
 Constructs a VisualPlayerState.
static void dispose (void)
 Disposes the VisualPlayerState.
static void convertAudioPlayStateToString (const AudioPlayState anAudioPlayState, char *outString)
 Static helper function that converts an audioPlayState to the string.
static void convertPlayerShowModeToString (const PlayerShowMode aShowMode, char *outString)
 Static helper function that converts an showMode to the string.

Private Member Functions

 VisualPlayerState ()
 The constructor.
 ~VisualPlayerState ()
 The destructor.
 VisualPlayerState (const VisualPlayerState &other)
 Copy constructor.
VisualPlayerStateoperator= (const VisualPlayerState &other)
 Assignment operator.

Private Attributes

AudioPlayState audioPlayState
 Uses enum audioPlayState to store the state of audio play.
PlayerShowMode showMode
 Uses enum showMode to store the show mode.
bool fadeOutEventHasBeenSent
 Stores whether the fadeOut event has been sent once during the play of the current audio track.
uint32 trackPlayPositionInMS
 The current play position of the current track (in milliseconds).
bool debugMode
 True if player is in debug mode, false otherwise.

Static Private Attributes

static VisualPlayerStatetheVisualPlayerState = NULL
 VisualPlayerState is a singleton class.

Detailed Description

Provides access to the state of the audio player host.


Constructor & Destructor Documentation

The constructor.

VisualPlayerState is a singleton class. The constructor is private. New instance of class can only be created internally.

The destructor.

VisualPlayerState is a singleton class. The destructor is private. Instance of class can only be destructed internally.

Copy constructor.

Parameters:
otherAnother VisualPlayerState.
Remarks:
Explicitely declared in private section and not implemented to enforce uniqueness of singleton pattern.

Member Function Documentation

void VisualPlayerState::convertAudioPlayStateToString ( const AudioPlayState  anAudioPlayState,
char *  outString 
) [static]

Static helper function that converts an audioPlayState to the string.

Possibly useful for debugging or tracing purposes.

Parameters:
anAudioPlayStateAn audioPlayState.
outStringThe character string value of the AudioPlayState enum value.
void VisualPlayerState::convertPlayerShowModeToString ( const PlayerShowMode  aShowMode,
char *  outString 
) [static]

Static helper function that converts an showMode to the string.

Possibly useful for debugging or tracing purposes.

Parameters:
aShowModeA showMode.
outStringThe character string value of the ShowMode enum value.
void VisualPlayerState::dispose ( void  ) [static]

Disposes the VisualPlayerState.

Returns true if the fadeOut event should be sent because the remaining time is less than kAudioPlayReachedFadeOutTimeEvt.

Returns:
True if the fadeOut event should be sent because the remaining time is less than kAudioPlayReachedFadeOutTimeEvt.

Returns the play state of the visual player.

Returns:
A value of audioPlayState enum.

Returns the actual number of milliseconds that have passed since the last audio play start event.

AudioPlayStartTime and audioPlayStopTime are mutual exclusive. If audioPlayStartTime > 0 then audio is playing and audioPlayStopTime == 0. If audioPlayStopTime > 0 then audio is not playing and audioPlayStartTime == 0.

Returns:
The actual number of milliseconds that have passed since the last audio play start event.

Returns the actual number of milliseconds that have passed since the last audio play stop event.

AudioPlayStartTime and audioPlayStopTime are mutual exclusive. If audioPlayStartTime > 0 then audio is playing and audioPlayStopTime == 0. If audioPlayStopTime > 0 then audio is not playing and audioPlayStartTime == 0.

Returns:
The actual number of milliseconds that have passed since the last audio play stop event.

Returns the number of milliseconds of the current audio track that have been passed.

0 if no time value is available. The player position is returned.

Returns:
The number of milliseconds of the current audio track that have been passed.

Constructs a VisualPlayerState.

The VisualPlayerState acts as a singleton. Returns a pointer to the initialised VisualPlayerState.

Returns:
A pointer to the singleton instance.

Returns the current mode of the show state.

Returns:
The current mode of the show state.

Returns the number of milliseconds of the current audio track that are waiting to be played.

0 if no time value is available.

Returns:
The number of milliseconds of the current audio track that are waiting to be played.
bool VisualPlayerState::isAudioPlaying ( void  ) const

Answers the question whether currently audio is playing.

Returns:
True if audio is playing, false if playing of audio is stopped.
bool VisualPlayerState::isInDebugMode ( void  ) const

Returns true if player is in debug mode, false otherwise.

Useful for temporarily and dynamically activated debug mode that can be checked against in different places.

Returns:
True if player is in debug mode, false otherwise.
Remarks:
The debug mode does not change anything fundamentally. It is only a flag that can be set and asked for.
VisualPlayerState& VizKit::VisualPlayerState::operator= ( const VisualPlayerState other) [private]

Assignment operator.

Remarks:
Explicitely declared in private section and not implemented to enforce uniqueness of singleton pattern.

Answers the question whether the remaining time of the current audio track is known.

Streamed audio has no info about remaining time of current track.

Returns:
True if the remaining time of the current audio track is known, false if not.

Stores the state of audio play.

Parameters:
playStateA value of audioPlayState enum.
void VisualPlayerState::setDebugMode ( bool  requestedDebugMode)

Sets the debug mode.

Parameters:
requestedDebugModeThe debug mode. True turns debug mode on, false turns it off.

Stores the current mode of the show state.

Parameters:
aShowModeThe current mode of the show state.

The play position of the current track is set.

Parameters:
positionInMSThe play position in milliseconds.

Member Data Documentation

Uses enum audioPlayState to store the state of audio play.

See enum audioPlayState for possible different states of audio play.

True if player is in debug mode, false otherwise.

Stores whether the fadeOut event has been sent once during the play of the current audio track.

Uses enum showMode to store the show mode.

See enum showMode for possible different show modes.

VisualPlayerState is a singleton class.

Pointer to private instance is handled internally.

The current play position of the current track (in milliseconds).


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

Generated on Sun May 3 2015 20:26:32 for VizKit by doxygen 1.8.0