[Scummvm-cvs-logs] scummvm master -> c14f45ee0544254ffeca5cde4d92cd99efdff4b6

digitall dgturner at iee.org
Sun Dec 16 17:45:51 CET 2012


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
c14f45ee05 TOUCHE: Simplify external digital music support slightly.


Commit: c14f45ee0544254ffeca5cde4d92cd99efdff4b6
    https://github.com/scummvm/scummvm/commit/c14f45ee0544254ffeca5cde4d92cd99efdff4b6
Author: D G Turner (digitall at scummvm.org)
Date: 2012-12-16T08:44:34-08:00

Commit Message:
TOUCHE: Simplify external digital music support slightly.

Checked with valgrind and no leaks are evident.
Thanks to LordHoto for suggesting these changes.

Changed paths:
    engines/touche/touche.cpp
    engines/touche/touche.h



diff --git a/engines/touche/touche.cpp b/engines/touche/touche.cpp
index d03425a..5c133cc 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 7901d0f..6ac43e7 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






More information about the Scummvm-git-logs mailing list