[Scummvm-cvs-logs] scummvm master -> 30936a6115160e8e79b3c768c2ee97aae9cbd554

dreammaster dreammaster at scummvm.org
Wed Aug 10 01:03:13 CEST 2016


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:
30936a6115 TITANIC: Finish CMusicPlayer class


Commit: 30936a6115160e8e79b3c768c2ee97aae9cbd554
    https://github.com/scummvm/scummvm/commit/30936a6115160e8e79b3c768c2ee97aae9cbd554
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-08-09T19:03:05-04:00

Commit Message:
TITANIC: Finish CMusicPlayer class

Changed paths:
  A engines/titanic/sound/music_wave.cpp
  A engines/titanic/sound/music_wave.h
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/module.mk
    engines/titanic/sound/music_handler.cpp
    engines/titanic/sound/music_handler.h
    engines/titanic/sound/music_player.cpp
    engines/titanic/sound/sound_manager.cpp



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 95ebe6a..e0a4903 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -487,7 +487,7 @@ void CGameObject::playGlobalSound(const CString &resName, int mode, bool initial
 		sound.setVolume(_soundHandles[handleIndex], newVolume, 2);
 }
 
-void CGameObject::setSoundVolume(uint handle, uint percent, uint seconds) {
+void CGameObject::setSoundVolume(int handle, uint percent, uint seconds) {
 	if (handle != 0 && handle != -1) {
 		CGameManager *gameManager = getGameManager();
 		if (gameManager)
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 322b626..19eb296 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -220,7 +220,7 @@ protected:
 	 * @param volume	Volume percentage (0 to 100)
 	 * @param seconds	Number of seconds to transition to the new volume
 	 */
-	void setSoundVolume(uint handle, uint percent, uint seconds);
+	void setSoundVolume(int handle, uint percent, uint seconds);
 
 	/**
 	 * Plays a sound, and saves it's handle in the global sound handles list
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index ba46c4b..5c04117 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -402,6 +402,7 @@ MODULE_OBJS := \
 	sound/music_handler.o \
 	sound/music_room.o \
 	sound/music_player.o \
+	sound/music_wave.o \
 	sound/node_auto_sound_player.o \
 	sound/proximity.o \
 	sound/qmixer.o \
diff --git a/engines/titanic/sound/music_handler.cpp b/engines/titanic/sound/music_handler.cpp
index 32277ef..4154534 100644
--- a/engines/titanic/sound/music_handler.cpp
+++ b/engines/titanic/sound/music_handler.cpp
@@ -32,6 +32,11 @@ CMusicHandler::CMusicHandler(CProjectItem *project, CSoundManager *soundManager)
 
 }
 
+CMusicWave *CMusicHandler::createMusicWave(int v1, int v2) {
+	// TODO
+	return nullptr;
+}
+
 bool CMusicHandler::isBusy() {
 	// TODO
 	return false;
diff --git a/engines/titanic/sound/music_handler.h b/engines/titanic/sound/music_handler.h
index 99dcbe8..cab2ef8 100644
--- a/engines/titanic/sound/music_handler.h
+++ b/engines/titanic/sound/music_handler.h
@@ -23,6 +23,8 @@
 #ifndef TITANIC_MUSIC_HANDLER_H
 #define TITANIC_MUSIC_HANDLER_H
 
+#include "titanic/sound/music_wave.h"
+
 namespace Titanic {
 
 class CProjectItem;
@@ -36,6 +38,14 @@ private:
 public:
 	CMusicHandler(CProjectItem *project, CSoundManager *soundManager);
 
+	/**
+	 * Creates a new music wave class instance, and assigns it to a slot
+	 * in the music handler
+	 * @param waveIndex		Slot to save new instance in
+	 * @param count			Number of files the new instance will contain
+	 */
+	CMusicWave *createMusicWave(int waveIndex, int count);
+
 	bool isBusy();
 
 	void set124(int val) { _field124 = val; }
diff --git a/engines/titanic/sound/music_player.cpp b/engines/titanic/sound/music_player.cpp
index 86ec0db..fb5a596 100644
--- a/engines/titanic/sound/music_player.cpp
+++ b/engines/titanic/sound/music_player.cpp
@@ -125,8 +125,36 @@ bool CMusicPlayer::CreateMusicPlayerMsg(CCreateMusicPlayerMsg *msg) {
 	}
 
 	CMusicHandler *musicHandler = getMusicRoom()->createMusicHandler();
+	CMusicWave *wave;
+
 	if (musicHandler) {
-		// TODO
+		wave = musicHandler->createMusicWave(0, 3);
+		wave->load(0, "z#490.wav", 60);
+		wave->load(1, "z#488.wav", 62);
+		wave->load(2, "z#489.wav", 63);
+
+		wave = musicHandler->createMusicWave(1, 5);
+		wave->load(0, "z#493.wav", 22);
+		wave->load(1, "z#495.wav", 29);
+		wave->load(2, "z#492.wav", 34);
+		wave->load(3, "z#494.wav", 41);
+		wave->load(4, "z#491.wav", 46);
+
+		wave = musicHandler->createMusicWave(2, 5);
+		wave->load(0, "z#499.wav", 26);
+		wave->load(1, "z#497.wav", 34);
+		wave->load(2, "z#498.wav", 38);
+		wave->load(3, "z#496.wav", 46);
+		wave->load(4, "z#500.wav", 60);
+
+		wave = musicHandler->createMusicWave(3, 7);
+		wave->load(0, "z#504.wav", 22);
+		wave->load(1, "z#507.wav", 29);
+		wave->load(2, "z#503.wav", 34);
+		wave->load(3, "z#506.wav", 41);
+		wave->load(4, "z#502.wav", 46);
+		wave->load(5, "z#505.wav", 53);
+		wave->load(6, "z#501.wav", 58);
 
 		CMusicRoom::_musicHandler->set124(_fieldCC);
 	}
diff --git a/engines/titanic/sound/music_wave.cpp b/engines/titanic/sound/music_wave.cpp
new file mode 100644
index 0000000..348f3bd
--- /dev/null
+++ b/engines/titanic/sound/music_wave.cpp
@@ -0,0 +1,36 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/sound/music_wave.h"
+#include "titanic/sound/sound_manager.h"
+#include "titanic/core/project_item.h"
+
+namespace Titanic {
+
+CMusicWave::CMusicWave(CProjectItem *project, CSoundManager *soundManager, int index) {
+}
+
+void CMusicWave::load(int index, const CString &filename, int v3) {
+	// TODO
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/sound/music_wave.h b/engines/titanic/sound/music_wave.h
new file mode 100644
index 0000000..d40b2ce
--- /dev/null
+++ b/engines/titanic/sound/music_wave.h
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MUSIC_WAVE_H
+#define TITANIC_MUSIC_WAVE_H
+
+#include "titanic/support/string.h"
+
+namespace Titanic {
+
+class CProjectItem;
+class CSoundManager;
+
+class CMusicWave {
+private:
+public:
+	CMusicWave(CProjectItem *project, CSoundManager *soundManager, int index);
+
+	void load(int index, const CString &filename, int v3);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MUSIC_WAVE_H */
diff --git a/engines/titanic/sound/sound_manager.cpp b/engines/titanic/sound/sound_manager.cpp
index 7a18852..7f0834c 100644
--- a/engines/titanic/sound/sound_manager.cpp
+++ b/engines/titanic/sound/sound_manager.cpp
@@ -443,7 +443,7 @@ void QSoundManager::updateVolume(int channel, uint panRate) {
 }
 
 void QSoundManager::updateVolumes() {
-	for (int idx = 0; idx < CHANNELS_COUNT; ++idx)
+	for (uint idx = 0; idx < CHANNELS_COUNT; ++idx)
 		updateVolume(idx, 250);
 }
 






More information about the Scummvm-git-logs mailing list