diff options
author | D G Turner | 2012-12-16 16:44:34 +0000 |
---|---|---|
committer | D G Turner | 2012-12-16 16:44:34 +0000 |
commit | c14f45ee0544254ffeca5cde4d92cd99efdff4b6 (patch) | |
tree | 8417bdc94687f867363a416dddd67e646a2314f1 /engines/touche | |
parent | 74cd6a4d269b1a0504f8ceada779ef28d89875a2 (diff) | |
download | scummvm-rg350-c14f45ee0544254ffeca5cde4d92cd99efdff4b6.tar.gz scummvm-rg350-c14f45ee0544254ffeca5cde4d92cd99efdff4b6.tar.bz2 scummvm-rg350-c14f45ee0544254ffeca5cde4d92cd99efdff4b6.zip |
TOUCHE: Simplify external digital music support slightly.
Checked with valgrind and no leaks are evident.
Thanks to LordHoto for suggesting these changes.
Diffstat (limited to 'engines/touche')
-rw-r--r-- | engines/touche/touche.cpp | 9 | ||||
-rw-r--r-- | engines/touche/touche.h | 1 |
2 files changed, 4 insertions, 6 deletions
diff --git a/engines/touche/touche.cpp b/engines/touche/touche.cpp index d03425a69f..5c133ccbc6 100644 --- a/engines/touche/touche.cpp +++ b/engines/touche/touche.cpp @@ -3342,13 +3342,12 @@ void ToucheEngine::startMusic(int num) { _midiPlayer->play(_fData, size, true); } else { Common::String extMusicFilename = Common::String::format("track%02d", num); - _extMusicFileStream = Audio::SeekableAudioStream::openStreamFile(extMusicFilename); - if (!_extMusicFileStream) { + Audio::SeekableAudioStream *extMusicFileStream = Audio::SeekableAudioStream::openStreamFile(extMusicFilename); + if (!extMusicFileStream) { error("Unable to open %s for reading", extMusicFilename.c_str()); } - Audio::LoopingAudioStream *loopStream = new Audio::LoopingAudioStream(_extMusicFileStream, 0); - _mixer->playStream(Audio::Mixer::kMusicSoundType, &_musicHandle, loopStream); - _mixer->setChannelVolume(_musicHandle, _musicVolume); + Audio::LoopingAudioStream *loopStream = new Audio::LoopingAudioStream(extMusicFileStream, 0); + _mixer->playStream(Audio::Mixer::kMusicSoundType, &_musicHandle, loopStream, -1, _musicVolume); } } diff --git a/engines/touche/touche.h b/engines/touche/touche.h index 7901d0f1b6..6ac43e7dfe 100644 --- a/engines/touche/touche.h +++ b/engines/touche/touche.h @@ -649,7 +649,6 @@ protected: int _musicVolume; Audio::SoundHandle _musicHandle; - Audio::SeekableAudioStream *_extMusicFileStream; void initMusic(); public: // To allow access from console |