Public Types | |
enum | Type { stStream, stModule } |
Public Member Functions | |
Song (Audio &, const std::wstring &filename) | |
Song (Audio &, Type type, Reader reader) | |
void | play (bool looping=false) |
void | pause () |
bool | paused () const |
void | stop () |
bool | playing () const |
double | volume () const |
void | changeVolume (double volume) |
Static Public Member Functions | |
static Song * | currentSong () |
enum Gosu::Song::Type |
There are two types of songs that can be loaded as a Song: Streamed songs (like OGG) and modules (like MOD or XM).
Gosu::Song::Song | ( | Audio & | , | |
const std::wstring & | filename | |||
) |
Constructs a song that can be played on the provided audio system and loads the song from a file.
The type is determined from the filename.
Constructs a song of the specified type that can be played on the provided audio system and loads the song data from a stream.
static Song* Gosu::Song::currentSong | ( | ) | [static] |
Returns the song currently being played or paused, or 0 if no song has been played yet or the last song has finished playing.
void Gosu::Song::play | ( | bool | looping = false |
) |
Starts or resumes playback of the song.
This will stop all other songs and set the current song to this object.
void Gosu::Song::pause | ( | ) |
Pauses playback of the song.
It is not considered being played. currentSong will stay the same.
bool Gosu::Song::paused | ( | ) | const |
Returns true if the song is the current song, but in paused mode.
void Gosu::Song::stop | ( | ) |
Stops playback of this song if it is currently played or paused.
Afterwards, currentSong will return 0.
bool Gosu::Song::playing | ( | ) | const |
Returns if the song is currently playing.
double Gosu::Song::volume | ( | ) | const |
Returns the current volume of the song.
void Gosu::Song::changeVolume | ( | double | volume | ) |
Changes the volume of the song.