aboutsummaryrefslogtreecommitdiffstats
path: root/code/client/snd_local.h
diff options
context:
space:
mode:
authortma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea>2005-11-13 18:58:14 +0000
committertma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea>2005-11-13 18:58:14 +0000
commit38baaa2274a458f03f576dea5a6d3cd9e25f8063 (patch)
tree64500262c0756817893a96b4d6556e6a31d2ce8f /code/client/snd_local.h
parentc37663e2d7c564e85af9d17afed0ee1dd283bfb5 (diff)
downloadioquake3-aero-38baaa2274a458f03f576dea5a6d3cd9e25f8063.tar.gz
ioquake3-aero-38baaa2274a458f03f576dea5a6d3cd9e25f8063.zip
* OpenAL support, from BlackAura aka Stuart Dalton <badcdev@gmail.com>
+ An abstract codec system, simplifying support for new formats + Changes versus BlackAura's patch: o Consolidated the OpenAL parts into one file o Changed the function naming scheme to more closely resemble Q3 o Changed the interface to fall back on the "base" sound system if loading OpenAL fails + This is enabled on Linux and MinGW for now, but should work on the other *nixs with appropriate additions to the Makefile + NOT enabled on OS X or MSVC Windows builds + Probably breaks the Windows build again * Retabulated sdl_snd.c and made the messages less verbose since there do not seem to be many having problems with SDL sound now git-svn-id: svn://svn.icculus.org/quake3/trunk@343 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/client/snd_local.h')
-rw-r--r--code/client/snd_local.h51
1 files changed, 44 insertions, 7 deletions
diff --git a/code/client/snd_local.h b/code/client/snd_local.h
index 49fcbac..3b45a99 100644
--- a/code/client/snd_local.h
+++ b/code/client/snd_local.h
@@ -117,6 +117,31 @@ typedef struct {
int dataofs; // chunk starts this many bytes from file start
} wavinfo_t;
+// Interface between Q3 sound "api" and the sound backend
+typedef struct
+{
+ void (*Shutdown)(void);
+ void (*StartSound)( vec3_t origin, int entnum, int entchannel, sfxHandle_t sfx );
+ void (*StartLocalSound)( sfxHandle_t sfx, int channelNum );
+ void (*StartBackgroundTrack)( const char *intro, const char *loop );
+ void (*StopBackgroundTrack)( void );
+ void (*RawSamples)(int samples, int rate, int width, int channels, const byte *data, float volume);
+ void (*StopAllSounds)( void );
+ void (*ClearLoopingSounds)( qboolean killall );
+ void (*AddLoopingSound)( int entityNum, const vec3_t origin, const vec3_t velocity, sfxHandle_t sfx );
+ void (*AddRealLoopingSound)( int entityNum, const vec3_t origin, const vec3_t velocity, sfxHandle_t sfx );
+ void (*StopLoopingSound)(int entityNum );
+ void (*Respatialize)( int entityNum, const vec3_t origin, vec3_t axis[3], int inwater );
+ void (*UpdateEntityPosition)( int entityNum, const vec3_t origin );
+ void (*Update)( void );
+ void (*DisableSounds)( void );
+ void (*BeginRegistration)( void );
+ sfxHandle_t (*RegisterSound)( const char *sample, qboolean compressed );
+ void (*ClearSoundBuffer)( void );
+ void (*SoundInfo)( void );
+ void (*SoundList)( void );
+} soundInterface_t;
+
/*
====================================================================
@@ -157,14 +182,11 @@ extern dma_t dma;
#define MAX_RAW_SAMPLES 16384
extern portable_samplepair_t s_rawsamples[MAX_RAW_SAMPLES];
-extern cvar_t *s_volume;
-extern cvar_t *s_nosound;
-extern cvar_t *s_khz;
-extern cvar_t *s_show;
-extern cvar_t *s_mixahead;
+extern cvar_t *s_volume;
+extern cvar_t *s_musicVolume;
+extern cvar_t *s_doppler;
-extern cvar_t *s_testsound;
-extern cvar_t *s_separation;
+extern cvar_t *s_testsound;
qboolean S_LoadSound( sfx_t *sfx );
@@ -204,3 +226,18 @@ extern short *sfxScratchBuffer;
extern sfx_t *sfxScratchPointer;
extern int sfxScratchIndex;
+qboolean S_Base_Init( soundInterface_t *si );
+
+// OpenAL stuff
+typedef enum
+{
+ SRCPRI_AMBIENT = 0, // Ambient sound effects
+ SRCPRI_ENTITY, // Entity sound effects
+ SRCPRI_ONESHOT, // One-shot sounds
+ SRCPRI_LOCAL, // Local sounds
+ SRCPRI_STREAM // Streams (music, cutscenes)
+} alSrcPriority_t;
+
+typedef int srcHandle_t;
+
+qboolean S_AL_Init( soundInterface_t *si );