aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorTravis Howell2005-04-04 11:43:25 +0000
committerTravis Howell2005-04-04 11:43:25 +0000
commitf230fe65e8b035d3bcbf3a45317cf56ac673fdfe (patch)
tree6de886f11751b849dfec6de3b695cd5410efba1d /sound
parentd08068dff1ea02314d791c1248d72091d4d5d9e9 (diff)
downloadscummvm-rg350-f230fe65e8b035d3bcbf3a45317cf56ac673fdfe.tar.gz
scummvm-rg350-f230fe65e8b035d3bcbf3a45317cf56ac673fdfe.tar.bz2
scummvm-rg350-f230fe65e8b035d3bcbf3a45317cf56ac673fdfe.zip
Add 8 sound channel support for HE games
-Allows sound looping to work Added support for WAVE format musuc used in later HE100 games. svn-id: r17372
Diffstat (limited to 'sound')
-rw-r--r--sound/mixer.cpp8
-rw-r--r--sound/mixer.h10
2 files changed, 17 insertions, 1 deletions
diff --git a/sound/mixer.cpp b/sound/mixer.cpp
index 1785f937ae..f9f0e32316 100644
--- a/sound/mixer.cpp
+++ b/sound/mixer.cpp
@@ -367,6 +367,14 @@ bool SoundMixer::isSoundIDActive(int id) {
return false;
}
+int SoundMixer::getActiveChannelSoundID(SoundHandle handle) {
+ Common::StackLock lock(_mutex);
+ const int index = handle._val % NUM_CHANNELS;
+ if (_channels[index])
+ return _channels[index]->getId();
+ return 0;
+}
+
bool SoundMixer::isSoundHandleActive(SoundHandle handle) {
Common::StackLock lock(_mutex);
const int index = handle._val % NUM_CHANNELS;
diff --git a/sound/mixer.h b/sound/mixer.h
index 48aea32e49..6b888af247 100644
--- a/sound/mixer.h
+++ b/sound/mixer.h
@@ -205,9 +205,17 @@ public:
bool isSoundIDActive(int id);
/**
+ * Get the sound ID of handle sound
+ *
+ * @param handle sound to query
+ * @return sound ID if active
+ */
+ int getActiveChannelSoundID(SoundHandle handle);
+
+ /**
* Check if a sound with the given hANDLE is active.
*
- * @param handle the sound to query
+ * @param handle sound to query
* @return true if the sound is active
*/
bool isSoundHandleActive(SoundHandle handle);