Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

ONE::sound::AudioDevice Class Reference

Inheritance diagram for ONE::sound::AudioDevice:

Inheritance graph
[legend]
List of all members.

Detailed Description

handles loading of music files

This class and its helpers are based on the G3D::AudioDevice class maintained by Morgan McGuire.

Author:
Daniel Seibert


Public Member Functions

 AudioDevice ()
void cleanup ()
MusicStreamRef createMusicStream (const std::string &filename)
SoundEffectRef createSoundEffect (const std::string &filename)
int getChannels () const
 returns the number of channels, 1 for mono, 2 for stereo
G3D::uint16 getFormat () const
 returns the audio format
int getRate () const
 returns the audio rate in samples per second
bool init ()
void pauseChannel (int channel)
 pauses playback of the given channel
void pauseMusic ()
 pauses music playback
void resumeChannel (int channel)
 resumes playback of the given channel
void resumeMusic ()
 resumes music playback
void setEffectVolume (int channel, float vol)
 sets the volume of the given channel to the given ratio
void setMusicVolume (float vol)
 sets the music volume
void stopChannel (int channel)
 stops playback of the given channel
void stopMusic ()
 stops music playback


Constructor & Destructor Documentation

ONE::sound::AudioDevice::AudioDevice  ) 
 


Member Function Documentation

void ONE::sound::AudioDevice::cleanup  ) 
 

MusicStreamRef ONE::sound::AudioDevice::createMusicStream const std::string &  filename  ) 
 

SoundEffectRef ONE::sound::AudioDevice::createSoundEffect const std::string &  filename  ) 
 

int ONE::sound::AudioDevice::getChannels  )  const [inline]
 

returns the number of channels, 1 for mono, 2 for stereo

G3D::uint16 ONE::sound::AudioDevice::getFormat  )  const [inline]
 

returns the audio format

int ONE::sound::AudioDevice::getRate  )  const [inline]
 

returns the audio rate in samples per second

bool ONE::sound::AudioDevice::init  ) 
 

void ONE::sound::AudioDevice::pauseChannel int  channel  ) 
 

pauses playback of the given channel

Parameters:
channel the channel that should be paused or -1 to pause all channels

void ONE::sound::AudioDevice::pauseMusic  ) 
 

pauses music playback

void ONE::sound::AudioDevice::resumeChannel int  channel  ) 
 

resumes playback of the given channel

Parameters:
channel the channel that should be resumed or -1 to resume all channels

void ONE::sound::AudioDevice::resumeMusic  ) 
 

resumes music playback

void ONE::sound::AudioDevice::setEffectVolume int  channel,
float  vol
 

sets the volume of the given channel to the given ratio

Parameters:
channel the channel whose volume should be changed or -1 to control all channels
vol the new volume, 0.0 being muted and 1.0 the maximum volume

void ONE::sound::AudioDevice::setMusicVolume float  vol  ) 
 

sets the music volume

Parameters:
vol the new volume, 0.0 being muted and 1.0 the maximum volume

void ONE::sound::AudioDevice::stopChannel int  channel  ) 
 

stops playback of the given channel

Parameters:
channel the channel that should be stopped or -1 to stop all effects

void ONE::sound::AudioDevice::stopMusic  ) 
 

stops music playback


Generated on Wed Sep 7 19:03:30 2005 for ONEngine by  doxygen 1.4.3