Main control for any streaming sound output device. More...
#include "s_local.h"
#include "s_sample.h"
Go to the source code of this file.
Defines | |
#define | SAMPLE_HASH_SIZE 64 |
Functions | |
void | S_SetSampleRepeatRate (int sampleRepeatRate) |
Controls the repeat rate for the same sample. | |
static s_sample_t * | S_FindName (const char *name) |
Searches the hash for a given sound file. | |
static Mix_Chunk * | S_LoadSampleChunk (const char *sound) |
s_sample_t * | S_LoadSample (const char *soundFile) |
Loads and registers a sound file for later use. | |
void | S_FreeSamples (void) |
void | S_LoadSamples (void) |
Variables | |
static s_sample_t * | sampleHash [SAMPLE_HASH_SIZE] |
Main control for any streaming sound output device.
Definition in file s_sample.c.
#define SAMPLE_HASH_SIZE 64 |
Definition at line 29 of file s_sample.c.
Referenced by S_FindName(), S_FreeSamples(), and S_LoadSample().
static s_sample_t* S_FindName | ( | const char * | name | ) | [static] |
Searches the hash for a given sound file.
name | The soundfile (relative to the sound dir and without extension) |
NULL
if not yet loaded Definition at line 46 of file s_sample.c.
References Com_HashKey(), hash(), s_sample_s::hashNext, s_sample_s::name, and SAMPLE_HASH_SIZE.
Referenced by S_LoadSample().
void S_FreeSamples | ( | void | ) |
Definition at line 135 of file s_sample.c.
References s_sample_s::chunk, s_sample_s::hashNext, i, Mem_Free, s_sample_s::name, next, and SAMPLE_HASH_SIZE.
Referenced by S_Shutdown().
s_sample_t* S_LoadSample | ( | const char * | soundFile | ) |
Loads and registers a sound file for later use.
[in] | soundFile | The name of the soundfile, relative to the sounds dir |
Definition at line 105 of file s_sample.c.
References s_sample_s::chunk, chunk(), cl_soundSysPool, Com_HashKey(), Com_StripExtension(), hash(), s_sample_s::hashNext, s_env_s::initialized, MAX_QPATH, Mem_PoolAlloc, Mem_PoolStrDup, s_sample_s::name, name, s_env, S_FindName(), S_LoadSampleChunk(), and SAMPLE_HASH_SIZE.
Referenced by CL_ActorDoShoot(), CL_ActorDoThrow(), CL_ActorPlaySound(), CL_InvReload(), CL_ParseStartSoundPacket(), LE_AddAmbientSound(), LE_AddProjectile(), LE_PlaySoundFileAndParticleForSurface(), LET_Projectile(), S_LoadSamples(), and S_StartLocalSample().
static Mix_Chunk* S_LoadSampleChunk | ( | const char * | sound | ) | [static] |
Definition at line 58 of file s_sample.c.
References byte, chunk(), Com_Printf(), FS_FreeFile(), FS_LoadFile(), len, MAX_QPATH, qfalse, SAMPLE_TYPES, and va().
Referenced by S_LoadSample().
void S_LoadSamples | ( | void | ) |
Definition at line 161 of file s_sample.c.
References fireDef_s::bounceSound, cls, csi, objDef_s::fd, fireDef_s::fireSound, fireDef_s::hitBodySound, i, fireDef_s::impactSound, s_env_s::initialized, INVSH_GetItemByIDX(), objDef_s::numFiredefs, csi_s::numODs, objDef_s::numWeapons, s_env, S_LoadSample(), SOUND_WATER_IN, SOUND_WATER_MOVE, SOUND_WATER_OUT, and client_static_s::soundPool.
Referenced by CL_InitAfter(), and S_Restart_f().
void S_SetSampleRepeatRate | ( | int | sampleRepeatRate | ) |
Controls the repeat rate for the same sample.
[in] | sampleRepeatRate | milliseconds that must have passed to play the same sample again |
Definition at line 36 of file s_sample.c.
References s_env, and s_env_s::sampleRepeatRate.
Referenced by MS_LoadXML().
s_sample_t* sampleHash[SAMPLE_HASH_SIZE] [static] |
Definition at line 30 of file s_sample.c.