aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/sound
diff options
context:
space:
mode:
authorPaul Gilbert2017-02-12 13:56:00 -0500
committerPaul Gilbert2017-02-12 13:56:00 -0500
commitc33962f69d6e112cde337c85a2b947f86d3fbd1d (patch)
treed20f92f4c3e04a279d126591b9e619eeeee0c619 /engines/titanic/sound
parente00fb1380949e85afc76163eee47c76027b30e10 (diff)
downloadscummvm-rg350-c33962f69d6e112cde337c85a2b947f86d3fbd1d.tar.gz
scummvm-rg350-c33962f69d6e112cde337c85a2b947f86d3fbd1d.tar.bz2
scummvm-rg350-c33962f69d6e112cde337c85a2b947f86d3fbd1d.zip
TITANIC: Renaming methods in CMusicRoomHandler
Diffstat (limited to 'engines/titanic/sound')
-rw-r--r--engines/titanic/sound/music_room_handler.cpp8
-rw-r--r--engines/titanic/sound/music_room_handler.h18
2 files changed, 19 insertions, 7 deletions
diff --git a/engines/titanic/sound/music_room_handler.cpp b/engines/titanic/sound/music_room_handler.cpp
index 81ba1960cd..b5adbae6e6 100644
--- a/engines/titanic/sound/music_room_handler.cpp
+++ b/engines/titanic/sound/music_room_handler.cpp
@@ -195,7 +195,7 @@ bool CMusicRoomHandler::update() {
}
updateAudio();
- fn1();
+ updateInstruments();
return _field108 > 0;
}
@@ -223,7 +223,7 @@ void CMusicRoomHandler::updateAudio() {
if (amount > 0) {
count -= amount;
ptr += amount / sizeof(uint16);
- } else if (!updateInstrument(instrument)) {
+ } else if (!pollInstrument(instrument)) {
--_field108;
break;
}
@@ -237,7 +237,7 @@ void CMusicRoomHandler::updateAudio() {
_audioBuffer->leaveCriticalSection();
}
-void CMusicRoomHandler::fn1() {
+void CMusicRoomHandler::updateInstruments() {
if (_active && _soundStartTicks) {
for (MusicInstrument instrument = BELLS; instrument <= BASS;
instrument = (MusicInstrument)((int)instrument + 1)) {
@@ -273,7 +273,7 @@ void CMusicRoomHandler::fn1() {
}
}
-bool CMusicRoomHandler::updateInstrument(MusicInstrument instrument) {
+bool CMusicRoomHandler::pollInstrument(MusicInstrument instrument) {
int &arrIndex = _startPos[instrument];
if (arrIndex < 0) {
_instruments[instrument]->clear();
diff --git a/engines/titanic/sound/music_room_handler.h b/engines/titanic/sound/music_room_handler.h
index eb274aa10c..34d2b95740 100644
--- a/engines/titanic/sound/music_room_handler.h
+++ b/engines/titanic/sound/music_room_handler.h
@@ -72,17 +72,29 @@ private:
*/
void start();
+ /**
+ * Handles updating the raw audio being played for all the instruments
+ */
void updateAudio();
- void fn1();
/**
- * Updates the state of the instrument.
+ * Handles updating the instruments themselves, and keeping them animating
+ */
+ void updateInstruments();
+
+ /**
+ * Polls a specified instrument for any updates to see if it's still active.
* @returns Returns true if a given instrument is still active..
* that is, that there is still more data that can be read from it to play
*/
- bool updateInstrument(MusicInstrument instrument);
+ bool pollInstrument(MusicInstrument instrument);
double fn3(MusicInstrument instrument, int arrIndex);
+
+ /**
+ * Figures out a pitch value (of some sort) for use in determining
+ * which wave file the music instruments will use.
+ */
int getPitch(MusicInstrument instrument, int arrIndex);
public:
CMusicRoomHandler(CProjectItem *project, CSoundManager *soundManager);