aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic
diff options
context:
space:
mode:
authorPaul Gilbert2016-08-05 13:11:12 -0400
committerPaul Gilbert2016-08-05 13:11:12 -0400
commit386761f340ca0c891ca0b207bdcb8ec34c373cba (patch)
tree147760d78a7f6bf2ae2cc2148686066ffd7e7905 /engines/titanic
parent6e41f3673fa65be95226db7645c7d22b7b179ca5 (diff)
downloadscummvm-rg350-386761f340ca0c891ca0b207bdcb8ec34c373cba.tar.gz
scummvm-rg350-386761f340ca0c891ca0b207bdcb8ec34c373cba.tar.bz2
scummvm-rg350-386761f340ca0c891ca0b207bdcb8ec34c373cba.zip
TITANIC: Added skeleton QMixer class for mixer interface
Diffstat (limited to 'engines/titanic')
-rw-r--r--engines/titanic/game_manager.cpp4
-rw-r--r--engines/titanic/game_manager.h2
-rw-r--r--engines/titanic/main_game_window.cpp2
-rw-r--r--engines/titanic/module.mk1
-rw-r--r--engines/titanic/sound/qmixer.cpp27
-rw-r--r--engines/titanic/sound/qmixer.h61
-rw-r--r--engines/titanic/sound/sound.cpp3
-rw-r--r--engines/titanic/sound/sound.h2
-rw-r--r--engines/titanic/sound/sound_manager.cpp3
-rw-r--r--engines/titanic/sound/sound_manager.h13
10 files changed, 109 insertions, 9 deletions
diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index 2f83bca867..9bc9e4d067 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 aa2df461e8..262ea0169b 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 46d658b004..486bc417d7 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 b4780d8a5c..29072b533b 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 0000000000..7df6a70fd2
--- /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 0000000000..990abf5b52
--- /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 40f5c4335e..5ee1d24d04 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 8c953c8f2b..e2b5470458 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 bf087b6317..bd50a8ea9b 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 ddfcba0d0f..af97db35ed 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