summaryrefslogtreecommitdiff
path: root/src/s_sound.h
diff options
context:
space:
mode:
authorSimon Howard2007-06-17 18:40:02 +0000
committerSimon Howard2007-06-17 18:40:02 +0000
commitbeab4eb58b667a5883166bd1dd7bc33369a005c7 (patch)
treea6574cd329b3caea7a600ec6ce9184cc79ffb494 /src/s_sound.h
parent5fc7913741e9f722e31735baea10f635fc18acce (diff)
downloadchocolate-doom-beab4eb58b667a5883166bd1dd7bc33369a005c7.tar.gz
chocolate-doom-beab4eb58b667a5883166bd1dd7bc33369a005c7.tar.bz2
chocolate-doom-beab4eb58b667a5883166bd1dd7bc33369a005c7.zip
Split i_sound.c into i_sdlsound.c, i_sdlmusic.c, with generic "sound
driver" modules, one for PC speaker and one for digital output. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 913
Diffstat (limited to 'src/s_sound.h')
-rw-r--r--src/s_sound.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/s_sound.h b/src/s_sound.h
index c5460aed..8a5e2c6c 100644
--- a/src/s_sound.h
+++ b/src/s_sound.h
@@ -28,6 +28,8 @@
#ifndef __S_SOUND__
#define __S_SOUND__
+#include "p_mobj.h"
+#include "sounds.h"
typedef enum
{
@@ -43,8 +45,50 @@ typedef enum
SNDDEVICE_AWE32 = 9,
} snddevice_t;
+typedef struct
+{
+ snddevice_t *sound_devices;
+ int num_sound_devices;
+
+ // Initialise sound module
+ // Returns true if successfully initialised
+
+ boolean (*Init)(void);
+
+ // Shutdown sound module
+
+ void (*Shutdown)(void);
+
+ // Returns the lump index of the given sound.
+
+ int (*GetSfxLumpNum)(sfxinfo_t *sfxinfo);
+
+ // Called periodically to update the subsystem.
+
+ void (*Update)(void);
+
+ // Update the sound settings on the given channel.
+
+ void (*UpdateSoundParams)(int channel, int vol, int sep);
+
+ // Start a sound on a given channel. Returns the channel id
+ // or -1 on failure.
+
+ int (*StartSound)(int id, int channel, int vol, int sep);
+
+ // Stop the sound playing on the given channel.
+
+ void (*StopSound)(int channel);
+
+ // Query if a sound is playing on the given channel
+
+ boolean (*SoundIsPlaying)(int channel);
+
+} sound_module_t;
+
extern int snd_sfxdevice;
extern int snd_musicdevice;
+extern int snd_samplerate;
//
// Initializes sound stuff, including volume