sound::SoundPlib::Sample Class Reference

Defines a sound sample. More...

List of all members.

Public Member Functions

 Sample (const string &filename, const fp volume=DEFAULT_VOLUME)
 ~Sample ()
void Play (const bool loop, const fp volume)
void Stop (void)
bool IfPlaying (void)
void SetVolume (const fp volume)
fp GetVolume (void)

Private Attributes

fp mVolume
 current volume (PLIB alters waveform data)
bool mLoop
 whether to repeat sample
slSample * mSLSample
 PLIB audio object.
string mBuf
 stored for changing volume


Detailed Description

Defines a sound sample.

Constructor & Destructor Documentation

sound::SoundPlib::Sample::Sample ( const string &  filename,
const fp  volume = DEFAULT_VOLUME 
)

Load sample from file.

Parameters:
filename gzipped audio file (eg crash.wav.gz).

sound::SoundPlib::Sample::~Sample (  ) 


Member Function Documentation

void sound::SoundPlib::Sample::Play ( const bool  loop,
const fp  volume 
)

Play sample.

void sound::SoundPlib::Sample::Stop ( void   ) 

Stop playing sample.

bool sound::SoundPlib::Sample::IfPlaying ( void   ) 

If sample is playing.

void sound::SoundPlib::Sample::SetVolume ( const fp  volume  ) 

Set volume of sample. NOTE: Stops the current sample, creates a new sample that won't be playing. SoundPlib::SetVolume() is supposed to play it afterwards.

Parameters:
volume 0.0 = off, 1.0 max volume.

fp sound::SoundPlib::Sample::GetVolume ( void   ) 


Member Data Documentation

current volume (PLIB alters waveform data)

whether to repeat sample

PLIB audio object.

stored for changing volume


The documentation for this class was generated from the following files:
Palomino Flight Simulator documents generated by doxygen 1.5.6 on Mon Dec 29 17:27:01 2008