This is a convenience class for the playing of music in a game. More...
#include <musicplayer.h>
Public Types | |
typedef std::list< Audio::iSound * >::iterator | TrackIterator |
Convenience type for track iterators from playlists. | |
Public Member Functions | |
MusicPlayer () | |
Class constructor. | |
~MusicPlayer () | |
Class destructor. | |
Boole | ContainsSong (iSound *Track) const |
Checks the set playlist to see if it contains a track. More... | |
Playlist * | GetPlaylist () const |
Gets the playlist in use by this music player. More... | |
Boole | GetPlaylistRepeat () const |
Gets wether playlist repeat is enabled. More... | |
Boole | GetPlaylistShuffle () const |
Gets wether playlist shuffle is enabled. More... | |
Boole | IsPaused () const |
Gets whether or not the current selection is paused. More... | |
Boole | IsPlaying () const |
Gets whether or not the current selection is playing. More... | |
Boole | 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 (Boole Repeat) |
Sets whether the playlist should return to the start after it reaches the end of the list. More... | |
void | SetPlaylistShuffle (Boole 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 | SwitchToTrack (iSound *Track) |
Sets the specified track as the current track. More... | |
void | Update () |
Called on by the AudioManager to perform all music player responsibilities. | |
Protected Member Functions | |
TrackIterator | GetIteratorToTrack (iSound *Track) |
Gets an iterator to the iSound instance in the current playlist. More... | |
Protected Attributes | |
Audio::iSound * | CurrTrack |
A pointer to the currently selected track. More... | |
Boole | EOPRepeat |
Stores whether or not the player will loop back to the start when it finishes playing all tracks in the playlist. More... | |
Boole | EOPShuffle |
Stores whether or not the player will shuffle the playlist when it finishes playing all the tracks in the playlist. More... | |
Boole | ManualStop |
Stores whether or not the current track has been manually stopped. More... | |
Audio::Playlist * | MusicPlaylist |
A pointer to the active playlist used by this player. More... | |
Boole | Playing |
Stores whether or not this player is currently playing. More... | |
This is a convenience class for the playing of music in a game.
Definition at line 58 of file musicplayer.h.
Checks the set playlist to see if it contains a track.
Track | The track to check for. |
Definition at line 144 of file musicplayer.cpp.
|
protected |
Playlist * Mezzanine::Audio::MusicPlayer::GetPlaylist | ( | ) | const |
Gets the playlist in use by this music player.
Definition at line 159 of file musicplayer.cpp.
Boole Mezzanine::Audio::MusicPlayer::GetPlaylistRepeat | ( | ) | const |
Gets wether playlist repeat is enabled.
Definition at line 150 of file musicplayer.cpp.
Boole Mezzanine::Audio::MusicPlayer::GetPlaylistShuffle | ( | ) | const |
Gets wether playlist shuffle is enabled.
Definition at line 156 of file musicplayer.cpp.
Boole Mezzanine::Audio::MusicPlayer::IsPaused | ( | ) | const |
Gets whether or not the current selection is paused.
Definition at line 141 of file musicplayer.cpp.
Boole Mezzanine::Audio::MusicPlayer::IsPlaying | ( | ) | const |
Gets whether or not the current selection is playing.
Definition at line 135 of file musicplayer.cpp.
Boole Mezzanine::Audio::MusicPlayer::IsStopped | ( | ) | const |
Gets whether or not the current selection is stopped.
Definition at line 138 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 77 of file musicplayer.cpp.
void Mezzanine::Audio::MusicPlayer::SetPlaylistRepeat | ( | Boole | 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 147 of file musicplayer.cpp.
void Mezzanine::Audio::MusicPlayer::SetPlaylistShuffle | ( | Boole | 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 153 of file musicplayer.cpp.
void Mezzanine::Audio::MusicPlayer::SwitchToTrack | ( | iSound * | Track | ) |
Sets the specified track as the current track.
If | the provided track isn't in the playlist, this will throw an InstanceIdentityNotFoundException . Use the ContainsSong() function to verify before using this. |
Track | The track to set. |
Definition at line 121 of file musicplayer.cpp.
|
protected |
A pointer to the currently selected track.
Definition at line 69 of file musicplayer.h.
|
protected |
Stores whether or not the player will loop back to the start when it finishes playing all tracks in the playlist.
Definition at line 78 of file musicplayer.h.
|
protected |
Stores whether or not the player will shuffle the playlist when it finishes playing all the tracks in the playlist.
Definition at line 81 of file musicplayer.h.
|
protected |
Stores whether or not the current track has been manually stopped.
Definition at line 72 of file musicplayer.h.
|
protected |
A pointer to the active playlist used by this player.
Definition at line 66 of file musicplayer.h.
|
protected |
Stores whether or not this player is currently playing.
Definition at line 75 of file musicplayer.h.