The MusicPlayer class. More...
#include <Sound/MusicPlayer.h>
Public Types | |
| enum | RepeatMode { REPEAT_OFF = 0, REPEAT_ON, REPEAT_SINGLE } |
Defines the differant repeat modes the music player supports. More... | |
Public Member Functions | |
| MusicPlayer () | |
| Default Constructor. | |
| MusicPlayer (const Playlist &pl) | |
| Constructor. | |
| void | SetPlaylist (const Playlist &pl) |
| Sets the Music players playlist. | |
| const Playlist & | GetPlaylist () const |
| Returns the current playlist. | |
| Playlist::ConstIterator | GetCurrentSongIterator () const |
| Returns a constant playlist iterator to the current song. | |
| RepeatMode | GetRepeatMode () const |
| Returns the currently set repeat mode. | |
| void | SetRepeatMode (RepeatMode mode) |
| Sets the music players repeat mode. | |
| byte | GetVolume () const |
| Gets the volume of the music player. | |
| void | SetVolume (byte v) |
| Sets the volume of the music player. | |
| void | MoveToStart () |
| Moves to the start of the playlist. | |
| void | MoveToEnd () |
| Moves to the end of the playlist. | |
| void | Next () |
| Advances to the next song in the playlist. | |
| void | Previous () |
| Advances to the previous song in the playlist. | |
| bool | Play () |
| Plays the currently active song. | |
| void | Stop () |
| Stops playing the current song. | |
| void | Pause () |
| Pauses the currently active song. | |
| bool | IsPaused () |
| Returns true if the current song is paused. | |
| bool | IsStopped () |
| Returns true if the music player is stopped. | |
| bool | IsSongDone () |
| Returns true if the currently playing song is done. | |
| void | FadeOut (float time) |
| Fades out the currently playing song in the specified amount of time. | |
| void | Update (float dt) |
| Called each frame. | |
The MusicPlayer class.
| MusicPlayer::MusicPlayer | ( | const Playlist & | pl | ) |
Constructor.
| [in] | pl | the playlist to use. |
| void MusicPlayer::FadeOut | ( | float | time | ) |
Fades out the currently playing song in the specified amount of time.
| [in] | time | the time in seconds to fade out the song. |
Once the fade out time is reached the song is paused.
| bool MusicPlayer::Play | ( | ) |
Plays the currently active song.
| void MusicPlayer::SetPlaylist | ( | const Playlist & | pl | ) | [inline] |
Sets the Music players playlist.
| [in] | pl | the playlist to use. |
| void MusicPlayer::Update | ( | float | dt | ) |
Called each frame.
| [in] | dt | the time in seconds since the last frame. |
NOTE: Only needed if you want the music player to manage moving from song to song.
1.6.3