TORCS  1.3.10
The Open Racing Car Simulator
Loading...
Searching...
No Matches
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 TorcsSound * addSample (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.
virtual ~SoundInterface ()
 Destructor - does nothing.
virtual void initSharedSourcePool ()
 initialised the pool of shared sources
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.
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.

Protected Attributes

slScheduler * sched
std::vector< TorcsSound * > sound_list
SoundPri * engpri
SoundSource * car_src
SoundSource tyre_src [4]
float global_gain
Protected Attributes inherited from SoundInterface
float sampling_rate
 sampling rate
int n_channels
 number of channels
int n_engine_sounds
 number of simultaneous engines
int curCrashSnd
 holds current crash sound used - the sound cycles
TorcsSound * skid_sound [4]
 set of skid sounds, one per tyre
TorcsSound * road_ride_sound
 rolling on normal road
TorcsSound * grass_ride_sound
 rolling on dirt/grass
TorcsSound * curb_ride_sound
 rolling on curb
TorcsSound * grass_skid_sound
 skidding on dirt/grass
TorcsSound * metal_skid_sound
 metal skidding on metal
TorcsSound * axle_sound
 axle/gear spinning sound
TorcsSound * turbo_sound
 turbo spinning sound
TorcsSound * backfire_loop_sound
 exhaust backfire sound
TorcsSound * crash_sound [NB_CRASH_SOUND]
 list of crash sounds
TorcsSound * bang_sound
 sounds when suspension fully compressed
TorcsSound * bottom_crash_sound
 bang when crashing from a great height
TorcsSound * backfire_sound
 one-off backfire sound
TorcsSound * gear_change_sound
 sound when changing gears
std::vector< TorcsSound * > sound_list
 keeps track of sounds used
SoundPri * engpri
 the engine priority, used for sorting
QueueSoundMap road
 The following are mappings for sound prioritisation.
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.

Here is the call graph for this function:

◆ ~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:
  • C:/Users/berni/Development/torcs_git/torcs-code/torcs/torcs/src/modules/graphic/ssggraph/SoundInterface.h
  • C:/Users/berni/Development/torcs_git/torcs-code/torcs/torcs/src/modules/graphic/ssggraph/PlibSoundInterface.cpp