A generic TORCS sound. More...
#include <TorcsSound.h>


Public Member Functions | |
| TorcsSound (int flags=(ACTIVE_VOLUME|ACTIVE_PITCH)) | |
| Consruct a sound. More... | |
| virtual | ~TorcsSound () |
| Destructor. More... | |
| virtual void | setVolume (float vol) |
| Set the volume. 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) |
| virtual void | play ()=0 |
| virtual void | start ()=0 |
| virtual void | stop ()=0 |
| virtual void | resume ()=0 |
| virtual void | pause ()=0 |
| virtual void | update ()=0 |
| virtual bool | isPlaying ()=0 |
| virtual bool | isPaused ()=0 |
Protected Attributes | |
| 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... | |
A generic TORCS sound.
The aim is to have a more or less identical interface to sounds, no matter what the backend is. In practice, there are some minor differences across interfaces. In particular, for Plib sounds, setting pitch and volume actually sets the pitch/volume of the sound that we are listening at, while for Openal sounds, it sets only the pitch/volume of the source sound. Thus, the interface is not consistent across backends. Making it consistent is not easily doable because some things simply work too differently. Currently I have traded complexity in TorcsSound for replicating some code in the two SoundInterface implementatins: OpenalSoundInterface and PlibSoundInterface both take into account the individual pecularities of each PlibTorcsSound and OpenalTorcsSound. However, if it is deemed necessary later on, it is possible to make the interface consistent.
Definition at line 53 of file TorcsSound.h.
|
inline |
Consruct a sound.
Definition at line 64 of file TorcsSound.h.
|
inlinevirtual |
Destructor.
Definition at line 72 of file TorcsSound.h.
|
inlinevirtual |
Definition at line 79 of file TorcsSound.h.
|
inlinevirtual |
Definition at line 78 of file TorcsSound.h.
|
inlinevirtual |
Reimplemented in OpenalTorcsSound.
Definition at line 81 of file TorcsSound.h.
|
inlinevirtual |
Definition at line 77 of file TorcsSound.h.
|
pure virtual |
Implemented in OpenalTorcsSound, and PlibTorcsSound.
|
pure virtual |
Implemented in OpenalTorcsSound, and PlibTorcsSound.
|
pure virtual |
Implemented in OpenalTorcsSound, and PlibTorcsSound.
|
pure virtual |
Implemented in OpenalTorcsSound, and PlibTorcsSound.
|
pure virtual |
Implemented in OpenalTorcsSound, and PlibTorcsSound.
|
virtual |
Set the filter.
Reimplemented in OpenalTorcsSound.
Definition at line 35 of file TorcsSound.cpp.
|
virtual |
Set the pitch.
Reimplemented in OpenalTorcsSound.
Definition at line 30 of file TorcsSound.cpp.
|
inlinevirtual |
Reimplemented in OpenalTorcsSound.
Definition at line 80 of file TorcsSound.h.
|
inlinevirtual |
Reimplemented in OpenalTorcsSound.
Definition at line 76 of file TorcsSound.h.
|
virtual |
Set the volume.
Reimplemented in OpenalTorcsSound, and PlibTorcsSound.
Definition at line 25 of file TorcsSound.cpp.
|
pure virtual |
Implemented in OpenalTorcsSound, and PlibTorcsSound.
|
pure virtual |
Implemented in OpenalTorcsSound, and PlibTorcsSound.
|
pure virtual |
Implemented in OpenalTorcsSound, and PlibTorcsSound.
|
protected |
Flags relating to what effects are to be used.
Definition at line 56 of file TorcsSound.h.
|
protected |
Handler to the interface.
Definition at line 55 of file TorcsSound.h.
|
protected |
Whether it's a looping sound.
Definition at line 61 of file TorcsSound.h.
|
protected |
Current low pass filter.
Definition at line 60 of file TorcsSound.h.
|
protected |
Maximum volume.
Definition at line 57 of file TorcsSound.h.
|
protected |
Current pitch.
Definition at line 59 of file TorcsSound.h.
|
protected |
Current volume.
Definition at line 58 of file TorcsSound.h.