|
UFO: Alien Invasion
|
Main control for any streaming sound output device. More...
#include "../client.h"#include "s_main.h"#include "s_local.h"#include "s_music.h"#include "s_sample.h"#include "s_mix.h"#include "s_mumble.h"
Go to the source code of this file.
Macros | |
| #define | COMPARE_VERSION(major, minor, micro) |
Functions | |
| static void | S_Restart_f (void) |
| Restart the sound subsystem so it can pick up new parameters and flush all sounds. | |
| void | S_Stop (void) |
| Stop all channels. | |
| void | S_Frame (void) |
| static void | S_Play_f (void) |
| Plays sound fx files via console. | |
| static int | S_CompleteSounds (const char *partial, const char **match) |
| void | S_Init (void) |
| void | S_Shutdown (void) |
| bool | S_LoadAndPlaySample (const char *s, const vec3_t origin, float attenuation, float volume) |
| does what the name implies in just one function to avoid exposing s_sample_t | |
| void | S_PlayStdSample (const stdsound_t sId, const vec3_t origin, float attenuation, float volume) |
| plays one of the precached samples | |
| s_sample_t * | S_LoadSample (const char *soundFile) |
| Loads and registers a sound file for later use. | |
| void | S_SetSampleRepeatRate (int sampleRepeatRate) |
| Controls the repeat rate for the same sample. | |
| void | S_LoadSamples (void) |
| Wrapper for S_PrecacheSamples to avoid exposing it via s_sample.h. | |
Variables | |
| s_env_t | s_env |
| cvar_t * | snd_volume |
| cvar_t * | snd_distance_scale |
| static cvar_t * | snd_init |
| static cvar_t * | snd_rate |
| static cvar_t * | snd_chunkbufsize |
| memPool_t * | cl_soundSysPool |
| s_sample_t * | stdSoundPool [MAX_SOUNDIDS] |
Main control for any streaming sound output device.
Definition in file s_main.cpp.
| #define COMPARE_VERSION | ( | major, | |
| minor, | |||
| micro ) |
Definition at line 34 of file s_main.cpp.
|
static |
Definition at line 148 of file s_main.cpp.
References Cmd_GenericCompleteFunction(), Com_Printf(), Com_sprintf(), FS_NextFileFromFileList(), MAX_OSPATH, and SAMPLE_TYPES.
Referenced by S_Init().
Definition at line 70 of file s_main.cpp.
References le_t::attenuation, AXIS_FORWARD, AXIS_RIGHT, AXIS_UP, cl, CL_OnBattlescape(), s_channel_t::count, ET_SOUND, i, LE_GetNextInUse(), M_Frame(), MAX_CHANNELS, le_t::origin, s_env, S_GetSample(), S_LoopSample(), S_MumbleUpdate(), S_Restart_f(), S_SpatializeChannel(), s_channel_t::sample, le_t::sampleIdx, snd_init, le_t::type, VectorCopy, and le_t::volume.
Referenced by CL_Frame(), and CL_InitAfter().
Definition at line 172 of file s_main.cpp.
References cl_soundSysPool, Cmd_AddCommand(), Cmd_AddParamCompleteFunction(), Cmd_Dummy_f(), Com_Printf(), CVAR_ARCHIVE, Cvar_Get(), i, M_Init(), MAX_CHANNELS, Mem_CreatePool, OBJZERO, S_CompleteSounds(), s_env, S_FreeChannel(), S_MumbleInit(), S_Play_f(), S_Restart_f(), snd_chunkbufsize, snd_distance_scale, snd_init, snd_rate, and snd_volume.
Referenced by CL_Init(), and S_Restart_f().
| bool S_LoadAndPlaySample | ( | const char * | s, |
| const vec3_t | origin, | ||
| float | attenuation, | ||
| float | volume ) |
does what the name implies in just one function to avoid exposing s_sample_t
| s | name of the sample |
| origin | where to play it |
| attenuation | how to reduce volume by distance |
| volume | well, the volume |
Definition at line 307 of file s_main.cpp.
References Q_strnull(), S_LoadSample(), and S_PlaySample().
Referenced by CL_ActorDoShoot(), CL_ActorDoThrow(), CL_ActorPlaySound(), CL_ActorShootHidden(), CL_Explode(), CL_InvReload(), CL_SoundEvent(), LE_AddProjectile(), LE_PlayFootStepSound(), LE_PlaySoundFileAndParticleForSurface(), and LET_Projectile().
| 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 335 of file s_main.cpp.
References S_GetSample(), and S_LoadSampleIdx().
Referenced by S_LoadAndPlaySample(), S_PrecacheSamples(), and S_StartLocalSample().
Wrapper for S_PrecacheSamples to avoid exposing it via s_sample.h.
Definition at line 352 of file s_main.cpp.
References S_PrecacheSamples().
Referenced by CL_InitAfter(), and S_Restart_f().
Plays sound fx files via console.
Definition at line 121 of file s_main.cpp.
References Cmd_Argc(), Cmd_Argv(), Com_Printf(), i, S_StartLocalSample(), and SND_VOLUME_DEFAULT.
Referenced by S_Init().
| void S_PlayStdSample | ( | const stdsound_t | sId, |
| const vec3_t | origin, | ||
| float | attenuation, | ||
| float | volume ) |
plays one of the precached samples
| sId | ID of the sample |
| origin | where to play it |
| attenuation | how to reduce volume by distance |
| volume | well, the volume |
Definition at line 326 of file s_main.cpp.
References S_PlaySample(), and stdSoundPool.
Referenced by LE_PlaySoundFileForContents().
Restart the sound subsystem so it can pick up new parameters and flush all sounds.
Definition at line 140 of file s_main.cpp.
References Com_Printf(), S_Init(), S_LoadSamples(), and S_Shutdown().
Controls the repeat rate for the same sample.
| [in] | sampleRepeatRate | milliseconds that must have passed to play the same sample again |
Definition at line 345 of file s_main.cpp.
References s_env.
Referenced by GAME_GetImportData(), and cgame_import_t::void().
Definition at line 268 of file s_main.cpp.
References cl_soundSysPool, Cmd_RemoveCommand(), M_Shutdown(), Mem_DeletePool, s_env, S_FreeSamples(), and S_Stop().
Referenced by CL_Shutdown(), and S_Restart_f().
Stop all channels.
Definition at line 58 of file s_main.cpp.
References OBJZERO, s_env, and S_MumbleUnlink().
Referenced by CL_Disconnect(), and S_Shutdown().
| memPool_t* cl_soundSysPool |
Definition at line 48 of file s_main.cpp.
Referenced by S_Init(), S_LoadSampleIdx(), and S_Shutdown().
| s_env_t s_env |
Definition at line 40 of file s_main.cpp.
Referenced by M_AddToSampleBuffer(), M_Change_f(), M_RandomTrack_f(), M_Start(), S_AllocChannel(), S_Frame(), S_FreeChannel(), S_Init(), S_LoadSampleIdx(), S_LoopSample(), S_MumbleLink(), S_MumbleUnlink(), S_MumbleUpdate(), S_PlaySample(), S_PrecacheSamples(), S_SetSampleRepeatRate(), S_Shutdown(), S_SpatializeChannel(), S_StartLocalSample(), and S_Stop().
|
static |
Definition at line 46 of file s_main.cpp.
Referenced by S_Init().
| cvar_t* snd_distance_scale |
Definition at line 43 of file s_main.cpp.
Referenced by S_Init(), and S_SpatializeChannel().
|
static |
Definition at line 44 of file s_main.cpp.
|
static |
Definition at line 45 of file s_main.cpp.
Referenced by S_Init().
| cvar_t* snd_volume |
Definition at line 42 of file s_main.cpp.
Referenced by S_Init(), S_LoopSample(), and S_PlaySample().
|
extern |
this pool is reloaded on every sound system restart
Definition at line 40 of file s_sample.cpp.
Referenced by S_PlayStdSample(), and S_PrecacheSamples().