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

Sample::play returns a Channel that represents the sound currently being played. More...

Public Member Functions

 Channel (int channel, int token)
 For internal use only. More...
 
int current_channel () const
 
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 set_volume (double volume)
 
void set_pan (double pan)
 
void set_speed (double speed)
 

Detailed Description

Sample::play returns a Channel that represents the sound currently being played.

This object can be used to stop sounds dynamically, or to check whether they have finished.

Definition at line 16 of file Audio.hpp.

Constructor & Destructor Documentation

◆ Channel()

Gosu::Channel::Channel ( int  channel,
int  token 
)

For internal use only.

Member Function Documentation

◆ current_channel()

int Gosu::Channel::current_channel ( ) const

◆ pause()

void Gosu::Channel::pause ( )

Pauses this instance to be resumed afterwards.

It will still occupy an audio channel while paused.

◆ paused()

bool Gosu::Channel::paused ( ) const

◆ playing()

bool Gosu::Channel::playing ( ) const

◆ resume()

void Gosu::Channel::resume ( )

◆ set_pan()

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

◆ set_speed()

void Gosu::Channel::set_speed ( double  speed)
Parameters
speedUse 1.0 for normal playback speed.

◆ set_volume()

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

◆ stop()

void Gosu::Channel::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: