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

dreammaster dreammaster at scummvm.org
Sat Oct 14 00:03:42 CEST 2017


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

Summary:
1d8ccbe1ea TITANIC: Cleanup of auto music player classes and messages
c339e3261d TITANIC: Renamed GlobalSound methods to AmbientSound


Commit: 1d8ccbe1eae59811c90d5a6a22870e97272e178d
    https://github.com/scummvm/scummvm/commit/1d8ccbe1eae59811c90d5a6a22870e97272e178d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-10-13T17:51:49-04:00

Commit Message:
TITANIC: Cleanup of auto music player classes and messages

Changed paths:
    engines/titanic/game/bridge_view.cpp
    engines/titanic/game/computer_screen.cpp
    engines/titanic/game/emma_control.cpp
    engines/titanic/messages/messages.h
    engines/titanic/sound/auto_music_player.cpp
    engines/titanic/sound/auto_music_player_base.cpp
    engines/titanic/sound/auto_music_player_base.h
    engines/titanic/sound/node_auto_sound_player.cpp
    engines/titanic/sound/restricted_auto_music_player.cpp
    engines/titanic/sound/seasonal_music_player.cpp
    engines/titanic/sound/trigger_auto_music_player.cpp
    engines/titanic/sound/view_auto_sound_player.cpp


