aboutsummaryrefslogtreecommitdiff
path: root/sound/mixer.h
diff options
context:
space:
mode:
authorMax Horn2003-03-18 21:46:44 +0000
committerMax Horn2003-03-18 21:46:44 +0000
commit80e3c23482fbcea15b545f001d983c7657263761 (patch)
tree81fd73cd151ccea0520a5713026084e24a8e22ba /sound/mixer.h
parent4cdfd9c2beae3de73a9ee19ae1db8609b8667e6c (diff)
downloadscummvm-rg350-80e3c23482fbcea15b545f001d983c7657263761.tar.gz
scummvm-rg350-80e3c23482fbcea15b545f001d983c7657263761.tar.bz2
scummvm-rg350-80e3c23482fbcea15b545f001d983c7657263761.zip
cleanup; add stopID method to stop a currently playing sound via its ID
svn-id: r6835
Diffstat (limited to 'sound/mixer.h')
-rw-r--r--sound/mixer.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/sound/mixer.h b/sound/mixer.h
index acf6e9e051..61ef5553a6 100644
--- a/sound/mixer.h
+++ b/sound/mixer.h
@@ -46,6 +46,7 @@ private:
public:
bool _toBeDestroyed;
int _id;
+ Channel() : _id(-1) {}
virtual void mix(int16 *data, uint len) = 0;
void destroy() {
_toBeDestroyed = true;
@@ -196,16 +197,14 @@ public:
// start playing a raw sound
enum {
// Do *NOT* change any of these flags without looking at the code in mixer.cpp
- FLAG_UNSIGNED = 1, // unsigned samples
- FLAG_STEREO = 2, // sound is in stereo
- FLAG_16BITS = 4, // sound is 16 bits wide
- FLAG_AUTOFREE = 8, // sound buffer is freed automagically at the end of playing
- FLAG_FILE = 16, // sound is a FILE * that's read from
- FLAG_REVERSE_STEREO = 32, // sound should be reverse stereo
- FLAG_LOOP = 64 // loop the audio
+ FLAG_UNSIGNED = 1 << 0, // unsigned samples
+ FLAG_STEREO = 1 << 1, // sound is in stereo
+ FLAG_16BITS = 1 << 2, // sound is 16 bits wide
+ FLAG_AUTOFREE = 1 << 3, // sound buffer is freed automagically at the end of playing
+ FLAG_REVERSE_STEREO = 1 << 4, // sound should be reverse stereo
+ FLAG_LOOP = 1 << 5 // loop the audio
};
- int playRaw(PlayingSoundHandle *handle, void *sound, uint32 size, uint rate, byte flags);
- int playRaw(PlayingSoundHandle *handle, void *sound, uint32 size, uint rate, byte flags, int id);
+ int playRaw(PlayingSoundHandle *handle, void *sound, uint32 size, uint rate, byte flags, int id = -1);
int playStream(PlayingSoundHandle *handle, int index, void *sound, uint32 size, uint rate,
byte flags, int32 timeout = 3, int32 buffer_size = 2000000);
#ifdef USE_MAD
@@ -228,6 +227,9 @@ public:
/* stop playing a specific sound */
void stop(int index);
+ /* stop playing a specific sound */
+ void stopID(int id);
+
/* append to existing sound */
int append(int index, void * sound, uint32 size, uint rate, byte flags);