Gosu
Public Member Functions | List of all members
Gosu::SampleInstance Class Reference

An instance of a Sample playing. More...

Public Member Functions

 SampleInstance (int handle, int extra)
 Called internally by Sample, do not use. More...
 
bool playing () const
 
bool paused () const
 
void pause ()
 Pauses this instance to be resumed afterwards. More...
 
void resume ()
 
void stop ()
 Stops this instance of a sound being played. More...
 
void change_volume (double volume)
 
void change_pan (double pan)
 
void change_speed (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 19 of file Audio.hpp.

Constructor & Destructor Documentation

◆ SampleInstance()

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

Called internally by Sample, do not use.

Member Function Documentation

◆ change_pan()

void Gosu::SampleInstance::change_pan ( double  pan)
Parameters
panCan be anything from -1.0 (left) to 1.0 (right).

◆ change_speed()

void Gosu::SampleInstance::change_speed ( 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.

◆ change_volume()

void Gosu::SampleInstance::change_volume ( double  volume)
Parameters
volumeCan be anything from 0.0 (silence) to 1.0 (full volume).

◆ pause()

void Gosu::SampleInstance::pause ( )

Pauses this instance to be resumed afterwards.

It will still keep a channel filled while paused.

◆ paused()

bool Gosu::SampleInstance::paused ( ) const

◆ playing()

bool Gosu::SampleInstance::playing ( ) const

◆ resume()

void Gosu::SampleInstance::resume ( )

◆ stop()

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: