From c14f45ee0544254ffeca5cde4d92cd99efdff4b6 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Sun, 16 Dec 2012 16:44:34 +0000 Subject: TOUCHE: Simplify external digital music support slightly. Checked with valgrind and no leaks are evident. Thanks to LordHoto for suggesting these changes. --- engines/touche/touche.cpp | 9 ++++----- engines/touche/touche.h | 1 - 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'engines/touche') 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 -- cgit v1.2.3