Gosu::Song Class Reference

Songs are less flexible than samples in that they can only be played one at a time and without panning or speed parameters. More...

List of all members.

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 SongcurrentSong ()


Detailed Description

Songs are less flexible than samples in that they can only be played one at a time and without panning or speed parameters.


Member Enumeration Documentation

There are two types of songs that can be loaded as a Song: Streamed songs (like OGG) and modules (like MOD or XM).


Constructor & Destructor Documentation

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.

Gosu::Song::Song ( Audio ,
Type  type,
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.


Member Function Documentation

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.


The documentation for this class was generated from the following file:

Generated on Fri Apr 17 23:35:43 2009 for Gosu by  doxygen 1.5.5