summaryrefslogtreecommitdiff
path: root/src/s_sound.h
diff options
context:
space:
mode:
authorSimon Howard2007-06-17 19:19:37 +0000
committerSimon Howard2007-06-17 19:19:37 +0000
commitd0d179940306ba2c7f20cbe45c794a1f6a282ecf (patch)
tree8b5b1b22b64f6194fbeb720bc8043e66757d6a7b /src/s_sound.h
parentbeab4eb58b667a5883166bd1dd7bc33369a005c7 (diff)
downloadchocolate-doom-d0d179940306ba2c7f20cbe45c794a1f6a282ecf.tar.gz
chocolate-doom-d0d179940306ba2c7f20cbe45c794a1f6a282ecf.tar.bz2
chocolate-doom-d0d179940306ba2c7f20cbe45c794a1f6a282ecf.zip
Make the music code modular as well, although for the time being there
is only one module. Remove s_dummy.c. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 914
Diffstat (limited to 'src/s_sound.h')
-rw-r--r--src/s_sound.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/s_sound.h b/src/s_sound.h
index 8a5e2c6c..67071338 100644
--- a/src/s_sound.h
+++ b/src/s_sound.h
@@ -45,8 +45,12 @@ typedef enum
SNDDEVICE_AWE32 = 9,
} snddevice_t;
+// Interface for sound modules
+
typedef struct
{
+ // List of sound devices that this sound module is used for.
+
snddevice_t *sound_devices;
int num_sound_devices;
@@ -86,6 +90,57 @@ typedef struct
} sound_module_t;
+// Interface for music modules
+
+typedef struct
+{
+ // List of sound devices that this music module is used for.
+
+ snddevice_t *sound_devices;
+ int num_sound_devices;
+
+ // Initialise the music subsystem
+
+ boolean (*Init)(void);
+
+ // Shutdown the music subsystem
+
+ void (*Shutdown)(void);
+
+ // Set music volume - range 0-127
+
+ void (*SetMusicVolume)(int volume);
+
+ // Pause music
+
+ void (*PauseMusic)(void);
+
+ // Un-pause music
+
+ void (*ResumeMusic)(void);
+
+ // Register a song handle from data
+ // Returns a handle that can be used to play the song
+
+ void *(*RegisterSong)(void *data, int len);
+
+ // Un-register (free) song data
+
+ void (*UnRegisterSong)(void *handle);
+
+ // Play the song
+
+ void (*PlaySong)(void *handle, int looping);
+
+ // Stop playing the current song.
+
+ void (*StopSong)(void);
+
+ // Query if music is playing.
+
+ boolean (*MusicIsPlaying)(void);
+} music_module_t;
+
extern int snd_sfxdevice;
extern int snd_musicdevice;
extern int snd_samplerate;