67 std::tr1::shared_ptr<SampleData> data;
72 explicit Sample(
const std::wstring& filename);
85 bool looping =
false)
const;
97 bool looping =
false)
const;
112 GOSU_UNIQUE_PTR<BaseData> data;
114 #if defined(GOSU_CPP11_ENABLED)
118 Song& operator=(
const Song&) =
delete;
128 explicit Song(
const std::wstring& filename);
143 void play(
bool looping =
false);
Includes all parts of C++03 (TR1) that are relevant for Gosu.
static void update()
Called every tick by Window for management purposes.
void pause()
Pauses playback of the song.
bool paused() const
Returns true if the song is the current song, but in paused mode.
double volume() const
Returns the current volume of the song.
Contains declarations of all of Gosu's available classes.
SampleInstance(int handle, int extra)
Called by Sample, do not use.
SampleInstance playPan(double pan, double volume=1, double speed=1, bool looping=false) const
Plays the sample with panning.
static Song * currentSong()
Returns the song currently being played or paused, or 0 if no song has been played yet or the last so...
An instance of a Sample playing.
void changeVolume(double volume)
void changePan(double pan)
Utility class that points to a specific position in a resource and offers an interface for sequential...
Sample(const std::wstring &filename)
Constructs a sample that can be played on the specified audio system and loads the sample from a file...
class GOSU_DEPRECATED Audio
void play(bool looping=false)
Starts or resumes playback of the song.
Songs are less flexible than samples in that they can only be played one at a time and without pannin...
A sample is a short sound that is completely loaded in memory, can be played multiple times at once a...
SampleInstance play(double volume=1, double speed=1, bool looping=false) const
Plays the sample without panning.
bool playing() const
Returns true if the song is currently playing.
void changeSpeed(double speed)
void changeVolume(double volume)
Changes the volume of the song.
void pause()
Pauses this instance to be resumed afterwards. It will still keep a channel filled while paused...
Contains everything related to input and output.
void stop()
Stops this instance of a sound being played.
void stop()
Stops playback of this song if it is currently played or paused.