|
UFO: Alien Invasion
|
Specifies sound API? More...
#include "../../shared/mathlib.h"

Go to the source code of this file.
Macros | |
| #define | SND_VOLUME_DEFAULT 1.0f |
| #define | SND_VOLUME_WEAPONS 1.0f |
Enumerations | |
| enum | stdsound_t { SOUND_WATER_IN , SOUND_WATER_OUT , SOUND_WATER_MOVE , MAX_SOUNDIDS } |
| These sounds are precached in S_LoadSamples. More... | |
Functions | |
| void | S_Init (void) |
| void | S_Shutdown (void) |
| void | S_Frame (void) |
| void | S_Stop (void) |
| Stop all channels. | |
| void | S_PlayStdSample (const stdsound_t sId, const vec3_t origin, float atten, float volume) |
| plays one of the precached samples | |
| void | S_StartLocalSample (const char *s, float volume) |
| Plays a sample without spatialization. | |
| int | S_LoadSampleIdx (const char *soundFile) |
| Loads and registers a sound file for later use. | |
| bool | S_LoadAndPlaySample (const char *s, const vec3_t origin, float atten, float volume) |
| does what the name implies in just one function to avoid exposing s_sample_t | |
| 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. | |
Specifies sound API?
Definition in file s_main.h.
| #define SND_VOLUME_DEFAULT 1.0f |
Definition at line 42 of file s_main.h.
Referenced by CL_ActorDoThrow(), CL_ActorPlaySound(), CL_DoEndRound(), CL_Explode(), CL_SoundEvent(), CL_SpawnParseEntitystring(), GAME_AddChatMessage(), Irc_AppendToBuffer(), Irc_Client_CmdPrivmsg(), LE_AddAmbientSound(), S_Play_f(), SEQ_ExecuteSound(), and UI_PlaySound().
| #define SND_VOLUME_WEAPONS 1.0f |
Definition at line 43 of file s_main.h.
Referenced by CL_ActorDoShoot(), CL_ActorShootHidden(), CL_InvReload(), LE_AddProjectile(), and LET_Projectile().
| enum stdsound_t |
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().
| int S_LoadSampleIdx | ( | 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.cpp.
References s_sample_t::chunk, cl_soundSysPool, Com_HashKey(), Com_StripExtension(), hash, s_sample_t::hashNext, s_sample_t::index, MAX_QPATH, Mem_PoolAllocType, Mem_PoolStrDup, name, s_sample_t::name, s_env, S_FindByName(), S_LoadSampleChunk(), SAMPLE_HASH_SIZE, sampleHash, sampleIndex, and sampleIndexLast.
Referenced by LE_AddAmbientSound(), and S_LoadSample().
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().
| 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().
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().
| void S_StartLocalSample | ( | const char * | name, |
| float | relVolume ) |
Plays a sample without spatialization.
| [in] | name | The sample name |
| [in] | relVolume | Max mixer volume factor (0.0 - 1.0) |
Definition at line 184 of file s_mix.cpp.
References Com_Printf(), name, s_env, S_LoadSample(), S_PlaySample(), and SOUND_ATTN_NORM.
Referenced by CL_DoEndRound(), GAME_AddChatMessage(), GAME_GetImportData(), Irc_AppendToBuffer(), Irc_Client_CmdPrivmsg(), S_Play_f(), SEQ_ExecuteSound(), UI_PlaySound(), and cgame_import_t::void().
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().