PLIB-specific torcs sound. More...
#include <TorcsSound.h>


Public Member Functions | |
| PlibTorcsSound (slScheduler *sched, const char *filename, int flags=(ACTIVE_VOLUME|ACTIVE_PITCH), bool loop=false) | |
| Create a new PLib sound. More... | |
| virtual | ~PlibTorcsSound () |
| Destructor. More... | |
| virtual void | setVolume (float vol) |
| Set the volume. More... | |
| virtual void | play () |
| Start the sample. More... | |
| virtual void | start () |
| Start the sample. More... | |
| virtual void | stop () |
| Stop the sample. More... | |
| virtual void | resume () |
| Resume a paused sample. More... | |
| virtual void | pause () |
| Pause a sample. More... | |
| virtual void | update () |
| Update the plib sounds. More... | |
| virtual bool | isPlaying () |
| True if the sound is playing. More... | |
| virtual bool | isPaused () |
| Truye if the sound is paused. More... | |
Public Member Functions inherited from TorcsSound | |
| TorcsSound (int flags=(ACTIVE_VOLUME|ACTIVE_PITCH)) | |
| Consruct a sound. More... | |
| virtual | ~TorcsSound () |
| Destructor. More... | |
| virtual void | setPitch (float pitch) |
| Set the pitch. More... | |
| virtual void | setLPFilter (float lp) |
| Set the filter. More... | |
| virtual void | setSource (sgVec3 p, sgVec3 u) |
| virtual float | getVolume () |
| virtual float | getPitch () |
| virtual float | getLPfilter () |
| virtual void | setReferenceDistance (float dist) |
| virtual void | getSource (sgVec3 p, sgVec3 u) |
Protected Attributes | |
| slSample * | sample |
| sample data More... | |
| slEnvelope * | volume_env |
| volume envelope More... | |
| slEnvelope * | pitch_env |
| pitch envelope More... | |
| slEnvelope * | lowpass_env |
| low pass filter envelope More... | |
| slScheduler * | sched |
| plib sl scheduler (see sl.h) More... | |
| bool | playing |
| Sound is playing. More... | |
| bool | paused |
| sound is paused More... | |
Protected Attributes inherited from TorcsSound | |
| class SoundInterface * | iface |
| Handler to the interface. More... | |
| int | flags |
| Flags relating to what effects are to be used. More... | |
| float | MAX_VOL |
| Maximum volume. More... | |
| float | volume |
| Current volume. More... | |
| float | pitch |
| Current pitch. More... | |
| float | lowpass |
| Current low pass filter. More... | |
| bool | loop |
| Whether it's a looping sound. More... | |
PLIB-specific torcs sound.
Definition at line 94 of file TorcsSound.h.
| PlibTorcsSound::PlibTorcsSound | ( | slScheduler * | sched, |
| const char * | filename, | ||
| int | flags = (ACTIVE_VOLUME|ACTIVE_PITCH), |
||
| bool | loop = false |
||
| ) |
Create a new PLib sound.
It requires a scheduler to be set up and a filename to read data from.
Definition at line 42 of file TorcsSound.cpp.
|
virtual |
Destructor.
Definition at line 93 of file TorcsSound.cpp.
|
inlinevirtual |
|
inlinevirtual |
|
virtual |
|
virtual |
Start the sample.
Implements TorcsSound.
Definition at line 129 of file TorcsSound.cpp.

|
virtual |
|
virtual |
Set the volume.
Since plib does not support envelopes for one-shot samples, we pre-adjust their volume
Reimplemented from TorcsSound.
Definition at line 117 of file TorcsSound.cpp.
|
virtual |
|
virtual |
|
virtual |
Update the plib sounds.
This should be called as often as possible from the main sound code, probably by looping through all the sounds used.
Implements TorcsSound.
Definition at line 174 of file TorcsSound.cpp.
|
protected |
low pass filter envelope
Definition at line 99 of file TorcsSound.h.
|
protected |
sound is paused
Definition at line 102 of file TorcsSound.h.
|
protected |
pitch envelope
Definition at line 98 of file TorcsSound.h.
|
protected |
Sound is playing.
Definition at line 101 of file TorcsSound.h.
|
protected |
sample data
Definition at line 96 of file TorcsSound.h.
|
protected |
plib sl scheduler (see sl.h)
Definition at line 100 of file TorcsSound.h.
|
protected |
volume envelope
Definition at line 97 of file TorcsSound.h.