aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorAlyssa Milburn2011-03-29 21:18:55 +0200
committerAlyssa Milburn2011-03-29 21:18:55 +0200
commitfeefced3ce98232c6c31a4ae482949c99ad6764c (patch)
treedb1fa385c1788bf12958829e2474812b5c26100d /engines
parentfe613524e5f93b2f66613ef2e77608407eba2dd6 (diff)
downloadscummvm-rg350-feefced3ce98232c6c31a4ae482949c99ad6764c.tar.gz
scummvm-rg350-feefced3ce98232c6c31a4ae482949c99ad6764c.tar.bz2
scummvm-rg350-feefced3ce98232c6c31a4ae482949c99ad6764c.zip
MOHAWK: Add Sound::isPlaying() function.
Diffstat (limited to 'engines')
-rw-r--r--engines/mohawk/sound.cpp9
-rw-r--r--engines/mohawk/sound.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/engines/mohawk/sound.cpp b/engines/mohawk/sound.cpp
index 14457546b2..b4ae50b74a 100644
--- a/engines/mohawk/sound.cpp
+++ b/engines/mohawk/sound.cpp
@@ -576,6 +576,15 @@ bool Sound::isPlaying(uint16 id) {
return false;
}
+bool Sound::isPlaying() {
+ for (uint32 i = 0; i < _handles.size(); i++)
+ if (_handles[i].type == kUsedHandle)
+ if (_vm->_mixer->isSoundHandleActive(_handles[i].handle))
+ return true;
+
+ return false;
+}
+
uint Sound::getNumSamplesPlayed(uint16 id) {
for (uint32 i = 0; i < _handles.size(); i++)
if (_handles[i].type == kUsedHandle && _handles[i].id == id) {
diff --git a/engines/mohawk/sound.h b/engines/mohawk/sound.h
index 3135b1dcd9..702c6f61f3 100644
--- a/engines/mohawk/sound.h
+++ b/engines/mohawk/sound.h
@@ -133,6 +133,7 @@ public:
void pauseSound();
void resumeSound();
bool isPlaying(uint16 id);
+ bool isPlaying();
uint getNumSamplesPlayed(uint16 id);
// Myst-specific sound functions