83 virtual void play() = 0;
84 virtual void start() = 0;
85 virtual void stop() = 0;
87 virtual void pause() = 0;
105 const char* filename,
113 virtual void start();
116 virtual void pause();
190 virtual void start();
193 virtual void pause();
virtual void setVolume(float vol)
Set the volume.
virtual void setLPFilter(float lp)
virtual void stop()
Stop the sample.
SoundSource()
Create a sound source.
bool static_pool
dynamic or static source assignment?
ALfloat MAX_DISTANCE_LOW
maximum allowed distance
sgVec3 u_src
source velocity;
TorcsSound(int flags=(ACTIVE_VOLUME|ACTIVE_PITCH))
Consruct a sound.
virtual void setLPFilter(float lp)
Set the filter.
void update()
Calculate environmental parameters for current situation.
virtual bool isPlaying()=0
slEnvelope * volume_env
volume envelope
virtual void update()
Update the plib sounds.
virtual void setPitch(float pitch)
Set the pitch.
slSample * sample
sample data
virtual bool isPlaying()
Return true if playing.
bool loop
Whether it's a looping sound.
virtual void setVolume(float vol)
void setSource(sgVec3 p, sgVec3 u)
Set source position and velocity.
int flags
Flags relating to what effects are to be used.
slScheduler * sched
plib sl scheduler (see sl.h)
virtual bool isPaused()
Return true if paused.
ALfloat ROLLOFF_FACTOR
how fast we need to roll off
ALfloat REFERENCE_DISTANCE
reference distance for sound
OpenalTorcsSound(const char *filename, OpenalSoundInterface *sitf, int flags=(ACTIVE_VOLUME|ACTIVE_PITCH), bool loop=false, bool static_pool=true)
Create a new torcs sound.
slEnvelope * pitch_env
pitch envelope
int poolindex
which pool the sound is assigned to
ALfloat front[6]
direction of front
virtual void setSource(sgVec3 p, sgVec3 u)
sgVec3 p_src
source position
void setListener(sgVec3 p, sgVec3 u)
Set listener position and velocity.
PLIB-specific torcs sound.
float f
Environmental frequency shift.
virtual void play()
Start the sample.
slEnvelope * lowpass_env
low pass filter envelope
PlibTorcsSound(slScheduler *sched, const char *filename, int flags=(ACTIVE_VOLUME|ACTIVE_PITCH), bool loop=false)
Create a new PLib sound.
float a
Environmental attenuation.
sgVec3 p_lis
listener position for this source
class SoundInterface * iface
Handler to the interface.
virtual void setVolume(float vol)
Set the volume.
ALfloat MAX_DISTANCE
maximum allowed distance
virtual void setReferenceDistance(float dist)
virtual void resume()
Resume a paused sample.
bool playing
Sound is playing.
float volume
Current volume.
virtual bool isPaused()
Truye if the sound is paused.
virtual void start()
Start the sample.
sgVec3 u_lis
listener velocity for this source
ALfloat back[6]
direction of back
float MAX_VOL
Maximum volume.
virtual void setPitch(float pitch)
bool is_enabled
is it available at all?
ALfloat source_velocity[3]
source velocity
virtual float getLPfilter()
float pitch
Current pitch.
float lowpass
Current low pass filter.
ALfloat source_position[3]
source position
float lp
Environmental filtering.
virtual void pause()
Pause a sample.
virtual void setSource(sgVec3 p, sgVec3 u)
virtual ~OpenalTorcsSound()
OpenalSoundInterface * itf
Handle to the interface.
virtual void getSource(sgVec3 p, sgVec3 u)
virtual ~TorcsSound()
Destructor.
virtual bool isPaused()=0
virtual bool isPlaying()
True if the sound is playing.
virtual void getSource(sgVec3 p, sgVec3 u)
bool paused
sound is paused
ALfloat zeroes[3]
just a vector of 0s
virtual float getVolume()
virtual void setReferenceDistance(float dist)
virtual ~PlibTorcsSound()
Destructor.