MOHAWK: Add Sound::isPlaying() function.

This commit is contained in:
Alyssa Milburn 2011-03-29 21:18:55 +02:00
parent fe613524e5
commit feefced3ce
2 changed files with 10 additions and 0 deletions

View file

@ -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) {

View file

@ -133,6 +133,7 @@ public:
void pauseSound();
void resumeSound();
bool isPlaying(uint16 id);
bool isPlaying();
uint getNumSamplesPlayed(uint16 id);
// Myst-specific sound functions