TORCS  1.3.9
The Open Racing Car Simulator
PlibSoundInterface Class Reference

PLIB interface. More...

#include <SoundInterface.h>

Inheritance diagram for PlibSoundInterface:
Collaboration diagram for PlibSoundInterface:

Classes

struct  SoundChar_
 

Public Member Functions

 PlibSoundInterface (float sampling_rate, int n_channels)
 
virtual ~PlibSoundInterface ()
 
virtual void setNCars (int n_cars)
 
virtual slScheduler * getScheduler ()
 
virtual TorcsSoundaddSample (const char *filename, int flags=(ACTIVE_VOLUME|ACTIVE_PITCH), bool loop=false, bool static_pool=true)
 
virtual void update (CarSoundData **car_sound_data, int n_cars, sgVec3 p_obs, sgVec3 u_obs, sgVec3 c_obs=NULL, sgVec3 a_obs=NULL)
 
virtual float getGlobalGain ()
 
virtual void setGlobalGain (float g)
 
- Public Member Functions inherited from SoundInterface
 SoundInterface (float sampling_rate, int n_channels)
 Make a new sound interface. More...
 
virtual ~SoundInterface ()
 Destructor - does nothing. More...
 
virtual void initSharedSourcePool ()
 initialised the pool of shared sources More...
 
void setSkidSound (const char *sound_name)
 
void setRoadRideSound (const char *sound_name)
 
void setGrassRideSound (const char *sound_name)
 
void setCurbRideSound (const char *sound_name)
 
void setGrassSkidSound (const char *sound_name)
 
void setMetalSkidSound (const char *sound_name)
 
void setAxleSound (const char *sound_name)
 
void setTurboSound (const char *sound_name)
 
void setBackfireLoopSound (const char *sound_name)
 
void setCrashSound (const char *sound_name, int index)
 
void setBangSound (const char *sound_name)
 
void setBottomCrashSound (const char *sound_name)
 
void setBackfireSound (const char *sound_name)
 
void setGearChangeSound (const char *sound_name)
 
virtual void muteForMenu ()
 

Protected Member Functions

void DopplerShift (SoundChar *sound, float *p_src, float *u_src, float *p, float *u)
 
void SetMaxSoundCar (CarSoundData **car_sound_data, QueueSoundMap *smap)
 
- Protected Member Functions inherited from SoundInterface
void SortSingleQueue (CarSoundData **car_sound_data, QueueSoundMap *smap, int n_cars)
 Find the max amplitude sound in car_sound_data and put it in smap. More...
 
void SetMaxSoundCar (CarSoundData **car_sound_data, QueueSoundMap *smap)
 Using the smap->id, get the appropriate entry in car_sound_data and call apprioriate methods for smap->snd in order to play the sound. More...
 

Protected Attributes

slScheduler * sched
 
std::vector< TorcsSound * > sound_list
 
SoundPriengpri
 
SoundSourcecar_src
 
SoundSource tyre_src [4]
 
float global_gain
 
- Protected Attributes inherited from SoundInterface
float sampling_rate
 sampling rate More...
 
int n_channels
 number of channels More...
 
int n_engine_sounds
 number of simultaneous engines More...
 
int curCrashSnd
 holds current crash sound used - the sound cycles More...
 
TorcsSoundskid_sound [4]
 set of skid sounds, one per tyre More...
 
TorcsSoundroad_ride_sound
 rolling on normal road More...
 
TorcsSoundgrass_ride_sound
 rolling on dirt/grass More...
 
TorcsSoundcurb_ride_sound
 rolling on curb More...
 
TorcsSoundgrass_skid_sound
 skidding on dirt/grass More...
 
TorcsSoundmetal_skid_sound
 metal skidding on metal More...
 
TorcsSoundaxle_sound
 axle/gear spinning sound More...
 
TorcsSoundturbo_sound
 turbo spinning sound More...
 
TorcsSoundbackfire_loop_sound
 exhaust backfire sound More...
 
TorcsSoundcrash_sound [NB_CRASH_SOUND]
 list of crash sounds More...
 
TorcsSoundbang_sound
 sounds when suspension fully compressed More...
 
