diff options
author | Scott Thomas | 2011-04-13 22:22:19 +0930 |
---|---|---|
committer | Scott Thomas | 2011-04-13 22:22:19 +0930 |
commit | 47c2a9adbe8d9e6640a819386f0f34e929937672 (patch) | |
tree | 68b8fe5e8fd1e21958db7eee816c1fe7e79c1415 | |
parent | f54769f9878f32564498bc7c47dfa8db498f52ca (diff) | |
download | scummvm-rg350-47c2a9adbe8d9e6640a819386f0f34e929937672.tar.gz scummvm-rg350-47c2a9adbe8d9e6640a819386f0f34e929937672.tar.bz2 scummvm-rg350-47c2a9adbe8d9e6640a819386f0f34e929937672.zip |
GROOVIE: MPEG4 player should override unload so scripts can stop music
-rw-r--r-- | engines/groovie/music.cpp | 10 | ||||
-rw-r--r-- | engines/groovie/music.h | 1 |
2 files changed, 7 insertions, 4 deletions
diff --git a/engines/groovie/music.cpp b/engines/groovie/music.cpp index 79b7fe1300..7195198a6c 100644 --- a/engines/groovie/music.cpp +++ b/engines/groovie/music.cpp @@ -777,11 +777,14 @@ void MusicPlayerMPEG4::updateVolume() { _vm->_system->getMixer()->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, _userVolume * _gameVolume / 100); } -bool MusicPlayerMPEG4::load(uint32 fileref, bool loop) { - // Stop any old sound +void MusicPlayerMPEG4::unload() { + MusicPlayer::unload(); + _vm->_system->getMixer()->stopHandle(_handle); +} - // Find the filename +bool MusicPlayerMPEG4::load(uint32 fileref, bool loop) { + // Find correct filename ResInfo info; _vm->_resMan->getResInfo(fileref, info); uint len = info.filename.size(); @@ -804,7 +807,6 @@ bool MusicPlayerMPEG4::load(uint32 fileref, bool loop) { Audio::AudioStream *audStream = Audio::makeQuickTimeStream(info.filename); if (!audStream) { - // MPEG-4 sounds aren't handled yet, so nothing should play here yet warning("Could not play MPEG-4 sound '%s'", info.filename.c_str()); return false; } diff --git a/engines/groovie/music.h b/engines/groovie/music.h index 2b91cb11eb..cdf67cab44 100644 --- a/engines/groovie/music.h +++ b/engines/groovie/music.h @@ -173,6 +173,7 @@ public: protected: void updateVolume(); bool load(uint32 fileref, bool loop); + void unload(); private: Audio::SoundHandle _handle; |