Songs are less flexible than samples in that they can only be played one at a time and without panning or speed parameters.
More...
|
| | Song (const std::wstring &filename) |
| | Constructs a song that can be played on the provided audio system and loads the song from a file. More...
|
| |
| | Song (Reader reader) |
| | Constructs a song of the specified type that can be played on the provided audio system and loads the song data from a stream. More...
|
| |
| | ~Song () |
| |
| void | play (bool looping=false) |
| | Starts or resumes playback of the song. More...
|
| |
| void | pause () |
| | Pauses playback of the song. More...
|
| |
| bool | paused () const |
| | Returns true if the song is the current song, but in paused mode. More...
|
| |
| void | stop () |
| | Stops playback of this song if it is currently played or paused. More...
|
| |
| bool | playing () const |
| | Returns true if the song is currently playing. More...
|
| |
| double | volume () const |
| | Returns the current volume of the song. More...
|
| |
| void | changeVolume (double volume) |
| | Changes the volume of the song. More...
|
| |
| GOSU_DEPRECATED | Song (Audio &, const std::wstring &filename) |
| |
| GOSU_DEPRECATED | Song (Audio &, Type type, Reader reader) |
| |
|
| static Song * | currentSong () |
| | Returns the song currently being played or paused, or 0 if no song has been played yet or the last song has finished playing. More...
|
| |
| static void | update () |
| | Called every tick by Window for management purposes. More...
|
| |
Songs are less flexible than samples in that they can only be played one at a time and without panning or speed parameters.
Definition at line 107 of file Audio.hpp.
| Enumerator |
|---|
| stStream |
|
| stModule |
|
Definition at line 164 of file Audio.hpp.
| Gosu::Song::Song |
( |
const std::wstring & |
filename | ) |
|
|
explicit |
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.
| Gosu::Song::Song |
( |
Reader |
reader | ) |
|
|
explicit |
Constructs a song of the specified type that can be played on the provided audio system and loads the song data from a stream.
| void Gosu::Song::changeVolume |
( |
double |
volume | ) |
|
Changes the volume of the song.
| 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::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::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.
| bool Gosu::Song::playing |
( |
| ) |
const |
Returns true if the song is currently playing.
| void Gosu::Song::stop |
( |
| ) |
|
Stops playback of this song if it is currently played or paused.
Afterwards, currentSong will return 0.
| static void Gosu::Song::update |
( |
| ) |
|
|
static |
Called every tick by Window for management purposes.
| double Gosu::Song::volume |
( |
| ) |
const |
Returns the current volume of the song.
The documentation for this class was generated from the following file: