aboutsummaryrefslogtreecommitdiff
path: root/sound/mixer.cpp
diff options
context:
space:
mode:
authorJames Brown2002-10-02 10:12:19 +0000
committerJames Brown2002-10-02 10:12:19 +0000
commitb7e83decd7b02ce783c3f5a6f8c2075af4851e19 (patch)
tree9fe721d28591f4a66bc0e600867c4d862408189b /sound/mixer.cpp
parent39a5160985555adda2364ced1cb02cc2dc95965a (diff)
downloadscummvm-rg350-b7e83decd7b02ce783c3f5a6f8c2075af4851e19.tar.gz
scummvm-rg350-b7e83decd7b02ce783c3f5a6f8c2075af4851e19.tar.bz2
scummvm-rg350-b7e83decd7b02ce783c3f5a6f8c2075af4851e19.zip
Fix 'isSoundRunning' for Creative samples (eg, Full Throttle)
svn-id: r5072
Diffstat (limited to 'sound/mixer.cpp')
-rw-r--r--sound/mixer.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/sound/mixer.cpp b/sound/mixer.cpp
index ef5c40af33..c19facc3d9 100644
--- a/sound/mixer.cpp
+++ b/sound/mixer.cpp
@@ -84,11 +84,21 @@ int SoundMixer::insertAt(PlayingSoundHandle * handle, int index, Channel * chan)
return index;
}
-int SoundMixer::playRaw(PlayingSoundHandle * handle, void * sound, uint32 size, uint rate,
- byte flags) {
+int SoundMixer::playRaw(PlayingSoundHandle * handle, void * sound, uint32 size, uint rate, byte flags) {
for (int i = 0; i != NUM_CHANNELS; i++) {
if (_channels[i] == NULL) {
- return insertAt(handle, i, new ChannelRaw(this, sound, size, rate, flags));
+ return insertAt(handle, i, new ChannelRaw(this, sound, size, rate, flags, -1));
+ }
+ }
+
+ warning("SoundMixer::out of mixer slots");
+ return -1;
+}
+
+int SoundMixer::playRaw(PlayingSoundHandle * handle, void * sound, uint32 size, uint rate, byte flags, int id) {
+ for (int i = 0; i != NUM_CHANNELS; i++) {
+ if (_channels[i] == NULL) {
+ return insertAt(handle, i, new ChannelRaw(this, sound, size, rate, flags, id));
}
}
@@ -239,8 +249,8 @@ void SoundMixer::Channel::append(void * sound, uint32 size) {
}
/* RAW mixer */
-SoundMixer::ChannelRaw::ChannelRaw(SoundMixer * mixer, void * sound, uint32 size, uint rate,
- byte flags) {
+SoundMixer::ChannelRaw::ChannelRaw(SoundMixer * mixer, void * sound, uint32 size, uint rate, byte flags, int id) {
+ _id = id;
_mixer = mixer;
_flags = flags;
_ptr = sound;