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

eriktorbjorn eriktorbjorn at telia.com
Wed Sep 16 22:11:36 CEST 2015


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:
d227e40e53 SHERLOCK: Play rain sound during 3DO Scalpel intro


Commit: d227e40e53f5458d2055fcb855557c448d405f6b
    https://github.com/scummvm/scummvm/commit/d227e40e53f5458d2055fcb855557c448d405f6b
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2015-09-16T22:09:08+02:00

Commit Message:
SHERLOCK: Play rain sound during 3DO Scalpel intro

This is based on guesswork, particularly with regards to the volume.
It sounds pretty close to a YouTube video I saw of the original game,
and at least it's not unpleasantly loud.

Changed paths:
    engines/sherlock/scalpel/scalpel.cpp
    engines/sherlock/sound.cpp
    engines/sherlock/sound.h



diff --git a/engines/sherlock/scalpel/scalpel.cpp b/engines/sherlock/scalpel/scalpel.cpp
index 086d607..17e60f5 100644
--- a/engines/sherlock/scalpel/scalpel.cpp
+++ b/engines/sherlock/scalpel/scalpel.cpp
@@ -690,15 +690,16 @@ bool ScalpelEngine::showCityCutscene3DO() {
 	screen.clear();
 	bool finished = _events->delay(2500, true);
 
-	// rain.aiff seems to be playing in an endless loop until
-	// sherlock logo fades away TODO
-
 	if (finished) {
 		finished = _events->delay(2500, true);
 
 		// Play intro music
 		_music->loadSong("prolog");
 
+		// Loop rain.aiff until the Sherlock logo fades away.
+		// TODO: The volume is just a guess.
+		_sound->playAiff("prologue/sounds/rain.aiff", 15, true);
+
 		// Fade screen to grey
 		screen._backBuffer1.fill(0xCE59); // RGB565: 25, 50, 25 (grey)
 		screen.fadeIntoScreen3DO(2);
@@ -763,6 +764,8 @@ bool ScalpelEngine::showCityCutscene3DO() {
 	if (finished)
 		finished = _music->waitUntilMSec(33600, 0, 0, 2000);
 
+	_sound->stopAiff();
+
 	if (finished) {
 		// Fade to black
 		screen._backBuffer1.clear();
diff --git a/engines/sherlock/sound.cpp b/engines/sherlock/sound.cpp
index fd51462..66b5b5b 100644
--- a/engines/sherlock/sound.cpp
+++ b/engines/sherlock/sound.cpp
@@ -168,6 +168,30 @@ bool Sound::playSound(const Common::String &name, WaitType waitType, int priorit
 	return retval;
 }
 
+void Sound::playAiff(const Common::String &name, int volume, bool loop) {
+	Common::File *file = new Common::File();
+	if (!file->open(name)) {
+		delete file;
+		return;
+	}
+	Audio::AudioStream *stream;
+	Audio::RewindableAudioStream *audioStream = Audio::makeAIFFStream(file, DisposeAfterUse::YES);
+	if (loop) {
+		Audio::AudioStream *loopingStream = Audio::makeLoopingAudioStream(audioStream, 0);
+		stream = loopingStream;
+	} else {
+		stream = audioStream;
+	}
+	stopAiff();
+	_mixer->playStream(Audio::Mixer::kSFXSoundType, &_aiffHandle, stream, -1, volume);
+}
+
+void Sound::stopAiff() {
+	if (_mixer->isSoundHandleActive(_aiffHandle)) {
+		_mixer->stopHandle(_aiffHandle);
+	}
+}
+
 void Sound::playLoadedSound(int bufNum, WaitType waitType) {
 	if (IS_SERRATED_SCALPEL) {
 		if (_mixer->isSoundHandleActive(_scalpelEffectsHandle) && (_curPriority > _vm->_scene->_sounds[bufNum]._priority))
diff --git a/engines/sherlock/sound.h b/engines/sherlock/sound.h
index b2d1584..44969b8 100644
--- a/engines/sherlock/sound.h
+++ b/engines/sherlock/sound.h
@@ -46,6 +46,7 @@ private:
 	SherlockEngine *_vm;
 	Audio::Mixer *_mixer;
 	Audio::SoundHandle _scalpelEffectsHandle;
+	Audio::SoundHandle _aiffHandle;
 	Audio::SoundHandle _tattooEffectsHandle[MAX_MIXER_CHANNELS];
 	Audio::SoundHandle _speechHandle;
 	int _curPriority;
@@ -87,6 +88,16 @@ public:
 	 * Play the sound in the specified resource
 	 */
 	bool playSound(const Common::String &name, WaitType waitType, int priority = 100, const char *libraryFilename = nullptr);
+
+	/**
+	 * Play the specified AIFF file. (Used for the 3DO Scalpel intro.)
+	 */
+	void playAiff(const Common::String &name, int volume = Audio::Mixer::kMaxChannelVolume, bool loop = false);
+
+	/**
+	 * Stop the AIFF sound that was started with playAiff().
+	 */
+	void stopAiff();
 	
 	/**
 	 * Play a previously loaded sound






More information about the Scummvm-git-logs mailing list