QuakeForge  0.7.2.210-815cf
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
snd_internal.h File Reference
This graph shows which files directly or indirectly include this file:

Data Structures

struct  channel_s
 Representation of a sound being played. More...
 
struct  dma_s
 communication structure between output drivers and renderer More...
 
struct  portable_samplepair_s
 Represent a sound sample in the mixer. More...
 
struct  sfxblock_s
 Representation of sound loaded into memory as a full block. More...
 
struct  sfxbuffer_s
 Buffer for storing sound samples in memory. More...
 
struct  sfxstream_s
 Representation of sound loaded that is streamed in as needed. More...
 
struct  wavinfo_s
 Describes the sound data. More...
 

Macros

#define MAX_CHANNELS   512
 number of available mixing channels More...
 
#define MAX_DYNAMIC_CHANNELS   128
 number of dynamic channels More...
 
#define MAX_STATIC_CHANNELS   256
 number of static channels More...
 
#define PAINTBUFFER_SIZE   512
 

Typedefs

typedef struct channel_s channel_t
 
typedef struct dma_s dma_t
 
typedef struct
portable_samplepair_s 
portable_samplepair_t
 
typedef struct sfxblock_s sfxblock_t
 
typedef struct sfxbuffer_s sfxbuffer_t
 
typedef void sfxpaint_t (int, channel_t *, float *, unsigned)
 paint samples into the mix buffer More...
 
typedef struct sfxstream_s sfxstream_t
 
typedef struct wavinfo_s wavinfo_t
 

Functions

struct channel_sSND_AllocChannel (void)
 Allocate a sound channel that can be used for playing sounds. More...
 
void SND_AmbientOff (void)
 Disable ambient sounds. More...
 
void SND_AmbientOn (void)
 Enable ambient sounds. More...
 
sfxbuffer_tSND_CacheGetBuffer (sfx_t *sfx)
 Get the pointer to the sound buffer. More...
 
void SND_CacheRelease (sfx_t *sfx)
 Unlock a cached sound from memory. More...
 
sfxbuffer_tSND_CacheRetain (sfx_t *sfx)
 Lock a cached sound into memory. More...
 
sfxbuffer_tSND_CacheTouch (sfx_t *sfx)
 Ensure a cached sound is in memory. More...
 
wavinfo_tSND_CacheWavinfo (sfx_t *sfx)
 Retrieve wavinfo from a cached sound. More...
 
void SND_Channels_Init (void)
 Initialize the channels sub-subsystem. More...
 
void SND_ChannelStop (channel_t *chan)
 Stop a channel from playing. More...
 
void SND_Convert (byte *idata, float *fdata, int frames, int channels, int width)
 Convert integer sample data to float sample data. More...
 
sfxbuffer_tSND_GetCache (long samples, int rate, int channels, sfxblock_t *block, cache_allocator_t allocator)
 Allocate a sound buffer from cache for cached sounds. More...
 
void SND_InitScaletable (void)
 Initialize the scale table for painting of 8 bit samples. More...
 
int SND_Load (sfx_t *sfx)
 Load the referenced sound. More...
 
int SND_LoadFLAC (QFile *file, sfx_t *sfx, char *realname)
 Load the referenced sound from the specified FLAC file. More...
 
int SND_LoadMidi (QFile *file, sfx_t *sfx, char *realname)
 Load the referenced sound from the specified MIDI file. More...
 
int SND_LoadOgg (QFile *file, sfx_t *sfx, char *realname)
 Load the referenced sound from the specified Ogg file. More...
 
sfx_tSND_LoadSound (const char *name)
 Pre-load a sound. More...
 
int SND_LoadWav (QFile *file, sfx_t *sfx, char *realname)
 Load the referenced sound from the specified WAV file. More...
 
void SND_LocalSound (const char *s)
 Start a sound local to the client view. More...
 
void SND_PaintChannels (unsigned int endtime)
 Mix all active channels into the output buffer. More...
 
sfx_tSND_PrecacheSound (const char *sample)
 Pre-load a sound into the cache. More...
 
void SND_PulldownResampler (sfxstream_t *stream)
 Free memory allocated for the resampler. More...
 
void SND_Resample (sfxbuffer_t *sc, float *data, int length)
 Copy/resample data into buffer, resampling as necessary. More...
 
void SND_ScanChannels (int wait)
 Scan channels looking for stopped channels. More...
 
void SND_SetListener (const vec3_t origin, const vec3_t v_forward, const vec3_t v_right, const vec3_t v_up, const byte *ambient_sound_level)
 Update the sound engine with the client's position and orientation and render some sound. More...
 
void SND_SetPaint (sfxbuffer_t *sc)
 Set the paint function of the sfxbuffer. More...
 
void SND_SetupResampler (sfxbuffer_t *sc, int streamed)
 Set up the various parameters that depend on the actual sample rate. More...
 
void SND_SFX_Cache (sfx_t *sfx, char *realname, wavinfo_t info, cache_loader_t loader)
 Cache sound data. More...
 
void SND_SFX_Init (void)
 Initialize the sfx sub-subsystem. More...
 
void SND_SFX_Stream (sfx_t *sfx, char *realname, wavinfo_t info, sfx_t *(*open)(sfx_t *sfx))
 Stream sound data. More...
 
void SND_SFX_StreamClose (sfx_t *sfx)
 Close a stream. More...
 
sfx_tSND_SFX_StreamOpen (sfx_t *sfx, void *file, long(*read)(void *, float **), int(*seek)(sfxstream_t *, int), void(*close)(sfx_t *))
 Open a stream for playback. More...
 
void SND_StartSound (int entnum, int entchannel, sfx_t *sfx, const vec3_t origin, float fvol, float attenuation)
 Start a sound playing. More...
 
void SND_StaticSound (sfx_t *sfx, const vec3_t origin, float vol, float attenuation)
 Create a sound generated by the world. More...
 
void SND_StopAllSounds (void)
 Stop all sounds from playing. More...
 
void SND_StopSound (int entnum, int entchannel)
 Stop an entity's sound. More...
 
int SND_StreamAdvance (sfxbuffer_t *buffer, unsigned int count)
 Advance the position with the stream, updating the ring buffer as necessary. More...
 
sfxbuffer_tSND_StreamGetBuffer (sfx_t *sfx)
 Get the pointer to the sound buffer. More...
 
void SND_StreamRelease (sfx_t *sfx)
 Unlock a streamed sound from memory. More...
 
sfxbuffer_tSND_StreamRetain (sfx_t *sfx)
 Lock a streamed sound into memory. More...
 
void SND_StreamSetPos (sfxbuffer_t *buffer, unsigned int pos)
 Seek to an absolute position within the stream, resetting the ring buffer. More...
 
wavinfo_tSND_StreamWavinfo (sfx_t *sfx)
 Retrieve wavinfo from a streamed sound. More...
 

Variables

channel_t snd_channels [MAX_CHANNELS]
 pool of available channels More...
 
struct cvar_ssnd_interp
 
struct cvar_ssnd_loadas8bit
 
portable_samplepair_t snd_paintbuffer [PAINTBUFFER_SIZE *2]
 
unsigned snd_paintedtime
 sound clock in samples More...
 
snd_render_data_t snd_render_data
 
volatile dma_tsnd_shm
 
struct cvar_ssnd_stereo_phase_separation
 
int snd_total_channels
 number of active channels More...
 
struct cvar_ssnd_volume