TorcsSoundbottom_crash_sound
 bang when crashing from a great height More...
 
TorcsSoundbackfire_sound
 one-off backfire sound More...
 
TorcsSoundgear_change_sound
 sound when changing gears More...
 
std::vector< TorcsSound * > sound_list
 keeps track of sounds used More...
 
SoundPriengpri
 the engine priority, used for sorting More...
 
QueueSoundMap road
 The following are mappings for sound prioritisation. More...
 
QueueSoundMap grass
 
QueueSoundMap grass_skid
 
QueueSoundMap curb
 
QueueSoundMap metal_skid
 
QueueSoundMap backfire_loop
 
QueueSoundMap turbo
 
QueueSoundMap axle
 

Private Types

typedef struct PlibSoundInterface::SoundChar_ SoundChar
 

Detailed Description

PLIB interface.

Definition at line 243 of file SoundInterface.h.

Member Typedef Documentation

◆ SoundChar

Constructor & Destructor Documentation

◆ PlibSoundInterface()

PlibSoundInterface::PlibSoundInterface ( float  sampling_rate,
int  n_channels 
)

Definition at line 26 of file PlibSoundInterface.cpp.

◆ ~PlibSoundInterface()

PlibSoundInterface::~PlibSoundInterface ( )
virtual

Definition at line 46 of file PlibSoundInterface.cpp.

Member Function Documentation

◆ addSample()

TorcsSound * PlibSoundInterface::addSample ( const char *  filename,
int  flags = (ACTIVE_VOLUME|ACTIVE_PITCH),
bool  loop = false,
bool  static_pool = true 
)
virtual

Implements SoundInterface.

Definition at line 71 of file PlibSoundInterface.cpp.

Here is the call graph for this function:

◆ DopplerShift()

void PlibSoundInterface::DopplerShift ( SoundChar sound,
float *  p_src,
float *  u_src,
float *  p,
float *  u 
)
protected

◆ getGlobalGain()

virtual float PlibSoundInterface::getGlobalGain ( )
inlinevirtual

Reimplemented from SoundInterface.

Definition at line 264 of file SoundInterface.h.

◆ getScheduler()

slScheduler * PlibSoundInterface::getScheduler ( )
virtual

Definition at line 66 of file PlibSoundInterface.cpp.

◆ setGlobalGain()

virtual void PlibSoundInterface::setGlobalGain ( float  g)
inlinevirtual

Reimplemented from SoundInterface.

Definition at line 265 of file SoundInterface.h.

◆ SetMaxSoundCar()

void PlibSoundInterface::SetMaxSoundCar ( CarSoundData **  car_sound_data,
QueueSoundMap smap 
)
protected

Definition at line 235 of file PlibSoundInterface.cpp.

Here is the call graph for this function:

◆ setNCars()

void PlibSoundInterface::setNCars ( int  n_cars)
virtual

Implements SoundInterface.

Definition at line 60 of file PlibSoundInterface.cpp.

◆ update()

void PlibSoundInterface::update ( CarSoundData **  car_sound_data,
int  n_cars,
sgVec3  p_obs,
sgVec3  u_obs,
sgVec3  c_obs = NULL,
sgVec3  a_obs = NULL 
)
virtual

Reimplemented from SoundInterface.

Definition at line 79 of file PlibSoundInterface.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ car_src

SoundSource* PlibSoundInterface::car_src
protected

Definition at line 252 of file SoundInterface.h.

◆ engpri

SoundPri* PlibSoundInterface::engpri
protected

Definition at line 251 of file SoundInterface.h.

◆ global_gain

float PlibSoundInterface::global_gain
protected

Definition at line 256 of file SoundInterface.h.

◆ sched

slScheduler* PlibSoundInterface::sched
protected

Definition at line 249 of file SoundInterface.h.

◆ sound_list

std::vector<TorcsSound*> PlibSoundInterface::sound_list
protected

Definition at line 250 of file SoundInterface.h.

◆ tyre_src

SoundSource PlibSoundInterface::tyre_src[4]
protected

Definition at line 253 of file SoundInterface.h.


The documentation for this class was generated from the following files: