aboutsummaryrefslogtreecommitdiff
path: root/engines/lastexpress/data/snd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/lastexpress/data/snd.cpp')
-rw-r--r--engines/lastexpress/data/snd.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/engines/lastexpress/data/snd.cpp b/engines/lastexpress/data/snd.cpp
index d92ebbc5e3..fa2d8a2e51 100644
--- a/engines/lastexpress/data/snd.cpp
+++ b/engines/lastexpress/data/snd.cpp
@@ -103,7 +103,8 @@ void SimpleSound::play(Audio::AudioStream *as) {
//////////////////////////////////////////////////////////////////////////
// StreamedSound
//////////////////////////////////////////////////////////////////////////
-StreamedSound::StreamedSound() {}
+StreamedSound::StreamedSound() : _loaded(false) {}
+
StreamedSound::~StreamedSound() {}
bool StreamedSound::load(Common::SeekableReadStream *stream) {
@@ -120,9 +121,18 @@ bool StreamedSound::load(Common::SeekableReadStream *stream) {
// Start playing the decoded audio stream
play(as);
+ _loaded = true;
+
return true;
}
+bool StreamedSound::isFinished() {
+ if (!_loaded)
+ return false;
+
+ return !g_system->getMixer()->isSoundHandleActive(_handle);
+}
+
//////////////////////////////////////////////////////////////////////////
// StreamedSound
//////////////////////////////////////////////////////////////////////////
@@ -172,4 +182,8 @@ void AppendableSound::finish() {
_finished = true;
}
+bool AppendableSound::isFinished() {
+ return _as->endOfStream();
+}
+
} // End of namespace LastExpress