Gosu::SampleInstance Class Reference

An instance of a Sample playing. More...

Public Member Functions

 SampleInstance (int handle, int extra)
 Called by Sample, do not use. More...
 
bool playing () const
 
bool paused () const
 
void pause ()
 Pauses this instance to be resumed afterwards. It will still keep a channel filled while paused. More...
 
void resume ()
 
void stop ()
 Stops this instance of a sound being played. More...
 
void changeVolume (double volume)
 
void changePan (double pan)
 
void changeSpeed (double speed)
 

Detailed Description

An instance of a Sample playing.

Can be used to stop sounds dynamically, or to check if they are finished. It is recommended that you throw away sample instances if possible, as they could accidentally refer to other sounds being played after a very long time has passed.

Definition at line 32 of file Audio.hpp.

Constructor & Destructor Documentation

Gosu::SampleInstance::SampleInstance ( int  handle,
int  extra 
)

Called by Sample, do not use.

Member Function Documentation

void Gosu::SampleInstance::changePan ( double  pan)
Parameters
panCan be anything from -1.0 (left) to 1.0 (right).
void Gosu::SampleInstance::changeSpeed ( double  speed)
Parameters
speedPlayback speed is only limited by FMOD's capabilities and can accept very high or low values. Use 1.0 for normal playback speed.
void Gosu::SampleInstance::changeVolume ( double  volume)
Parameters
volumeCan be anything from 0.0 (silence) to 1.0 (full volume).
void Gosu::SampleInstance::pause ( )

Pauses this instance to be resumed afterwards. It will still keep a channel filled while paused.

bool Gosu::SampleInstance::paused ( ) const
bool Gosu::SampleInstance::playing ( ) const
void Gosu::SampleInstance::resume ( )
void Gosu::SampleInstance::stop ( )

Stops this instance of a sound being played.

Calling this twice, or too late, does not do any harm.


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