s_sample.c File Reference

Main control for any streaming sound output device. More...

#include "s_local.h"
#include "s_sample.h"
Include dependency graph for s_sample.c:

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_tS_FindName (const char *name)
 Searches the hash for a given sound file.
static Mix_Chunk * S_LoadSampleChunk (const char *sound)
s_sample_tS_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_tsampleHash [SAMPLE_HASH_SIZE]

Detailed Description

Main control for any streaming sound output device.

Definition in file s_sample.c.


Define Documentation

#define SAMPLE_HASH_SIZE   64

Definition at line 29 of file s_sample.c.

Referenced by S_FindName(), S_FreeSamples(), and S_LoadSample().


Function Documentation

static s_sample_t* S_FindName ( const char *  name  )  [static]

Searches the hash for a given sound file.

Parameters:
name The soundfile (relative to the sound dir and without extension)
Returns:
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  ) 
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   ) 
void S_SetSampleRepeatRate ( int  sampleRepeatRate  ) 

Controls the repeat rate for the same sample.

Parameters:
[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().


Variable Documentation

s_sample_t* sampleHash[SAMPLE_HASH_SIZE] [static]

Definition at line 30 of file s_sample.c.


Generated by  doxygen 1.6.2