]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sound.h
Factorized the code of the S_Play* functions
[xonotic/darkplaces.git] / sound.h
diff --git a/sound.h b/sound.h
index b93f05d59cd08d00c2fa588798173d03825b94e6..2d179a7de2d66c388d0123e7b61aec190bc987d4 100644 (file)
--- a/sound.h
+++ b/sound.h
@@ -51,21 +51,19 @@ typedef struct sfx_s
 
 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
@@ -91,8 +89,6 @@ typedef struct
 void S_Init (void);
 void S_Startup (void);
 void S_Shutdown (void);
-void S_Open (void);
-void S_Close (void);
 void S_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol,  float attenuation);
 void S_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation);
 void S_StopSound (int entnum, int entchannel);
@@ -101,6 +97,7 @@ void S_ClearBuffer (void);
 void S_Update (vec3_t origin, vec3_t v_forward, vec3_t v_right, vec3_t v_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);
@@ -171,6 +168,7 @@ 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);