[Scummvm-cvs-logs] scummvm master -> 386761f340ca0c891ca0b207bdcb8ec34c373cba

dreammaster dreammaster at scummvm.org
Fri Aug 5 19:11:32 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:
386761f340 TITANIC: Added skeleton QMixer class for mixer interface


Commit: 386761f340ca0c891ca0b207bdcb8ec34c373cba
    https://github.com/scummvm/scummvm/commit/386761f340ca0c891ca0b207bdcb8ec34c373cba
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-08-05T13:11:12-04:00

Commit Message:
TITANIC: Added skeleton QMixer class for mixer interface

Changed paths:
  A engines/titanic/sound/qmixer.cpp
  A engines/titanic/sound/qmixer.h
    engines/titanic/game_manager.cpp
    engines/titanic/game_manager.h
    engines/titanic/main_game_window.cpp
    engines/titanic/module.mk
    engines/titanic/sound/sound.cpp
    engines/titanic/sound/sound.h
    engines/titanic/sound/sound_manager.cpp
    engines/titanic/sound/sound_manager.h



diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index 2f83bca..9bc9e4d 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -30,10 +30,10 @@
 
 namespace Titanic {
 
-CGameManager::CGameManager(CProjectItem *project, CGameView *gameView):
+CGameManager::CGameManager(CProjectItem *project, CGameView *gameView, Audio::Mixer *mixer):
 		_project(project), _gameView(gameView), _trueTalkManager(this),
 		_inputHandler(this), _inputTranslator(&_inputHandler),		
-		_gameState(this), _sound(this), _musicRoom(this),
+		_gameState(this), _sound(this, mixer), _musicRoom(this),
 		_treeItem(nullptr), _soundMaker(nullptr), _movieRoom(nullptr),
 		_dragItem(nullptr), _field54(0), _lastDiskTicksCount(0), _tickCount2(0) {
 	
diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h
index aa2df46..262ea01 100644
--- a/engines/titanic/game_manager.h
+++ b/engines/titanic/game_manager.h
@@ -78,7 +78,7 @@ public:
 	CMusicRoom _musicRoom;
 	CSound _sound;
 public:
-	CGameManager(CProjectItem *project, CGameView *gameView);
+	CGameManager(CProjectItem *project, CGameView *gameView, Audio::Mixer *mixer);
 	~CGameManager();
 
 	/**
diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp
index 46d658b..486bc41 100644
--- a/engines/titanic/main_game_window.cpp
+++ b/engines/titanic/main_game_window.cpp
@@ -69,7 +69,7 @@ void CMainGameWindow::applicationStarting() {
 
 	// Create game view and manager
 	_gameView = new CSTGameView(this);
-	_gameManager = new CGameManager(_project, _gameView);
+	_gameManager = new CGameManager(_project, _gameView, g_vm->_mixer);
 	_gameView->setGameManager(_gameManager);
 
 	// Load either a new game or selected existing save
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index b4780d8..29072b5 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -403,6 +403,7 @@ MODULE_OBJS := \
 	sound/music_player.o \
 	sound/node_auto_sound_player.o \
 	sound/proximity.o \
+	sound/qmixer.o \
 	sound/restricted_auto_music_player.o \
 	sound/room_auto_sound_player.o \
 	sound/room_trigger_auto_music_player.o \
diff --git a/engines/titanic/sound/qmixer.cpp b/engines/titanic/sound/qmixer.cpp
new file mode 100644
index 0000000..7df6a70
--- /dev/null
+++ b/engines/titanic/sound/qmixer.cpp
@@ -0,0 +1,27 @@
+/* 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/qmixer.h"
+
+namespace Titanic {
+
+} // End of namespace Titanic z
diff --git a/engines/titanic/sound/qmixer.h b/engines/titanic/sound/qmixer.h
new file mode 100644
index 0000000..990abf5
--- /dev/null
+++ b/engines/titanic/sound/qmixer.h
@@ -0,0 +1,61 @@
+/* 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_QMIXER_H
+#define TITANIC_QMIXER_H
+
+#include "audio/mixer.h"
+
+namespace Titanic {
+
+/**
+ * Vector positioning in metres
+ */
+struct QSVECTOR {
+	double x;
+	double y;
+	double z;
+};
+
+/**
+ * This class represents an interface to the QMixer library developed by
+ * QSound Labs, Inc. Which itself is apparently based on Microsoft's
+ * WaveMix API.
+ *
+ * It does not currently have any actual code from
+ * the library, and instead remaps calls to ScummVM's existing mixer
+ * where possible. This means that advanced features of the QMixer 
+ * library, like being able to set up both the player and sounds at 
+ * different positions are currently ignored, and all sounds play 
+ * at full volume.
+ */
+class QMixer {
+private:
+	Audio::Mixer *_mixer;
+public:
+	QMixer(Audio::Mixer *mixer) : _mixer(mixer) {}
+	virtual ~QMixer() {}
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_QMIXER_H */
diff --git a/engines/titanic/sound/sound.cpp b/engines/titanic/sound/sound.cpp
index 40f5c43..5ee1d24 100644
--- a/engines/titanic/sound/sound.cpp
+++ b/engines/titanic/sound/sound.cpp
@@ -31,7 +31,8 @@ int CSoundItem::fn1() {
 	return 0;
 }
 
-CSound::CSound(CGameManager *owner) : _gameManager(owner) {
+CSound::CSound(CGameManager *owner, Audio::Mixer *mixer) : 
+		_gameManager(owner), _soundManager(mixer) {
 	g_vm->_movieManager.setSoundManager(&_soundManager);
 }
 
diff --git a/engines/titanic/sound/sound.h b/engines/titanic/sound/sound.h
index 8c953c8..e2b5470 100644
--- a/engines/titanic/sound/sound.h
+++ b/engines/titanic/sound/sound.h
@@ -75,7 +75,7 @@ private:
 public:
 	QSoundManager _soundManager;
 public:
-	CSound(CGameManager *owner);
+	CSound(CGameManager *owner, Audio::Mixer *mixer);
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/sound/sound_manager.cpp b/engines/titanic/sound/sound_manager.cpp
index bf087b6..bd50a8e 100644
--- a/engines/titanic/sound/sound_manager.cpp
+++ b/engines/titanic/sound/sound_manager.cpp
@@ -30,7 +30,8 @@ CSoundManager::CSoundManager() : _musicPercent(75.0), _speechPercent(75.0),
 
 /*------------------------------------------------------------------------*/
 
-QSoundManager::QSoundManager() : _field18(0), _field1C(0) {
+QSoundManager::QSoundManager(Audio::Mixer *mixer) : CSoundManager(), QMixer(mixer),
+		_field18(0), _field1C(0) {
 	Common::fill(&_field4A0[0], &_field4A0[16], 0);
 }
 
diff --git a/engines/titanic/sound/sound_manager.h b/engines/titanic/sound/sound_manager.h
index ddfcba0..af97db3 100644
--- a/engines/titanic/sound/sound_manager.h
+++ b/engines/titanic/sound/sound_manager.h
@@ -25,11 +25,15 @@
 
 #include "titanic/support/simple_file.h"
 #include "titanic/sound/proximity.h"
+#include "titanic/sound/qmixer.h"
 #include "titanic/sound/wave_file.h"
 #include "titanic/true_talk/dialogue_file.h"
 
 namespace Titanic {
 
+/**
+ * Abstract interface class for a sound manager
+ */
 class CSoundManager {
 protected:
 	double _musicPercent;
@@ -122,14 +126,19 @@ public:
 	virtual void proc29() {}
 };
 
-class QSoundManager : public CSoundManager {
+/**
+ * Concrete sound manager class that handles interfacing with
+ * the QMixer sound mixer class
+ */
+class QSoundManager : public CSoundManager, public QMixer {
 public:
 	int _field18;
 	int _field1C;
 
 	int _field4A0[16];
 public:
-	QSoundManager();
+	QSoundManager(Audio::Mixer *mixer);
+	virtual ~QSoundManager() {}
 
 	/**
 	 * Loads a sound






More information about the Scummvm-git-logs mailing list