]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sound.h
added sv_freezenonclients cvar, fixed the bug that caused falling damage when standin...
[xonotic/darkplaces.git] / sound.h
diff --git a/sound.h b/sound.h
index 561272ba51d336203de9c7e0d1d6993f461c8dab..e0ef6c73049e5a2f5acf49c71c5ed22e2b68f857 100644 (file)
--- a/sound.h
+++ b/sound.h
@@ -46,25 +46,24 @@ typedef struct sfx_s
        char    name[MAX_QPATH];
        mempool_t       *mempool;
        sfxcache_t      *sfxcache;
+       int silentlymissing; // true if missing and loaded with complain = false
 } sfx_t;
 
 typedef struct
 {
-       qboolean                gamealive;
-       qboolean                soundalive;
-       qboolean                splitbuffer;
        int                             channels;
        int                             samples;                                // mono samples in buffer
-       int                             submission_chunk;               // don't mix less than this #
        int                             samplepos;                              // in mono samples
        int                             samplebits;
        int                             speed;
        unsigned char   *buffer;
+       int                             bufferlength; // used only by certain drivers
 } dma_t;
 
 typedef struct
 {
        sfx_t   *sfx;                   // sfx number
+       int             forceloop;              // force looping even if the sound is not looped
        int             leftvol;                // 0-255 volume
        int             rightvol;               // 0-255 volume
        int             end;                    // end time in global paintsamples
@@ -95,9 +94,10 @@ void S_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation);
 void S_StopSound (int entnum, int entchannel);
 void S_StopAllSounds(qboolean clear);
 void S_ClearBuffer (void);
-void S_Update (vec3_t origin, vec3_t v_forward, vec3_t v_right, vec3_t v_up);
+void S_Update(vec3_t origin, vec3_t forward, vec3_t left, vec3_t up);
 void S_ExtraUpdate (void);
 
+sfx_t *S_GetCached(const char *name);
 sfx_t *S_PrecacheSound (char *sample, int complain);
 void S_TouchSound (char *sample);
 void S_ClearPrecache (void);
@@ -110,7 +110,7 @@ void S_InitPaintChannels (void);
 channel_t *SND_PickChannel(int entnum, int entchannel);
 
 // spatializes a channel
-void SND_Spatialize(channel_t *ch);
+void SND_Spatialize(channel_t *ch, int isstatic);
 
 // initializes cycling through a DMA buffer and returns information on it
 qboolean SNDDMA_Init(void);
@@ -148,10 +148,10 @@ extern qboolean fakedma;
 extern int fakedma_updates;
 extern int paintedtime;
 extern int soundtime;
-extern vec3_t listener_origin;
-extern vec3_t listener_forward;
-extern vec3_t listener_right;
-extern vec3_t listener_up;
+extern vec3_t listener_vieworigin;
+extern vec3_t listener_viewforward;
+extern vec3_t listener_viewleft;
+extern vec3_t listener_viewup;
 extern volatile dma_t *shm;
 extern volatile dma_t sn;
 extern vec_t sound_nominal_clip_dist;
@@ -161,13 +161,14 @@ extern cvar_t bgmvolume;
 extern cvar_t volume;
 extern cvar_t snd_swapstereo;
 
-extern qboolean cdaudioinitialized;
-extern qboolean        snd_initialized;
+extern cvar_t cdaudioinitialized;
+extern cvar_t  snd_initialized;
 
 extern int snd_blocked;
 
 void S_LocalSound (char *s);
 sfxcache_t *S_LoadSound (sfx_t *s, int complain);
+void S_UnloadSound(sfx_t *s);
 
 wavinfo_t GetWavinfo (char *name, qbyte *wav, int wavlength);
 
@@ -192,5 +193,8 @@ int S_RawSamples_QueueWantsMore(void);
 // resamples one sound buffer into another, while changing the length
 void S_ResampleBuffer16Stereo(short *input, int inputlength, short *output, int outputlength);
 
+// returns the rate that the rawsamples system is running at
+int S_RawSamples_SampleRate(void);
+
 #endif