s_main.h File Reference

Specifies sound API? More...

#include <SDL_mixer.h>
Include dependency graph for s_main.h:
This graph shows which files directly or indirectly include this file:

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_tS_LoadSample (const char *s)
 Loads and registers a sound file for later use.

Variables

s_env_t s_env

Detailed Description

Specifies sound API?

Definition in file s_main.h.


Define Documentation

#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
#define SND_VOLUME_WEAPONS   1.0f

Typedef Documentation

typedef struct s_channel_s s_channel_t
typedef struct s_env_s s_env_t

the sound environment

typedef struct s_sample_s s_sample_t

Enumeration Type Documentation

anonymous enum

These sounds are precached in S_LoadSamples.

Enumerator:
SOUND_WATER_IN 
SOUND_WATER_OUT 
SOUND_WATER_MOVE 
MAX_SOUNDIDS 

Definition at line 37 of file s_main.h.


Function Documentation

void S_Frame ( void   ) 
void S_Init ( void   ) 
s_sample_t* S_LoadSample ( const char *  soundFile  ) 
void S_PlaySample ( const vec3_t  origin,
s_sample_t sample,
float  atten,
float  relVolume 
)

Validates the parms and queues the sound up.

Parameters:
[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)
See also:
S_StartLocalSample
S_SetVolume

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   ) 
void S_StartLocalSample ( const char *  name,
float  relVolume 
)

Plays a sample without spatialization.

Parameters:
[in] name The sample name
[in] relVolume Max mixer volume factor (0.0 - 1.0)
See also:
S_PlaySample
S_LoadSample

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().


Variable Documentation


Generated by  doxygen 1.6.2