TORCS  1.3.10
The Open Racing Car Simulator
Loading...
Searching...
No Matches
OpenalTorcsSound Class Reference

Openal torcs sound. More...

#include <TorcsSound.h>

Inheritance diagram for OpenalTorcsSound:
Collaboration diagram for OpenalTorcsSound:

Public Member Functions

 OpenalTorcsSound (const char *filename, OpenalSoundInterface *sitf, int flags=(ACTIVE_VOLUME|ACTIVE_PITCH), bool loop=false, bool static_pool=true)
 Create a new torcs sound.
virtual ~OpenalTorcsSound ()
virtual void setVolume (float vol)
virtual void setPitch (float pitch)
virtual void setLPFilter (float lp)
virtual void setSource (sgVec3 p, sgVec3 u)
virtual void getSource (sgVec3 p, sgVec3 u)
virtual void setReferenceDistance (float dist)
virtual void play ()
virtual void start ()
virtual void stop ()
virtual void resume ()
virtual void pause ()
virtual void update ()
virtual bool isPlaying ()
 Return true if playing.
virtual bool isPaused ()
 Return true if paused.
Public Member Functions inherited from TorcsSound
 TorcsSound (int flags=(ACTIVE_VOLUME|ACTIVE_PITCH))
 Consruct a sound.
virtual ~TorcsSound ()
 Destructor.
virtual float getVolume ()
virtual float getPitch ()
virtual float getLPfilter ()

Protected Attributes

ALuint buffer
 buffer id
ALuint source
 source id
ALfloat source_position [3]
 source position
ALfloat source_velocity [3]
 source velocity
ALfloat zeroes [3]
 just a vector of 0s
ALfloat back [6]
 direction of back
ALfloat front [6]
 direction of front
bool playing
bool paused
ALfloat MAX_DISTANCE
 maximum allowed distance
ALfloat MAX_DISTANCE_LOW
 maximum allowed distance
ALfloat REFERENCE_DISTANCE
 reference distance for sound
ALfloat ROLLOFF_FACTOR
 how fast we need to roll off
int poolindex
 which pool the sound is assigned to
OpenalSoundInterface * itf
 Handle to the interface.
bool static_pool
 dynamic or static source assignment?
bool is_enabled
 is it available at all?
Protected Attributes inherited from TorcsSound
class SoundInterface * iface
 Handler to the interface.
int flags
 Flags relating to what effects are to be used.
float MAX_VOL
 Maximum volume.
float volume
 Current volume.
float pitch
 Current pitch.
float lowpass
 Current low pass filter.
bool loop
 Whether it's a looping sound.

Detailed Description

Openal torcs sound.

Definition at line 158 of file TorcsSound.h.

Constructor & Destructor Documentation

◆ OpenalTorcsSound()

OpenalTorcsSound::OpenalTorcsSound ( const char * filename,
OpenalSoundInterface * sitf,
int flags = (ACTIVE_VOLUME|ACTIVE_PITCH),
bool loop = false,
bool static_pool = true )

Create a new torcs sound.

Definition at line 285 of file TorcsSound.cpp.

Here is the call graph for this function:

◆ ~OpenalTorcsSound()

OpenalTorcsSound::~OpenalTorcsSound ( )
virtual

Definition at line 424 of file TorcsSound.cpp.

Member Function Documentation

◆ getSource()

void OpenalTorcsSound::getSource ( sgVec3 p,
sgVec3 u )
virtual

Reimplemented from TorcsSound.

Definition at line 475 of file TorcsSound.cpp.

◆ isPaused()

virtual bool OpenalTorcsSound::isPaused ( )
inlinevirtual

Return true if paused.

Implements TorcsSound.

Definition at line 201 of file TorcsSound.h.

◆ isPlaying()

virtual bool OpenalTorcsSound::isPlaying ( )
inlinevirtual

Return true if playing.

Implements TorcsSound.

Definition at line 196 of file TorcsSound.h.

◆ pause()

void OpenalTorcsSound::pause ( )
virtual

Implements TorcsSound.

Definition at line 556 of file TorcsSound.cpp.

◆ play()

void OpenalTorcsSound::play ( )
virtual

Implements TorcsSound.

Definition at line 484 of file TorcsSound.cpp.

Here is the call graph for this function:

◆ resume()

void OpenalTorcsSound::resume ( )
virtual

Implements TorcsSound.

Definition at line 548 of file TorcsSound.cpp.

