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