diff --git a/engines/titanic/game/bridge_view.cpp b/engines/titanic/game/bridge_view.cpp
index 608724c..d98cee1 100644
--- a/engines/titanic/game/bridge_view.cpp
+++ b/engines/titanic/game/bridge_view.cpp
@@ -77,7 +77,7 @@ bool CBridgeView::ActMsg(CActMsg *msg) {
 			hideMouse();
 
 			CChangeMusicMsg musicMsg;
-			musicMsg._flags = 1;
+			musicMsg._action = MUSIC_STOP;
 			musicMsg.execute("BridgeAutoMusicPlayer");
 			playSound(TRANSLATE("a#42.wav", "a#35.wav"));
 			playMovie(MOVIE_NOTIFY_OBJECT);
diff --git a/engines/titanic/game/computer_screen.cpp b/engines/titanic/game/computer_screen.cpp
index dee469a..8150448 100644
--- a/engines/titanic/game/computer_screen.cpp
+++ b/engines/titanic/game/computer_screen.cpp
@@ -116,7 +116,7 @@ bool CComputerScreen::TimerMsg(CTimerMsg *msg) {
 		break;
 
 	case 2: {
-		CChangeMusicMsg musicMsg(CString(), 1);
+		CChangeMusicMsg musicMsg(CString(), MUSIC_STOP);
 		musicMsg.execute("HomeMusicPlayer");
 		playSound(TRANSLATE("a#33.wav", "a#28.wav"));
 		playSound(TRANSLATE("a#31.wav", "a#26.wav"));
diff --git a/engines/titanic/game/emma_control.cpp b/engines/titanic/game/emma_control.cpp
index e3ba7cc..46cde9b 100644
--- a/engines/titanic/game/emma_control.cpp
+++ b/engines/titanic/game/emma_control.cpp
@@ -57,7 +57,7 @@ bool CEmmaControl::EnterViewMsg(CEnterViewMsg *msg) {
 bool CEmmaControl::StatusChangeMsg(CStatusChangeMsg *msg) {
 	_flag = !_flag;
 	setVisible(_flag);
-	CChangeMusicMsg changeMsg(_flag ? _visibleSoundName : _hiddenSoundName, 0);
+	CChangeMusicMsg changeMsg(_flag ? _visibleSoundName : _hiddenSoundName, MUSIC_NONE);
 	changeMsg.execute(findRoom(), CAutoMusicPlayer::_type,
 		MSGFLAG_SCAN | MSGFLAG_BREAK_IF_HANDLED | MSGFLAG_CLASS_DEF);
 	return true;
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index 115976a..925898a 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -226,6 +226,9 @@ enum Movement {
 	MOVE_NONE = 0, MOVE_FORWARDS, MOVE_BACKWARDS, TURN_LEFT, TURN_RIGHT
 };
 
+enum ChangeMusicAction {
+	MUSIC_NONE = 0, MUSIC_STOP = 1, MUSIC_START = 2
+};
 
 class CMovementMsg : public CMessage {
 public:
@@ -258,7 +261,7 @@ MESSAGE0(CArmPickedUpFromTableMsg);
 MESSAGE0(CBodyInBilgeRoomMsg);
 MESSAGE1(CBowlStateChangeMsg, int, state, 0);
 MESSAGE2(CCarryObjectArrivedMsg, CString, strValue, "", int, numValue, 0);
-MESSAGE2(CChangeMusicMsg, CString, filename, "", int, flags, 0);
+MESSAGE2(CChangeMusicMsg, CString, filename, "", ChangeMusicAction, action, MUSIC_NONE);
 MESSAGE1(CChangeSeasonMsg, CString, season, "Summer");
 MESSAGE0(CCheckAllPossibleCodes);
 MESSAGE2(CCheckChevCode, int, classNum, 0, uint, chevCode, 0);
diff --git a/engines/titanic/sound/auto_music_player.cpp b/engines/titanic/sound/auto_music_player.cpp
index ce20c33..d77424c 100644
--- a/engines/titanic/sound/auto_music_player.cpp
+++ b/engines/titanic/sound/auto_music_player.cpp
@@ -47,7 +47,7 @@ void CAutoMusicPlayer::load(SimpleFile *file) {
 }
 
 bool CAutoMusicPlayer::EnterRoomMsg(CEnterRoomMsg *msg) {
-	if (!_isRepeated) {
+	if (!_isEnabled) {
 		CRoomItem *room = findRoom();
 		if (msg->_newRoom == room)
 			addTimer(2000);
@@ -57,11 +57,11 @@ bool CAutoMusicPlayer::EnterRoomMsg(CEnterRoomMsg *msg) {
 }
 
 bool CAutoMusicPlayer::LeaveRoomMsg(CLeaveRoomMsg *msg) {
-	if (_isRepeated) {
+	if (_isEnabled) {
 		CRoomItem *room = findRoom();
 		if (msg->_oldRoom == room) {
 			CChangeMusicMsg changeMsg;
-			changeMsg._flags = 1;
+			changeMsg._action = MUSIC_STOP;
 			changeMsg.execute(this);
 		}
 	}
diff --git a/engines/titanic/sound/auto_music_player_base.cpp b/engines/titanic/sound/auto_music_player_base.cpp
index 9687476..968344a 100644
--- a/engines/titanic/sound/auto_music_player_base.cpp
+++ b/engines/titanic/sound/auto_music_player_base.cpp
@@ -32,13 +32,13 @@ BEGIN_MESSAGE_MAP(CAutoMusicPlayerBase, CGameObject)
 END_MESSAGE_MAP()
 
 CAutoMusicPlayerBase::CAutoMusicPlayerBase() : CGameObject(),
-	_initialMute(true), _isRepeated(false), _volumeMode(VOL_NORMAL), _transition(1) {
+	_initialMute(true), _isEnabled(false), _volumeMode(VOL_NORMAL), _transition(1) {
 }
 void CAutoMusicPlayerBase::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_filename, indent);
 	file->writeNumberLine(_initialMute, indent);
-	file->writeNumberLine(_isRepeated, indent);
+	file->writeNumberLine(_isEnabled, indent);
 	file->writeNumberLine(_volumeMode, indent);
 	file->writeNumberLine(_transition, indent);
 
@@ -49,7 +49,7 @@ void CAutoMusicPlayerBase::load(SimpleFile *file) {
 	file->readNumber();
 	_filename = file->readString();
 	_initialMute = file->readNumber();
-	_isRepeated = file->readNumber();
+	_isEnabled = file->readNumber();
 	_volumeMode = (VolumeMode)file->readNumber();
 	_transition = file->readNumber();
 
@@ -62,14 +62,14 @@ bool CAutoMusicPlayerBase::StatusChangeMsg(CStatusChangeMsg *msg) {
 
 bool CAutoMusicPlayerBase::TimerMsg(CTimerMsg *msg) {
 	CChangeMusicMsg musicMsg;
-	musicMsg._flags = 2;
+	musicMsg._action = MUSIC_START;
 	musicMsg.execute(this);
 
 	return true;
 }
 
 bool CAutoMusicPlayerBase::LoadSuccessMsg(CLoadSuccessMsg *msg) {
-	if (_isRepeated)
+	if (_isEnabled)
 		playGlobalSound(_filename, _volumeMode, _initialMute, true, 0,
 			Audio::Mixer::kMusicSoundType);
 
@@ -77,23 +77,23 @@ bool CAutoMusicPlayerBase::LoadSuccessMsg(CLoadSuccessMsg *msg) {
 }
 
 bool CAutoMusicPlayerBase::ChangeMusicMsg(CChangeMusicMsg *msg) {
-	if (_isRepeated && msg->_flags == 1) {
-		_isRepeated = false;
+	if (_isEnabled && msg->_action == MUSIC_STOP) {
+		_isEnabled = false;
 		stopGlobalSound(_transition, -1);
 	}
 
 	if (!msg->_filename.empty()) {
 		_filename = msg->_filename;
 
-		if (_isRepeated) {
+		if (_isEnabled) {
 			stopGlobalSound(_transition, -1);
 			playGlobalSound(_filename, _volumeMode, _initialMute, true, 0,
 				Audio::Mixer::kMusicSoundType);
 		}
 	}
 
-	if (!_isRepeated && msg->_flags == 2) {
-		_isRepeated = true;
+	if (!_isEnabled && msg->_action == MUSIC_START) {
+		_isEnabled = true;
 		playGlobalSound(_filename, _volumeMode, _initialMute, true, 0,
 			Audio::Mixer::kMusicSoundType);
 	}
diff --git a/engines/titanic/sound/auto_music_player_base.h b/engines/titanic/sound/auto_music_player_base.h
index 4dd0665..d039295 100644
--- a/engines/titanic/sound/auto_music_player_base.h
+++ b/engines/titanic/sound/auto_music_player_base.h
@@ -36,7 +36,7 @@ class CAutoMusicPlayerBase : public CGameObject {
 protected:
 	CString _filename;
 	bool _initialMute;
-	bool _isRepeated;
+	bool _isEnabled;
 	VolumeMode _volumeMode;
 	int _transition;
 public:
diff --git a/engines/titanic/sound/node_auto_sound_player.cpp b/engines/titanic/sound/node_auto_sound_player.cpp
index 40b3d2e..60a93d6 100644
--- a/engines/titanic/sound/node_auto_sound_player.cpp
+++ b/engines/titanic/sound/node_auto_sound_player.cpp
@@ -53,7 +53,7 @@ bool CNodeAutoSoundPlayer::EnterNodeMsg(CEnterNodeMsg *msg) {
 
 		if (_enabled) {
 			CChangeMusicMsg changeMsg;
-			changeMsg._flags = 1;
+			changeMsg._action = MUSIC_STOP;
 			changeMsg.execute(room, CAutoMusicPlayer::_type,
 				MSGFLAG_CLASS_DEF | MSGFLAG_BREAK_IF_HANDLED | MSGFLAG_SCAN);
 		}
@@ -72,7 +72,7 @@ bool CNodeAutoSoundPlayer::LeaveNodeMsg(CLeaveNodeMsg *msg) {
 
 		if (_enabled) {
 			CChangeMusicMsg changeMsg;
-			changeMsg._flags = 2;
+			changeMsg._action = MUSIC_START;
 			changeMsg.execute(room, CAutoMusicPlayer::_type,
 				MSGFLAG_CLASS_DEF | MSGFLAG_BREAK_IF_HANDLED | MSGFLAG_SCAN);
 		}
diff --git a/engines/titanic/sound/restricted_auto_music_player.cpp b/engines/titanic/sound/restricted_auto_music_player.cpp
index 6b01052..a75a55b 100644
--- a/engines/titanic/sound/restricted_auto_music_player.cpp
+++ b/engines/titanic/sound/restricted_auto_music_player.cpp
@@ -58,7 +58,7 @@ bool CRestrictedAutoMusicPlayer::EnterRoomMsg(CEnterRoomMsg *msg) {
 
 	CString roomName = msg->_oldRoom->getName();
 	if (!_oldRoomName.compareToIgnoreCase(roomName)) {
-		_isRepeated = true;
+		_isEnabled = true;
 		return false;
 	} else {
 		return CAutoMusicPlayer::EnterRoomMsg(msg);
@@ -69,7 +69,7 @@ bool CRestrictedAutoMusicPlayer::LeaveRoomMsg(CLeaveRoomMsg *msg) {
 	CString roomName = msg->_newRoom->getName();
 
 	if (petCheckNode(_newNodeName) || !_newRoomName.compareToIgnoreCase(roomName)) {
-		_isRepeated = false;
+		_isEnabled = false;
 		return true;
 	} else {
 		return CAutoMusicPlayer::LeaveRoomMsg(msg);
diff --git a/engines/titanic/sound/seasonal_music_player.cpp b/engines/titanic/sound/seasonal_music_player.cpp
index 637a002..ff5e480 100644
--- a/engines/titanic/sound/seasonal_music_player.cpp
+++ b/engines/titanic/sound/seasonal_music_player.cpp
@@ -90,15 +90,15 @@ bool CSeasonalMusicPlayer::ChangeSeasonMsg(CChangeSeasonMsg *msg) {
 
 bool CSeasonalMusicPlayer::ArboretumGateMsg(CArboretumGateMsg *msg) {
 	CChangeMusicMsg changeMsg;
-	changeMsg._flags = msg->_value ? 2 : 1;
+	changeMsg._action = msg->_value ? MUSIC_START : MUSIC_STOP;
 	changeMsg.execute(this);
 
 	return true;
 }
 
 bool CSeasonalMusicPlayer::ChangeMusicMsg(CChangeMusicMsg *msg) {
-	if (_isRepeated && msg->_flags == 1) {
-		_isRepeated = false;
+	if (_isEnabled && msg->_action == MUSIC_STOP) {
+		_isEnabled = false;
 		stopGlobalSound(_transition, -1);
 	}
 
@@ -118,8 +118,8 @@ bool CSeasonalMusicPlayer::ChangeMusicMsg(CChangeMusicMsg *msg) {
 		}
 	}
 
-	if (!_isRepeated && msg->_flags == 2) {
-		_isRepeated = true;
+	if (!_isEnabled && msg->_action == MUSIC_START) {
+		_isEnabled = true;
 		loadSound(TRANSLATE("c#64.wav", "c#47.wav"));
 		loadSound(TRANSLATE("c#63.wav", "c#46.wav"));
 		loadSound(TRANSLATE("c#65.wav", "c#48.wav"));
diff --git a/engines/titanic/sound/trigger_auto_music_player.cpp b/engines/titanic/sound/trigger_auto_music_player.cpp
index a332570..15f1c9f 100644
--- a/engines/titanic/sound/trigger_auto_music_player.cpp
+++ b/engines/titanic/sound/trigger_auto_music_player.cpp
@@ -47,11 +47,11 @@ bool CTriggerAutoMusicPlayer::TriggerAutoMusicPlayerMsg(CTriggerAutoMusicPlayerM
 	CRoomItem *room2 = msg->_value == 2 ? locateRoom(_roomName) : findRoom();
 
 	CChangeMusicMsg changeMsg;
-	changeMsg._flags = 1;
+	changeMsg._action = MUSIC_STOP;
 	changeMsg.execute(room1, CAutoMusicPlayer::_type,
 		MSGFLAG_CLASS_DEF | MSGFLAG_BREAK_IF_HANDLED | MSGFLAG_SCAN);
 
-	changeMsg._flags = 2;
+	changeMsg._action = MUSIC_START;
 	changeMsg.execute(room2, CAutoMusicPlayer::_type,
 		MSGFLAG_CLASS_DEF | MSGFLAG_BREAK_IF_HANDLED | MSGFLAG_SCAN);
 
diff --git a/engines/titanic/sound/view_auto_sound_player.cpp b/engines/titanic/sound/view_auto_sound_player.cpp
index 55501fe..3937a82 100644
--- a/engines/titanic/sound/view_auto_sound_player.cpp
+++ b/engines/titanic/sound/view_auto_sound_player.cpp
@@ -53,7 +53,7 @@ bool CViewAutoSoundPlayer::EnterViewMsg(CEnterViewMsg *msg) {
 
 		if (_enabled) {
 			CChangeMusicMsg changeMsg;
-			changeMsg._flags = 1;
+			changeMsg._action = MUSIC_STOP;
 			changeMsg.execute(room, CAutoMusicPlayer::_type,
 				MSGFLAG_CLASS_DEF |MSGFLAG_BREAK_IF_HANDLED | MSGFLAG_SCAN);
 		}
@@ -72,7 +72,7 @@ bool CViewAutoSoundPlayer::LeaveViewMsg(CLeaveViewMsg *msg) {
 
 		if (_enabled) {
 			CChangeMusicMsg changeMsg;
-			changeMsg._flags = 2;
+			changeMsg._action = MUSIC_START;
 			changeMsg.execute(room, CAutoMusicPlayer::_type,
 				MSGFLAG_CLASS_DEF | MSGFLAG_BREAK_IF_HANDLED | MSGFLAG_SCAN);
 		}


Commit: c339e3261d84526e721d60d656cefeb0a27a9af9
    https://github.com/scummvm/scummvm/commit/c339e3261d84526e721d60d656cefeb0a27a9af9
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-10-13T18:03:30-04:00

Commit Message:
TITANIC: Renamed GlobalSound methods to AmbientSound

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/game/credits.cpp
    engines/titanic/game/end_credit_text.cpp
    engines/titanic/game/end_credits.cpp
    engines/titanic/game/end_explode_ship.cpp
    engines/titanic/game/end_sequence_control.cpp
    engines/titanic/game/phonograph.cpp
    engines/titanic/game/transport/lift.cpp
    engines/titanic/game/transport/pellerator.cpp
    engines/titanic/sound/auto_music_player_base.cpp
    engines/titanic/sound/seasonal_music_player.cpp


diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index b6923c2..af34526 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -465,7 +465,7 @@ bool CGameObject::isSoundActive(int handle) const {
 	return false;
 }
 
-void CGameObject::playGlobalSound(const CString &resName, VolumeMode mode, bool initialMute, bool repeated,
+void CGameObject::playAmbientSound(const CString &resName, VolumeMode mode, bool initialMute, bool repeated,
 		int handleIndex, Audio::Mixer::SoundType soundType) {
 	if (handleIndex < 0 || handleIndex > 3)
 		return;
@@ -524,7 +524,7 @@ void CGameObject::setSoundVolume(int handle, uint percent, uint seconds) {
 	}
 }
 
-void CGameObject::stopGlobalSound(bool transition, int handleIndex) {
+void CGameObject::stopAmbientSound(bool transition, int handleIndex) {
 	CGameManager *gameManager = getGameManager();
 	if (!gameManager)
 		return;
@@ -550,7 +550,7 @@ void CGameObject::stopGlobalSound(bool transition, int handleIndex) {
 	}
 }
 
-void CGameObject::setGlobalSoundVolume(VolumeMode mode, uint seconds, int handleIndex) {
+void CGameObject::setAmbientSoundVolume(VolumeMode mode, uint seconds, int handleIndex) {
 	CGameManager *gameManager = getGameManager();
 	if (!gameManager)
 		return;
@@ -559,7 +559,7 @@ void CGameObject::setGlobalSoundVolume(VolumeMode mode, uint seconds, int handle
 	if (handleIndex == -1) {
 		// Iterate through calling the method for each handle
 		for (int idx = 0; idx < 3; ++idx)
-			setGlobalSoundVolume(mode, seconds, idx);
+			setAmbientSoundVolume(mode, seconds, idx);
 	} else if (handleIndex >= 0 && handleIndex <= 3 && _soundHandles[handleIndex] != -1) {
 		uint newVolume = sound._soundManager.getModeVolume(mode);
 		sound.setVolume(_soundHandles[handleIndex], newVolume, seconds);
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index b592806..f699d3a 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -254,7 +254,7 @@ protected:
 	void setSoundVolume(int handle, uint percent, uint seconds);
 
 	/**
-	 * Plays a sound, and saves it's handle in the global sound handles list
+	 * Plays an ambient sound, and saves it's handle in the ambient sound handles list
 	 * @param resName		Filename of sound to play
 	 * @param mode			Volume mode level
 	 * @param initialMute	If set, sound transitions in from mute over 2 seconds
@@ -262,23 +262,23 @@ protected:
 	 * @param handleIndex	Slot 0 to 3 in the shared sound handle list to store the sound's handle
 	 * @param soundType		Specifies whether the sound is a sound effect or music
 	 */
-	void playGlobalSound(const CString &resName, VolumeMode mode, bool initialMute, bool repeated,
+	void playAmbientSound(const CString &resName, VolumeMode mode, bool initialMute, bool repeated,
 		int handleIndex, Audio::Mixer::SoundType soundType = Audio::Mixer::kMusicSoundType);
 
 	/**
-	 * Stops a sound saved in the global sound handle list
+	 * Stops playing an ambient sound
 	 * @param transition	If set, the sound transitions to silent before stopping
-	 * @param handleIndex	Index of sound to stop. If -1, all global sounds are stopped
+	 * @param handleIndex	Index of sound to stop. If -1, all ambient sounds are stopped
 	 */
-	void stopGlobalSound(bool transition, int handleIndex);
+	void stopAmbientSound(bool transition, int handleIndex);
 
 	/**
-	 * Updates the volume for a global sound based on the specified mode's volume
+	 * Updates the volume for an ambient sound based on the specified mode's volume
 	 * @param mode			Volume level mode
 	 * @param seconds		Number of seconds to transition to new volume
-	 * @param handleIndex	Index of global sound to update. If -1, all global sounds are updated
+	 * @param handleIndex	Index of ambient sound to update. If -1, all ambient sounds are updated
 	 */
-	void setGlobalSoundVolume(VolumeMode mode, uint seconds, int handleIndex);
+	void setAmbientSoundVolume(VolumeMode mode, uint seconds, int handleIndex);
 
 	/**
 	 * Stops sound channel 3 or 0
diff --git a/engines/titanic/game/credits.cpp b/engines/titanic/game/credits.cpp
index ddb44f1..016245d 100644
--- a/engines/titanic/game/credits.cpp
+++ b/engines/titanic/game/credits.cpp
@@ -57,13 +57,13 @@ bool CCredits::SignalObject(CSignalObject *msg) {
 }
 
 bool CCredits::TimerMsg(CTimerMsg *msg) {
-	stopGlobalSound(true, -1);
+	stopAmbientSound(true, -1);
 	setVisible(true);
 	loadSound(TRANSLATE("a#16.wav", "a#11.wav"));
 	loadSound(TRANSLATE("a#24.wav", "a#19.wav"));
 
 	if (playCutscene(0, 18)) {
-		playGlobalSound(TRANSLATE("a#16.wav", "a#11.wav"), VOL_NORMAL, false, false, 0);
+		playAmbientSound(TRANSLATE("a#16.wav", "a#11.wav"), VOL_NORMAL, false, false, 0);
 		if (playCutscene(19, 642)) {
 			playSound(TRANSLATE("a#24.wav", "a#19.wav"));
 			playCutscene(643, 750);
@@ -77,7 +77,7 @@ bool CCredits::TimerMsg(CTimerMsg *msg) {
 	setVisible(false);
 	petShow();
 	enableMouse();
-	stopGlobalSound(true, -1);
+	stopAmbientSound(true, -1);
 	return true;
 }
 
diff --git a/engines/titanic/game/end_credit_text.cpp b/engines/titanic/game/end_credit_text.cpp
index 8809799..2392f9d 100644
--- a/engines/titanic/game/end_credit_text.cpp
+++ b/engines/titanic/game/end_credit_text.cpp
@@ -44,7 +44,7 @@ void CEndCreditText::load(SimpleFile *file) {
 }
 
 bool CEndCreditText::ActMsg(CActMsg *msg) {
-	playGlobalSound(TRANSLATE("z#41.wav", "z#573.wav"), VOL_NORMAL, false, false, 0);
+	playAmbientSound(TRANSLATE("z#41.wav", "z#573.wav"), VOL_NORMAL, false, false, 0);
 	createCredits();
 	_flag = true;
 	return true;
@@ -64,7 +64,7 @@ bool CEndCreditText::FrameMsg(CFrameMsg *msg) {
 }
 
 bool CEndCreditText::TimerMsg(CTimerMsg *msg) {
-	setGlobalSoundVolume(VOL_MUTE, 2, -1);
+	setAmbientSoundVolume(VOL_MUTE, 2, -1);
 	sleep(1000);
 	quitGame();
 	return true;
diff --git a/engines/titanic/game/end_credits.cpp b/engines/titanic/game/end_credits.cpp
index 4ea54a3..84ac020 100644
--- a/engines/titanic/game/end_credits.cpp
+++ b/engines/titanic/game/end_credits.cpp
@@ -45,11 +45,11 @@ void CEndCredits::load(SimpleFile *file) {
 bool CEndCredits::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
 	if (_flag) {
 		deinit();
-		stopGlobalSound(true, -1);
+		stopAmbientSound(true, -1);
 		_flag = false;
 	} else {
 		loadSound(TRANSLATE("z#41.wav", "z#573.wav"));
-		playGlobalSound(TRANSLATE("z#41.wav", "z#573.wav"), VOL_NORMAL, false, false, 0);
+		playAmbientSound(TRANSLATE("z#41.wav", "z#573.wav"), VOL_NORMAL, false, false, 0);
 		_flag = true;
 	}
 
diff --git a/engines/titanic/game/end_explode_ship.cpp b/engines/titanic/game/end_explode_ship.cpp
index 5f90604..5ad046b 100644
--- a/engines/titanic/game/end_explode_ship.cpp
+++ b/engines/titanic/game/end_explode_ship.cpp
@@ -56,7 +56,7 @@ bool CEndExplodeShip::ActMsg(CActMsg *msg) {
 	} else if (msg->_action == "TakeOff") {
 		loadSound(TRANSLATE("a#31.wav", "a#26.wav"));
 		loadSound(TRANSLATE("a#14.wav", "a#7.wav"));
-		playGlobalSound(TRANSLATE("a#13.wav", "a#6.wav"), VOL_NORMAL, true, true, 0);
+		playAmbientSound(TRANSLATE("a#13.wav", "a#6.wav"), VOL_NORMAL, true, true, 0);
 		addTimer(1, 10212, 0);
 	}
 
@@ -72,7 +72,7 @@ bool CEndExplodeShip::TimerMsg(CTimerMsg *msg) {
 	}
 
 	if (msg->_actionVal == 3) {
-		setGlobalSoundVolume(VOL_MUTE, 2, -1);
+		setAmbientSoundVolume(VOL_MUTE, 2, -1);
 		CActMsg actMsg(_isExploding ? "ExplodeCredits" : "Credits");
 		actMsg.execute("EndGameCredits");
 	}
diff --git a/engines/titanic/game/end_sequence_control.cpp b/engines/titanic/game/end_sequence_control.cpp
index e8bc04a..a7abf01 100644
--- a/engines/titanic/game/end_sequence_control.cpp
+++ b/engines/titanic/game/end_sequence_control.cpp
@@ -62,7 +62,7 @@ bool CEndSequenceControl::TimerMsg(CTimerMsg *msg) {
 }
 
 bool CEndSequenceControl::MovieEndMsg(CMovieEndMsg *msg) {
-	setGlobalSoundVolume(VOL_MUTE, 2, -1);
+	setAmbientSoundVolume(VOL_MUTE, 2, -1);
 	changeView("TheEnd.Node 3.N");
 	addTimer(2, 1000, 0);
 	return true;
@@ -72,7 +72,7 @@ bool CEndSequenceControl::EnterRoomMsg(CEnterRoomMsg *msg) {
 	petHide();
 	disableMouse();
 	addTimer(1, 1000, 0);
-	playGlobalSound(TRANSLATE("a#15.wav", "a#8.wav"), VOL_NORMAL, true, true, 0, Audio::Mixer::kSpeechSoundType);
+	playAmbientSound(TRANSLATE("a#15.wav", "a#8.wav"), VOL_NORMAL, true, true, 0, Audio::Mixer::kSpeechSoundType);
 	return true;
 }
 
diff --git a/engines/titanic/game/phonograph.cpp b/engines/titanic/game/phonograph.cpp
index 71fd428..71b3df7 100644
--- a/engines/titanic/game/phonograph.cpp
+++ b/engines/titanic/game/phonograph.cpp
@@ -83,8 +83,8 @@ bool CPhonograph::PhonographPlayMsg(CPhonographPlayMsg *msg) {
 		_isPlaying = true;
 		msg->_value = 1;
 	} else {
-		stopGlobalSound(false, -1);
-		playGlobalSound(cylinderMsg._name, VOL_QUIET, true, true, 0);
+		stopAmbientSound(false, -1);
+		playAmbientSound(cylinderMsg._name, VOL_QUIET, true, true, 0);
 		_isPlaying = true;
 		msg->_value = 1;
 	}
@@ -107,7 +107,7 @@ bool CPhonograph::PhonographStopMsg(CPhonographStopMsg *msg) {
 				CStopMusicMsg stopMsg;
 				stopMsg.execute(this);
 			} else {
-				stopGlobalSound(msg->_leavingRoom, -1);
+				stopAmbientSound(msg->_leavingRoom, -1);
 			}
 			msg->_cylinderPresent = true;
 		}
diff --git a/engines/titanic/game/transport/lift.cpp b/engines/titanic/game/transport/lift.cpp
index 568e5be..95a4a8e 100644
--- a/engines/titanic/game/transport/lift.cpp
+++ b/engines/titanic/game/transport/lift.cpp
@@ -190,23 +190,23 @@ bool CLift::StatusChangeMsg(CStatusChangeMsg *msg) {
 bool CLift::MovieEndMsg(CMovieEndMsg *msg) {
 	switch (msg->_endFrame) {
 	case 108:
-		setGlobalSoundVolume(VOL_MUTE, 1, 0);
-		setGlobalSoundVolume(VOL_QUIET, 1, 1);
+		setAmbientSoundVolume(VOL_MUTE, 1, 0);
+		setAmbientSoundVolume(VOL_QUIET, 1, 1);
 		break;
 
 	case 190:
-		setGlobalSoundVolume(VOL_MUTE, 1, 1);
-		setGlobalSoundVolume(VOL_QUIET, 1, 2);
+		setAmbientSoundVolume(VOL_MUTE, 1, 1);
+		setAmbientSoundVolume(VOL_QUIET, 1, 2);
 		break;
 
 	case 407:
-		setGlobalSoundVolume(VOL_MUTE, 1, 2);
-		setGlobalSoundVolume(VOL_QUIET, 1, 1);
+		setAmbientSoundVolume(VOL_MUTE, 1, 2);
+		setAmbientSoundVolume(VOL_QUIET, 1, 1);
 		break;
 
 	case 489:
-		setGlobalSoundVolume(VOL_MUTE, 1, 1);
-		setGlobalSoundVolume(VOL_QUIET, 1, 0);
+		setAmbientSoundVolume(VOL_MUTE, 1, 1);
+		setAmbientSoundVolume(VOL_QUIET, 1, 0);
 		break;
 
 	default: {
@@ -252,17 +252,17 @@ bool CLift::EnterRoomMsg(CEnterRoomMsg *msg) {
 		}
 
 		if (floorNum < 20) {
-			playGlobalSound(TRANSLATE("z#520.wav", "z#259.wav"), VOL_QUIET, true, true, 0);
-			playGlobalSound(TRANSLATE("z#519.wav", "z#258.wav"), VOL_MUTE, false, true, 1);
-			playGlobalSound(TRANSLATE("z#518.wav", "z#257.wav"), VOL_MUTE, false, true, 2);
+			playAmbientSound(TRANSLATE("z#520.wav", "z#259.wav"), VOL_QUIET, true, true, 0);
+			playAmbientSound(TRANSLATE("z#519.wav", "z#258.wav"), VOL_MUTE, false, true, 1);
+			playAmbientSound(TRANSLATE("z#518.wav", "z#257.wav"), VOL_MUTE, false, true, 2);
 		} else if (floorNum < 28) {
-			playGlobalSound(TRANSLATE("z#520.wav", "z#259.wav"), VOL_MUTE, false, true, 0);
-			playGlobalSound(TRANSLATE("z#519.wav", "z#258.wav"), VOL_QUIET, true, true, 1);
-			playGlobalSound(TRANSLATE("z#518.wav", "z#257.wav"), VOL_MUTE, false, true, 2);
+			playAmbientSound(TRANSLATE("z#520.wav", "z#259.wav"), VOL_MUTE, false, true, 0);
+			playAmbientSound(TRANSLATE("z#519.wav", "z#258.wav"), VOL_QUIET, true, true, 1);
+			playAmbientSound(TRANSLATE("z#518.wav", "z#257.wav"), VOL_MUTE, false, true, 2);
 		} else {
-			playGlobalSound(TRANSLATE("z#520.wav", "z#259.wav"), VOL_MUTE, false, true, 0);
-			playGlobalSound(TRANSLATE("z#519.wav", "z#258.wav"), VOL_MUTE, false, true, 1);
-			playGlobalSound(TRANSLATE("z#518.wav", "z#257.wav"), VOL_QUIET, true, true, 2);
+			playAmbientSound(TRANSLATE("z#520.wav", "z#259.wav"), VOL_MUTE, false, true, 0);
+			playAmbientSound(TRANSLATE("z#519.wav", "z#258.wav"), VOL_MUTE, false, true, 1);
+			playAmbientSound(TRANSLATE("z#518.wav", "z#257.wav"), VOL_QUIET, true, true, 2);
 		}
 	}
 
@@ -270,7 +270,7 @@ bool CLift::EnterRoomMsg(CEnterRoomMsg *msg) {
 }
 
 bool CLift::LeaveRoomMsg(CLeaveRoomMsg *msg) {
-	stopGlobalSound(true, -1);
+	stopAmbientSound(true, -1);
 
 	CPetControl *pet = getPetControl();
 	if (pet->getRoomsElevatorNum() == 4 && _hasHead && !_hasCorrectHead) {
diff --git a/engines/titanic/game/transport/pellerator.cpp b/engines/titanic/game/transport/pellerator.cpp
index 64d0fad..55f701f 100644
--- a/engines/titanic/game/transport/pellerator.cpp
+++ b/engines/titanic/game/transport/pellerator.cpp
@@ -77,7 +77,7 @@ bool CPellerator::StatusChangeMsg(CStatusChangeMsg *msg) {
 	} else if (classNum == 3 || (msg->_newStatus > 4 && classNum != 1)) {
 		petDisplayMessage(1, CLASS_NOT_ALLOWED_AT_DEST);
 	} else if (newDest > _destination) {
-		playGlobalSound(TRANSLATE("z#74.wav", "z#605.wav"), VOL_QUIET, true, true, 0);
+		playAmbientSound(TRANSLATE("z#74.wav", "z#605.wav"), VOL_QUIET, true, true, 0);
 
 		CString name = getName();
 		changeView(name == "PelleratorObject2" ?
@@ -180,7 +180,7 @@ bool CPellerator::StatusChangeMsg(CStatusChangeMsg *msg) {
 		playMovie(264, 264, MOVIE_NOTIFY_OBJECT);
 		_destination = newDest;
 	} else if (newDest < _destination) {
-		playGlobalSound(TRANSLATE("z#74.wav", "z#605.wav"), VOL_QUIET, true, true, 0);
+		playAmbientSound(TRANSLATE("z#74.wav", "z#605.wav"), VOL_QUIET, true, true, 0);
 
 		CString name = getName();
 		changeView(name == "PelleratorObject2" ?
@@ -341,7 +341,7 @@ bool CPellerator::EnterRoomMsg(CEnterRoomMsg *msg) {
 
 bool CPellerator::MovieEndMsg(CMovieEndMsg *msg) {
 	setVisible(false);
-	stopGlobalSound(true, -1);
+	stopAmbientSound(true, -1);
 
 	switch (_destination) {
 	case 0:
diff --git a/engines/titanic/sound/auto_music_player_base.cpp b/engines/titanic/sound/auto_music_player_base.cpp
index 968344a..3737782 100644
--- a/engines/titanic/sound/auto_music_player_base.cpp
+++ b/engines/titanic/sound/auto_music_player_base.cpp
@@ -70,7 +70,7 @@ bool CAutoMusicPlayerBase::TimerMsg(CTimerMsg *msg) {
 
 bool CAutoMusicPlayerBase::LoadSuccessMsg(CLoadSuccessMsg *msg) {
 	if (_isEnabled)
-		playGlobalSound(_filename, _volumeMode, _initialMute, true, 0,
+		playAmbientSound(_filename, _volumeMode, _initialMute, true, 0,
 			Audio::Mixer::kMusicSoundType);
 
 	return true;
@@ -79,22 +79,22 @@ bool CAutoMusicPlayerBase::LoadSuccessMsg(CLoadSuccessMsg *msg) {
 bool CAutoMusicPlayerBase::ChangeMusicMsg(CChangeMusicMsg *msg) {
 	if (_isEnabled && msg->_action == MUSIC_STOP) {
 		_isEnabled = false;
-		stopGlobalSound(_transition, -1);
+		stopAmbientSound(_transition, -1);
 	}
 
 	if (!msg->_filename.empty()) {
 		_filename = msg->_filename;
 
 		if (_isEnabled) {
-			stopGlobalSound(_transition, -1);
-			playGlobalSound(_filename, _volumeMode, _initialMute, true, 0,
+			stopAmbientSound(_transition, -1);
+			playAmbientSound(_filename, _volumeMode, _initialMute, true, 0,
 				Audio::Mixer::kMusicSoundType);
 		}
 	}
 
 	if (!_isEnabled && msg->_action == MUSIC_START) {
 		_isEnabled = true;
-		playGlobalSound(_filename, _volumeMode, _initialMute, true, 0,
+		playAmbientSound(_filename, _volumeMode, _initialMute, true, 0,
 			Audio::Mixer::kMusicSoundType);
 	}
 
diff --git a/engines/titanic/sound/seasonal_music_player.cpp b/engines/titanic/sound/seasonal_music_player.cpp
index ff5e480..9260377 100644
--- a/engines/titanic/sound/seasonal_music_player.cpp
+++ b/engines/titanic/sound/seasonal_music_player.cpp
@@ -99,22 +99,22 @@ bool CSeasonalMusicPlayer::ArboretumGateMsg(CArboretumGateMsg *msg) {
 bool CSeasonalMusicPlayer::ChangeMusicMsg(CChangeMusicMsg *msg) {
 	if (_isEnabled && msg->_action == MUSIC_STOP) {
 		_isEnabled = false;
-		stopGlobalSound(_transition, -1);
+		stopAmbientSound(_transition, -1);
 	}
 
 	if (!msg->_filename.empty()) {
 		if (_isSummer) {
-			setGlobalSoundVolume(VOL_MUTE, 2, 0);
-			setGlobalSoundVolume(VOL_QUIET, 2, 1);
+			setAmbientSoundVolume(VOL_MUTE, 2, 0);
+			setAmbientSoundVolume(VOL_QUIET, 2, 1);
 		} else if (_isAutumn) {
-			setGlobalSoundVolume(VOL_MUTE, 2, 1);
-			setGlobalSoundVolume(VOL_QUIET, 2, 2);
+			setAmbientSoundVolume(VOL_MUTE, 2, 1);
+			setAmbientSoundVolume(VOL_QUIET, 2, 2);
 		} else if (_isWinter) {
-			setGlobalSoundVolume(VOL_MUTE, 2, 2);
-			setGlobalSoundVolume(VOL_QUIET, 2, 3);
+			setAmbientSoundVolume(VOL_MUTE, 2, 2);
+			setAmbientSoundVolume(VOL_QUIET, 2, 3);
 		} else if (_isSpring) {
-			setGlobalSoundVolume(VOL_MUTE, 2, 3);
-			setGlobalSoundVolume(VOL_QUIET, 2, 0);
+			setAmbientSoundVolume(VOL_MUTE, 2, 3);
+			setAmbientSoundVolume(VOL_QUIET, 2, 0);
 		}
 	}
 
@@ -124,10 +124,10 @@ bool CSeasonalMusicPlayer::ChangeMusicMsg(CChangeMusicMsg *msg) {
 		loadSound(TRANSLATE("c#63.wav", "c#46.wav"));
 		loadSound(TRANSLATE("c#65.wav", "c#48.wav"));
 		loadSound(TRANSLATE("c#62.wav", "c#47.wav"));
-		playGlobalSound(TRANSLATE("c#64.wav", "c#47.wav"), _springMode, _isSpring, true, 0);
-		playGlobalSound(TRANSLATE("c#63.wav", "c#46.wav"), _summerMode, _isSummer, true, 1);
-		playGlobalSound(TRANSLATE("c#65.wav", "c#48.wav"), _autumnMode, _isAutumn, true, 2);
-		playGlobalSound(TRANSLATE("c#62.wav", "c#47.wav"), _winterMode, _isWinter, true, 3);
+		playAmbientSound(TRANSLATE("c#64.wav", "c#47.wav"), _springMode, _isSpring, true, 0);
+		playAmbientSound(TRANSLATE("c#63.wav", "c#46.wav"), _summerMode, _isSummer, true, 1);
+		playAmbientSound(TRANSLATE("c#65.wav", "c#48.wav"), _autumnMode, _isAutumn, true, 2);
+		playAmbientSound(TRANSLATE("c#62.wav", "c#47.wav"), _winterMode, _isWinter, true, 3);
 	}
 
 	return true;





More information about the Scummvm-git-logs mailing list