◆ setLPFilter()

void OpenalTorcsSound::setLPFilter ( float lp)
virtual

Reimplemented from TorcsSound.

Definition at line 445 of file TorcsSound.cpp.

◆ setPitch()

void OpenalTorcsSound::setPitch ( float pitch)
virtual

Reimplemented from TorcsSound.

Definition at line 440 of file TorcsSound.cpp.

◆ setReferenceDistance()

void OpenalTorcsSound::setReferenceDistance ( float dist)
virtual

Reimplemented from TorcsSound.

Definition at line 451 of file TorcsSound.cpp.

◆ setSource()

void OpenalTorcsSound::setSource ( sgVec3 p,
sgVec3 u )
virtual

Reimplemented from TorcsSound.

Definition at line 466 of file TorcsSound.cpp.

◆ setVolume()

void OpenalTorcsSound::setVolume ( float vol)
virtual

Reimplemented from TorcsSound.

Definition at line 435 of file TorcsSound.cpp.

◆ start()

void OpenalTorcsSound::start ( )
virtual

Implements TorcsSound.

Definition at line 489 of file TorcsSound.cpp.

◆ stop()

void OpenalTorcsSound::stop ( )
virtual

Implements TorcsSound.

Definition at line 528 of file TorcsSound.cpp.

◆ update()

void OpenalTorcsSound::update ( )
virtual

Implements TorcsSound.

Definition at line 563 of file TorcsSound.cpp.

Member Data Documentation

◆ back

ALfloat OpenalTorcsSound::back[6]
protected

direction of back

Definition at line 165 of file TorcsSound.h.

◆ buffer

ALuint OpenalTorcsSound::buffer
protected

buffer id

Definition at line 160 of file TorcsSound.h.

◆ front

ALfloat OpenalTorcsSound::front[6]
protected

direction of front

Definition at line 166 of file TorcsSound.h.

◆ is_enabled

bool OpenalTorcsSound::is_enabled
protected

is it available at all?

Definition at line 175 of file TorcsSound.h.

◆ itf

OpenalSoundInterface* OpenalTorcsSound::itf
protected

Handle to the interface.

Definition at line 173 of file TorcsSound.h.

◆ MAX_DISTANCE

ALfloat OpenalTorcsSound::MAX_DISTANCE
protected

maximum allowed distance

Definition at line 168 of file TorcsSound.h.

◆ MAX_DISTANCE_LOW

ALfloat OpenalTorcsSound::MAX_DISTANCE_LOW
protected

maximum allowed distance

Definition at line 169 of file TorcsSound.h.

◆ paused

bool OpenalTorcsSound::paused
protected

Definition at line 167 of file TorcsSound.h.

◆ playing

bool OpenalTorcsSound::playing
protected

Definition at line 167 of file TorcsSound.h.

◆ poolindex

int OpenalTorcsSound::poolindex
protected

which pool the sound is assigned to

Definition at line 172 of file TorcsSound.h.

◆ REFERENCE_DISTANCE

ALfloat OpenalTorcsSound::REFERENCE_DISTANCE
protected

reference distance for sound

Definition at line 170 of file TorcsSound.h.

◆ ROLLOFF_FACTOR

ALfloat OpenalTorcsSound::ROLLOFF_FACTOR
protected

how fast we need to roll off

Definition at line 171 of file TorcsSound.h.

◆ source

ALuint OpenalTorcsSound::source
protected

source id

Definition at line 161 of file TorcsSound.h.

◆ source_position

ALfloat OpenalTorcsSound::source_position[3]
protected

source position

Definition at line 162 of file TorcsSound.h.

◆ source_velocity

ALfloat OpenalTorcsSound::source_velocity[3]
protected

source velocity

Definition at line 163 of file TorcsSound.h.

◆ static_pool

bool OpenalTorcsSound::static_pool
protected

dynamic or static source assignment?

Definition at line 174 of file TorcsSound.h.

◆ zeroes

ALfloat OpenalTorcsSound::zeroes[3]
protected

just a vector of 0s

Definition at line 164 of file TorcsSound.h.


The documentation for this class was generated from the following files:
  • C:/Users/berni/Development/torcs_git/torcs-code/torcs/torcs/src/modules/graphic/ssggraph/TorcsSound.h
  • C:/Users/berni/Development/torcs_git/torcs-code/torcs/torcs/src/modules/graphic/ssggraph/TorcsSound.cpp