[Scummvm-git-logs] scummvm master -> b5b5c4f341530c41c73cc0d97e7ddae9cbc1d926

sev- sev at scummvm.org
Fri Nov 25 18:53:31 CET 2016


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

Summary:
4d8cc0db68 FULLPIPE: Correctly restart scene audio tracks
1523f987c3 FULLPIPE: Added 4 sound channels like in original
b5b5c4f341 FULLPIPE: Start final music


Commit: 4d8cc0db680184d9a38d13d35d89e26dc02beabc
    https://github.com/scummvm/scummvm/commit/4d8cc0db680184d9a38d13d35d89e26dc02beabc
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-11-25T18:53:16+01:00

Commit Message:
FULLPIPE: Correctly restart scene audio tracks

Changed paths:
    engines/fullpipe/sound.cpp



diff --git a/engines/fullpipe/sound.cpp b/engines/fullpipe/sound.cpp
index cd66471..4ec8dd0 100644
--- a/engines/fullpipe/sound.cpp
+++ b/engines/fullpipe/sound.cpp
@@ -306,6 +306,13 @@ void FullpipeEngine::setSceneMusicParameters(GameVar *gvar) {
 }
 
 void FullpipeEngine::startSceneTrack() {
+	if (_sceneTrackIsPlaying) {
+		if (!_mixer->isSoundHandleActive(*_sceneTrackHandle)) { // Simulate end of sound callback
+			_sceneTrackIsPlaying = false;
+			_trackStartDelay = _musicMinDelay + (_musicMaxDelay - _musicMinDelay) * (_updateTicks % 10) / 9;
+		}
+	}
+
 	if (!_sceneTrackIsPlaying && _numSceneTracks > 0) {
 		if (_trackStartDelay > 0) {
 			_trackStartDelay--;


Commit: 1523f987c38cdebcaa351ef1e05f3f7e81a9ce92
    https://github.com/scummvm/scummvm/commit/1523f987c38cdebcaa351ef1e05f3f7e81a9ce92
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-11-25T18:53:16+01:00

Commit Message:
FULLPIPE: Added 4 sound channels like in original

Changed paths:
    engines/fullpipe/fullpipe.cpp
    engines/fullpipe/fullpipe.h
    engines/fullpipe/sound.cpp



diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp
index 2250a5d..8a9b323 100644
--- a/engines/fullpipe/fullpipe.cpp
+++ b/engines/fullpipe/fullpipe.cpp
@@ -123,7 +123,12 @@ FullpipeEngine::FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc)
 	_musicLocal = 0;
 	_trackStartDelay = 0;
 
-	_sceneTrackHandle = new Audio::SoundHandle();
+	_soundStream1 = new Audio::SoundHandle();
+	_soundStream2 = new Audio::SoundHandle();
+	_soundStream3 = new Audio::SoundHandle();
+	_soundStream4 = new Audio::SoundHandle();
+
+	_stream2playing = false;
 
 	memset(_sceneTracks, 0, sizeof(_sceneTracks));
 	memset(_trackName, 0, sizeof(_trackName));
@@ -205,7 +210,10 @@ FullpipeEngine::~FullpipeEngine() {
 	delete _rnd;
 	delete _console;
 	delete _globalMessageQueueList;
-	delete _sceneTrackHandle;
+	delete _soundStream1;
+	delete _soundStream2;
+	delete _soundStream3;
+	delete _soundStream4;
 }
 
 void FullpipeEngine::initialize() {
diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h
index d8f438b..9b755a6 100644
--- a/engines/fullpipe/fullpipe.h
+++ b/engines/fullpipe/fullpipe.h
@@ -182,6 +182,7 @@ public:
 	void playSound(int id, int flag);
 	void playTrack(GameVar *sceneVar, const char *name, bool delayed);
 	int getSceneTrack();
+	void updateTrackDelay();
 	void startSceneTrack();
 	void startSoundStream1(char *trackName);
 	void stopSoundStream2();
@@ -327,7 +328,12 @@ public:
 	void lift_openLift();
 
 	GameVar *_musicGameVar;
-	Audio::SoundHandle *_sceneTrackHandle;
+	Audio::SoundHandle *_soundStream1;
+	Audio::SoundHandle *_soundStream2;
+	Audio::SoundHandle *_soundStream3;
+	Audio::SoundHandle *_soundStream4;
+
+	bool _stream2playing;
 
 public:
 
diff --git a/engines/fullpipe/sound.cpp b/engines/fullpipe/sound.cpp
index 4ec8dd0..0c3eb02 100644
--- a/engines/fullpipe/sound.cpp
+++ b/engines/fullpipe/sound.cpp
@@ -249,9 +249,9 @@ void Sound::stop() {
 
 void FullpipeEngine::setSceneMusicParameters(GameVar *gvar) {
 	warning("STUB: FullpipeEngine::setSceneMusicParameters()");
-#if 0
 	stopSoundStream2();
 
+#if 0
 	if (soundStream3)
 		FSOUND_Stream_Stop(soundStream4);
 #endif
@@ -305,11 +305,15 @@ void FullpipeEngine::setSceneMusicParameters(GameVar *gvar) {
 		_trackStartDelay = var->getSubVarAsInt("STARTDELAY");
 }
 
+void FullpipeEngine::updateTrackDelay() {
+	_sceneTrackIsPlaying = false;
+	_trackStartDelay = _musicMinDelay + (_musicMaxDelay - _musicMinDelay) * (_updateTicks % 10) / 9;
+}
+
 void FullpipeEngine::startSceneTrack() {
 	if (_sceneTrackIsPlaying) {
-		if (!_mixer->isSoundHandleActive(*_sceneTrackHandle)) { // Simulate end of sound callback
-			_sceneTrackIsPlaying = false;
-			_trackStartDelay = _musicMinDelay + (_musicMaxDelay - _musicMinDelay) * (_updateTicks % 10) / 9;
+		if (!_mixer->isSoundHandleActive(*_soundStream1)) { // Simulate end of sound callback
+			updateTrackDelay();
 		}
 	}
 
@@ -369,7 +373,7 @@ void FullpipeEngine::startSoundStream1(char *trackName) {
 	stopAllSoundStreams();
 
 #ifdef USE_VORBIS
-	if (_mixer->isSoundHandleActive(*_sceneTrackHandle))
+	if (_mixer->isSoundHandleActive(*_soundStream1))
 		return;
 
 	Common::File *track = new Common::File();
@@ -379,17 +383,17 @@ void FullpipeEngine::startSoundStream1(char *trackName) {
 		return;
 	}
 	Audio::RewindableAudioStream *ogg = Audio::makeVorbisStream(track, DisposeAfterUse::YES);
-	_mixer->playStream(Audio::Mixer::kMusicSoundType, _sceneTrackHandle, ogg);
+	_mixer->playStream(Audio::Mixer::kMusicSoundType, _soundStream1, ogg);
 #endif
 }
 
 void FullpipeEngine::stopAllSounds() {
-	// _mixer->stopAll();
+	_mixer->stopHandle(*_soundStream1);
+	_mixer->stopHandle(*_soundStream2);
+	_mixer->stopHandle(*_soundStream3);
+	_mixer->stopHandle(*_soundStream4);
 
-	for (int i = 0; i < _currSoundListCount; i++)
-		for (int j = 0; j < _currSoundList1[i]->getCount(); j++) {
-			_currSoundList1[i]->getSoundByIndex(j)->stop();
-		}
+	_stream2playing = false;
 }
 
 void FullpipeEngine::toggleMute() {
@@ -420,9 +424,9 @@ void FullpipeEngine::playSound(int id, int flag) {
 
 void FullpipeEngine::playTrack(GameVar *sceneVar, const char *name, bool delayed) {
 	warning("STUB: FullpipeEngine::playTrack(var, %s, %d)", name, delayed);
-#if 0
 	stopSoundStream2();
 
+#if 0
 	if (soundStream3)
 		FSOUND_Stream_Stop(soundStream4);
 #endif
@@ -511,10 +515,17 @@ void global_messageHandler_handleSound(ExCommand *cmd) {
 }
 
 void FullpipeEngine::stopSoundStream2() {
-	warning("STUB: FullpipeEngine::stopSoundStream2()");
+	_stream2playing = false;
+
+	if (_mixer->isSoundHandleActive(*_soundStream3)) {
+		_mixer->stopHandle(*_soundStream2);
+		_mixer->stopHandle(*_soundStream3);
+	}
 }
 
 void FullpipeEngine::stopAllSoundStreams() {
+	warning("STUB: stopAllSoundStreams()");
+
 	// TODO: Differences from stopAllSounds()
 	_mixer->stopAll();
 }


Commit: b5b5c4f341530c41c73cc0d97e7ddae9cbc1d926
    https://github.com/scummvm/scummvm/commit/b5b5c4f341530c41c73cc0d97e7ddae9cbc1d926
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-11-25T18:53:16+01:00

Commit Message:
FULLPIPE: Start final music

Changed paths:
    engines/fullpipe/scenes/sceneFinal.cpp
    engines/fullpipe/sound.cpp



diff --git a/engines/fullpipe/scenes/sceneFinal.cpp b/engines/fullpipe/scenes/sceneFinal.cpp
index 8b3ecb1..beda340 100644
--- a/engines/fullpipe/scenes/sceneFinal.cpp
+++ b/engines/fullpipe/scenes/sceneFinal.cpp
@@ -70,8 +70,8 @@ void sceneHandlerFinal_endFinal() {
 	g_vars->sceneFinal_var01 = 0;
 }
 
-void sceneHandlerFinal_startMusic(const char *track) {
-	warning("STUB: sceneHandlerFinal_startMusic()");
+void sceneHandlerFinal_startMusic(char *track) {
+	g_fp->startSoundStream1(track);
 }
 
 void sceneHandlerFinal_goto4() {
diff --git a/engines/fullpipe/sound.cpp b/engines/fullpipe/sound.cpp
index 0c3eb02..e68115a 100644
--- a/engines/fullpipe/sound.cpp
+++ b/engines/fullpipe/sound.cpp
@@ -368,8 +368,6 @@ int FullpipeEngine::getSceneTrack() {
 }
 
 void FullpipeEngine::startSoundStream1(char *trackName) {
-	warning("STUB: FullpipeEngine::startSoundStream1(%s)", trackName);
-
 	stopAllSoundStreams();
 
 #ifdef USE_VORBIS





More information about the Scummvm-git-logs mailing list