Specifies sound API? More...
#include <SDL_mixer.h>
Go to the source code of this file.
Data Structures | |
struct | s_sample_s |
struct | s_channel_s |
struct | s_env_s |
the sound environment More... | |
Defines | |
#define | MAX_CHANNELS 64 |
#define | SND_VOLUME_DEFAULT 1.0f |
#define | SND_VOLUME_WEAPONS 1.0f |
Typedefs | |
typedef struct s_sample_s | s_sample_t |
typedef struct s_channel_s | s_channel_t |
typedef struct s_env_s | s_env_t |
the sound environment | |
Enumerations | |
enum | { 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_PlaySample (const vec3_t origin, s_sample_t *sample, float atten, float volume) |
Validates the parms and queues the sound up. | |
void | S_StartLocalSample (const char *s, float volume) |
Plays a sample without spatialization. | |
s_sample_t * | S_LoadSample (const char *s) |
Loads and registers a sound file for later use. | |
Variables | |
s_env_t | s_env |
Specifies sound API?
Definition in file s_main.h.
#define MAX_CHANNELS 64 |
Definition at line 34 of file s_main.h.
Referenced by S_AllocChannel(), S_Frame(), S_Init(), and S_LoopSample().
#define SND_VOLUME_DEFAULT 1.0f |
Definition at line 76 of file s_main.h.
Referenced by CL_ActorDoThrow(), CL_ActorPlaySound(), CL_DoEndRound(), CL_ParseServerMessage(), CL_ParseStartSoundPacket(), CL_SpawnParseEntitystring(), Irc_AppendToBuffer(), Irc_Client_CmdPrivmsg(), LE_AddAmbientSound(), MS_AddNewMessageSound(), S_Play_f(), SEQ_ExecuteSound(), and UI_PlaySound().
#define SND_VOLUME_WEAPONS 1.0f |
Definition at line 77 of file s_main.h.
Referenced by CL_ActorDoShoot(), CL_ActorShootHidden(), CL_InvReload(), LE_AddProjectile(), and LET_Projectile().
typedef struct s_channel_s s_channel_t |
typedef struct s_sample_s s_sample_t |
anonymous enum |
void S_Frame | ( | void | ) |
Definition at line 62 of file s_main.c.
References AngleVectors(), le_s::attenuation, s_env_s::channels, cl, CL_OnBattlescape(), s_channel_s::count, ET_SOUND, i, s_env_s::initialized, LE_GetNextInUse(), M_Frame(), MAX_CHANNELS, cvar_s::modified, le_s::origin, qfalse, s_env_s::right, S_LoopSample(), S_Restart_f(), S_SpatializeChannel(), le_s::sample, s_channel_s::sample, le_s::type, and le_s::volume.
Referenced by CL_Frame(), and CL_InitAfter().
void S_Init | ( | void | ) |
Definition at line 185 of file s_main.c.
References Cmd_AddCommand(), Cmd_AddParamCompleteFunction(), Cmd_Dummy_f(), Com_Printf(), CVAR_ARCHIVE, Cvar_Get(), s_env_s::format, s_env_s::initialized, cvar_s::integer, M_Init(), MAX_CHANNELS, MAX_VAR, cvar_s::modified, s_env_s::numChannels, Q_strncpyz(), qfalse, qtrue, s_env_s::rate, S_CompleteSounds(), S_FreeChannel(), S_Play_f(), and S_Restart_f().
Referenced by CL_Init(), and S_Restart_f().
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().
void S_PlaySample | ( | const vec3_t | origin, | |
s_sample_t * | sample, | |||
float | atten, | |||
float | relVolume | |||
) |
Validates the parms and queues the sound up.
[in] | origin | if this is NULL , the sound will be dynamically sourced from the entity |
[in] | sample | The soundfile to play |
[in] | atten | Attenuation of sound to be played (for example, fireAttenuation or impactAttenuation from fireDef_s ). |
[in] | relVolume | Max mixer volume factor (0.0 - 1.0) |
Definition at line 91 of file s_mix.c.
References s_channel_s::atten, s_env_s::channels, s_sample_s::chunk, CL_Milliseconds(), Com_DPrintf(), DEBUG_SOUND, i, s_env_s::initialized, s_sample_s::lastPlayed, s_sample_s::name, s_channel_s::org, S_AllocChannel(), s_env, S_SpatializeChannel(), s_channel_s::sample, s_env_s::sampleRepeatRate, snd_volume, cvar_s::value, and VectorCopy.
Referenced by CL_ActorDoShoot(), CL_ActorDoThrow(), CL_ActorPlaySound(), CL_InvReload(), CL_ParseStartSoundPacket(), LE_AddProjectile(), LE_PlaySoundFileAndParticleForSurface(), LE_PlaySoundFileForContents(), LET_Projectile(), and S_StartLocalSample().
void S_Shutdown | ( | void | ) |
Definition at line 266 of file s_main.c.
References cl_soundSysPool, Cmd_RemoveCommand(), s_env_s::initialized, M_Shutdown(), Mem_FreeTag, qfalse, 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 181 of file s_mix.c.
References Com_Printf(), s_env_s::initialized, s_env, S_LoadSample(), S_PlaySample(), and SOUND_ATTN_NORM.
Referenced by CL_ActorShootHidden(), CL_DoEndRound(), CL_ParseServerMessage(), Irc_AppendToBuffer(), Irc_Client_CmdPrivmsg(), MS_AddNewMessageSound(), S_Play_f(), SEQ_ExecuteSound(), and UI_PlaySound().
void S_Stop | ( | void | ) |
Stop all channels.
Definition at line 50 of file s_main.c.
References s_env_s::channels, and s_env_s::initialized.
Referenced by CL_Disconnect(), and S_Shutdown().
Definition at line 38 of file s_main.c.
Referenced by M_AddToSampleBuffer(), M_Change_f(), M_RandomTrack_f(), M_Start(), S_AllocChannel(), S_FreeChannel(), S_LoadSample(), S_LoadSamples(), S_LoopSample(), S_PlaySample(), S_SetSampleRepeatRate(), S_SpatializeChannel(), and S_StartLocalSample().