#include <snd_plib.hh>

Public Member Functions | |
| CLASS_METHOD SoundPlib & | GetInstance (void) |
| CLASS_METHOD void | Disable (void) |
| void | Play (const string &filename, const bool loop, const fp volume=DEFAULT_VOLUME) |
| void | Stop (const string &filename) |
| void | SetVolume (const string &filename, const fp volume) |
Private Types | |
| typedef map< string, SharedPtr< Sample > > | SampleMap |
Private Member Functions | |
| SoundPlib (void) | |
| ~SoundPlib () | |
| void | Pulse (void) |
| void | EnqueueZombieSample (slSample *zombie) |
Private Attributes | |
| CLASS_VAR SoundPlib * | msInstance |
| CLASS_VAR bool | msEnabled = true |
| for permanently disabling sound | |
| SampleMap | mSampleMap |
| to load a sound file once but play it multiple times | |
| slScheduler * | mSched |
| PLIB. | |
| smMixer * | mMixer |
| PLIB. | |
| set< slSample * > | mZombieSamples |
| samples that were discarded after changing volume (yuck) | |
Friends | |
| class | ListenerTick |
Classes | |
| struct | ListenerTick |
| class | Sample |
| Defines a sound sample. More... | |
Sounds are identified/keyed by filename.
Gory details of PLIB code is better structured by making Sample mostly private to Sound, but letting Sample have full access to Sound.
typedef map<string,SharedPtr<Sample> > snd::SoundPlib::SampleMap [private] |
| snd::SoundPlib::SoundPlib | ( | void | ) | [private] |
ctor/dtor.
| snd::SoundPlib::~SoundPlib | ( | ) | [private] |
| SoundPlib & snd::SoundPlib::GetInstance | ( | void | ) |
Singleton method.
Reimplemented from snd::SoundAbstract.
| void snd::SoundPlib::Disable | ( | void | ) |
Enable() is omitted. If Disable() is ever called, it should be done during startup, before SoundPlib::GetInstance() is called.
Reimplemented from snd::SoundAbstract.
| void snd::SoundPlib::Play | ( | const string & | filename, | |
| const bool | loop, | |||
| const fp | volume = DEFAULT_VOLUME | |||
| ) | [virtual] |
Play audio file.
| filename | Identifies sound file. | |
| loop | Play continuously. | |
| volume | Default is DEFAULT_VOLUME. |
Reimplemented from snd::SoundAbstract.
| void snd::SoundPlib::Stop | ( | const string & | filename | ) | [virtual] |
Stop playing sample.
Reimplemented from snd::SoundAbstract.
| void snd::SoundPlib::SetVolume | ( | const string & | filename, | |
| const fp | volume | |||
| ) | [virtual] |
Set volume of sample.
| volume | 0.0 = off, 1.0 max volume. |
Reimplemented from snd::SoundAbstract.
| void snd::SoundPlib::Pulse | ( | void | ) | [private] |
| void snd::SoundPlib::EnqueueZombieSample | ( | slSample * | zombie | ) | [private] |
Enqueue a zombie sample (possibly still playing).
friend class ListenerTick [friend] |
SoundPlib * snd::SoundPlib::msInstance [private] |
bool snd::SoundPlib::msEnabled = true [private] |
for permanently disabling sound
SampleMap snd::SoundPlib::mSampleMap [private] |
to load a sound file once but play it multiple times
slScheduler* snd::SoundPlib::mSched [private] |
PLIB.
smMixer* snd::SoundPlib::mMixer [private] |
PLIB.
set<slSample*> snd::SoundPlib::mZombieSamples [private] |
samples that were discarded after changing volume (yuck)
Palomino 3D Engine documents generated by doxygen 1.5.3 on Fri Nov 23 11:26:32 2007