diff options
author | Littleboy | 2011-06-29 10:26:04 -0400 |
---|---|---|
committer | Littleboy | 2011-06-29 11:07:28 -0400 |
commit | 2788cb8bf72f0897a8bed32fbb5730f892b10edf (patch) | |
tree | ad873e2f02064adf23e47c22d29e794c2d9a38b5 /engines/lastexpress/data/snd.cpp | |
parent | 4526bbb5b63c40a365abf5f150bfbd29cbff32c9 (diff) | |
download | scummvm-rg350-2788cb8bf72f0897a8bed32fbb5730f892b10edf.tar.gz scummvm-rg350-2788cb8bf72f0897a8bed32fbb5730f892b10edf.tar.bz2 scummvm-rg350-2788cb8bf72f0897a8bed32fbb5730f892b10edf.zip |
LASTEXPRESS: Update sound timer and sound entry playing
- Move filtering to SoundEntry class
- Make some methods of SoundEntry class private
- Add methods to check if a StreamedSound/AppendableSound is done playing
Diffstat (limited to 'engines/lastexpress/data/snd.cpp')
-rw-r--r-- | engines/lastexpress/data/snd.cpp | 16 |
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 |