123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178 |
- #ifndef __SOUND__
- #define __SOUND__
- #define DEFAULT_SOUND_PACKET_VOLUME 255
- #define DEFAULT_SOUND_PACKET_ATTENUATION 1.0
- typedef struct
- {
- int left;
- int right;
- } portable_samplepair_t;
- typedef struct sfx_s
- {
- char name[MAX_QPATH];
- cache_user_t cache;
- } sfx_t;
- typedef struct
- {
- int length;
- int loopstart;
- int speed;
- int width;
- int stereo;
- byte data[1];
- } sfxcache_t;
- typedef struct
- {
- qboolean gamealive;
- qboolean soundalive;
- qboolean splitbuffer;
- int channels;
- int samples;
- int submission_chunk;
- int samplepos;
- int samplebits;
- int speed;
- unsigned char *buffer;
- } dma_t;
- typedef struct
- {
- sfx_t *sfx;
- int leftvol;
- int rightvol;
- int end;
- int pos;
- int looping;
- int entnum;
- int entchannel;
- vec3_t origin;
- vec_t dist_mult;
- int master_vol;
- } channel_t;
- typedef struct
- {
- int rate;
- int width;
- int channels;
- int loopstart;
- int samples;
- int dataofs;
- } wavinfo_t;
- void S_Init (void);
- void S_Startup (void);
- void S_Shutdown (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);
- 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_ExtraUpdate (void);
- sfx_t *S_PrecacheSound (char *sample);
- void S_TouchSound (char *sample);
- void S_ClearPrecache (void);
- void S_BeginPrecaching (void);
- void S_EndPrecaching (void);
- void S_PaintChannels(int endtime);
- void S_InitPaintChannels (void);
- channel_t *SND_PickChannel(int entnum, int entchannel);
- void SND_Spatialize(channel_t *ch);
- qboolean SNDDMA_Init(void);
- int SNDDMA_GetDMAPos(void);
- void SNDDMA_Shutdown(void);
- #define MAX_CHANNELS 128
- #define MAX_DYNAMIC_CHANNELS 8
- extern channel_t channels[MAX_CHANNELS];
- extern int total_channels;
- extern qboolean fakedma;
- extern int fakedma_updates;
- extern int paintedtime;
- extern vec3_t listener_origin;
- extern vec3_t listener_forward;
- extern vec3_t listener_right;
- extern vec3_t listener_up;
- extern volatile dma_t *shm;
- extern volatile dma_t sn;
- extern vec_t sound_nominal_clip_dist;
- extern cvar_t loadas8bit;
- extern cvar_t bgmvolume;
- extern cvar_t volume;
- extern qboolean snd_initialized;
- extern int snd_blocked;
- void S_LocalSound (char *s);
- sfxcache_t *S_LoadSound (sfx_t *s);
- wavinfo_t GetWavinfo (char *name, byte *wav, int wavlength);
- void SND_InitScaletable (void);
- void SNDDMA_Submit(void);
- void S_AmbientOff (void);
- void S_AmbientOn (void);
- #endif
|