This is a convenience class for the playing of music in a game. More...
#include <musicplayer.h>
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... | |
Playlist * | GetPlaylist () 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::iSound * | CurrSong |
bool | EOPRepeat |
bool | EOPShuffle |
bool | ManualStop |
Audio::Playlist * | MusicPlaylist |
bool | Playing |
This is a convenience class for the playing of music in a game.
Definition at line 58 of file musicplayer.h.
bool Mezzanine::Audio::MusicPlayer::ContainsSong | ( | iSound * | Song) | const |
Checks the set playlist to see if it contains a song.
Song | The 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.
Definition at line 179 of file musicplayer.cpp.
bool Mezzanine::Audio::MusicPlayer::GetPlaylistRepeat | ( | ) | const |
Gets wether playlist repeat is enabled.
Definition at line 164 of file musicplayer.cpp.
bool Mezzanine::Audio::MusicPlayer::GetPlaylistShuffle | ( | ) | const |
Gets wether playlist shuffle is enabled.
Definition at line 174 of file musicplayer.cpp.
bool Mezzanine::Audio::MusicPlayer::IsPaused | ( | ) | const |
Gets whether or not the current selection is paused.
Definition at line 149 of file musicplayer.cpp.
bool Mezzanine::Audio::MusicPlayer::IsPlaying | ( | ) | const |
Gets whether or not the current selection is playing.
Definition at line 139 of file musicplayer.cpp.
bool Mezzanine::Audio::MusicPlayer::IsStopped | ( | ) | const |
Gets whether or not the current selection is stopped.
Definition at line 144 of file musicplayer.cpp.
void Mezzanine::Audio::MusicPlayer::Play | ( | ) |
Plays the current selection.
If | the 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.
Repeat | Enables/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.
Shuffle | Enables/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.
If | the provided song isn't in the playlist, this will throw an InstanceIdentityNotFoundException . Use the ContainsSong() function to verify before using this. |
Song | The song to set. |
Definition at line 124 of file musicplayer.cpp.