MezzanineEngine 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Mezzanine::Audio::MusicPlayer Class Reference

This is a convenience class for the playing of music in a game. More...

#include <musicplayer.h>

+ Collaboration diagram for Mezzanine::Audio::MusicPlayer:

Public Member Functions

 MusicPlayer ()
 Class constructor.
 
 ~MusicPlayer ()
 Class destructor.
 
bool ContainsSong (iSound *Song) const
 Checks the set playlist to see if it contains a song. More...
 
PlaylistGetPlaylist () const
 Gets the playlist in use by this music player. More...
 
bool GetPlaylistRepeat () const
 Gets wether playlist repeat is enabled. More...
 
bool GetPlaylistShuffle () const
 Gets wether playlist shuffle is enabled. More...
 
bool IsPaused () const
 Gets whether or not the current selection is paused. More...
 
bool IsPlaying () const
 Gets whether or not the current selection is playing. More...
 
bool IsStopped () const
 Gets whether or not the current selection is stopped. More...
 
void Next ()
 Advances to the next selection on the playlist.
 
void Pause ()
 Pauses the current selection.
 
void Play ()
 Plays the current selection. More...
 
void Previous ()
 Moves back to the previous selection on the playlist.
 
void SetPlaylistRepeat (bool Repeat)
 Sets whether the playlist should return to the start after it reaches the end of the list. More...
 
void SetPlaylistShuffle (bool Shuffle)
 Sets whether the playlist should shuffle it's contents after it reaches the end of the list. More...
 
void Stop ()
 Stops the current selection.
 
void SwitchToSong (iSound *Song)
 Sets the specified song as the current song. More...
 
void Update ()
 Called on by the AudioManager to perform all music player responsibilities.
 

Protected Member Functions

std::list< Audio::iSound * >
::iterator 
GetIteratorToSong (iSound *Song)
 

Protected Attributes

Audio::iSoundCurrSong
 
bool EOPRepeat
 
bool EOPShuffle
 
bool ManualStop
 
Audio::PlaylistMusicPlaylist
 
bool Playing
 

Detailed Description

This is a convenience class for the playing of music in a game.

Definition at line 58 of file musicplayer.h.

Member Function Documentation

bool Mezzanine::Audio::MusicPlayer::ContainsSong ( iSound Song) const

Checks the set playlist to see if it contains a song.

Parameters
SongThe song to check for.

Definition at line 154 of file musicplayer.cpp.

Playlist * Mezzanine::Audio::MusicPlayer::GetPlaylist ( ) const

Gets the playlist in use by this music player.

Returns
Returns a pointer to the current playlist in use.

Definition at line 179 of file musicplayer.cpp.

bool Mezzanine::Audio::MusicPlayer::GetPlaylistRepeat ( ) const

Gets wether playlist repeat is enabled.

Returns
Returns true if the playlist is set to repeat when it finishes, false otherwise.

Definition at line 164 of file musicplayer.cpp.

bool Mezzanine::Audio::MusicPlayer::GetPlaylistShuffle ( ) const

Gets wether playlist shuffle is enabled.

Returns
Returns true if the playlist is set to shuffle when it finishes, false otherwise.

Definition at line 174 of file musicplayer.cpp.

bool Mezzanine::Audio::MusicPlayer::IsPaused ( ) const

Gets whether or not the current selection is paused.

Returns
Returns true if the current song is paused, false otherwise.

Definition at line 149 of file musicplayer.cpp.

bool Mezzanine::Audio::MusicPlayer::IsPlaying ( ) const

Gets whether or not the current selection is playing.

Returns
Returns true if the current song is playing, false otherwise.

Definition at line 139 of file musicplayer.cpp.

bool Mezzanine::Audio::MusicPlayer::IsStopped ( ) const

Gets whether or not the current selection is stopped.

Returns
Returns true if the current song is stopped, false otherwise.

Definition at line 144 of file musicplayer.cpp.

void Mezzanine::Audio::MusicPlayer::Play ( )

Plays the current selection.

Exceptions
Ifthe current playlist is empty this throws a InvalidStateException

Definition at line 82 of file musicplayer.cpp.

void Mezzanine::Audio::MusicPlayer::SetPlaylistRepeat ( bool  Repeat)

Sets whether the playlist should return to the start after it reaches the end of the list.

Parameters
RepeatEnables/Disables repeating the playlist when it reaches the end.

Definition at line 159 of file musicplayer.cpp.

void Mezzanine::Audio::MusicPlayer::SetPlaylistShuffle ( bool  Shuffle)

Sets whether the playlist should shuffle it's contents after it reaches the end of the list.

Parameters
ShuffleEnables/Disables shuffling the playlist when it reaches the end.

Definition at line 169 of file musicplayer.cpp.

void Mezzanine::Audio::MusicPlayer::SwitchToSong ( iSound Song)

Sets the specified song as the current song.

Exceptions
Ifthe provided song isn't in the playlist, this will throw an InstanceIdentityNotFoundException . Use the ContainsSong() function to verify before using this.
Parameters
SongThe song to set.

Definition at line 124 of file musicplayer.cpp.


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