aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorFilippos Karapetis2009-12-28 11:23:20 +0000
committerFilippos Karapetis2009-12-28 11:23:20 +0000
commit62c1c2633dbb94a84cffec093e6a2118946ef8c9 (patch)
tree735fa2e327c0166abb9c8f9ed4004beee0deb491 /engines/sci
parentf41674fd51aa79d096b4aba6f2bafba3d401a3f7 (diff)
downloadscummvm-rg350-62c1c2633dbb94a84cffec093e6a2118946ef8c9.tar.gz
scummvm-rg350-62c1c2633dbb94a84cffec093e6a2118946ef8c9.tar.bz2
scummvm-rg350-62c1c2633dbb94a84cffec093e6a2118946ef8c9.zip
SCI/new music code: Implemented the "songlib" debug command
svn-id: r46670
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/console.cpp4
-rw-r--r--engines/sci/sfx/music.cpp12
-rw-r--r--engines/sci/sfx/music.h2
3 files changed, 18 insertions, 0 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index e705a828f6..cdb4a1f476 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -43,6 +43,8 @@
#ifdef USE_OLD_MUSIC_FUNCTIONS
#include "sci/sfx/iterator/songlib.h" // for SongLibrary
#include "sci/sfx/iterator/iterator.h" // for SCI_SONG_ITERATOR_TYPE_SCI0
+#else
+#include "sci/sfx/music.h"
#endif
#include "sci/sfx/softseq/mididriver.h"
#include "sci/vocabulary.h"
@@ -1623,6 +1625,8 @@ bool Console::cmdSongLib(int argc, const char **argv) {
DebugPrintf("\n");
} while (seeker);
DebugPrintf("\n");
+#else
+ _vm->getEngineState()->_soundCmd->_music->printSongLib(this);
#endif
return true;
diff --git a/engines/sci/sfx/music.cpp b/engines/sci/sfx/music.cpp
index 8094cbc5d8..fe22cf356a 100644
--- a/engines/sci/sfx/music.cpp
+++ b/engines/sci/sfx/music.cpp
@@ -27,6 +27,7 @@
#include "common/config-manager.h"
#include "sci/sci.h"
+#include "sci/console.h"
#include "sci/resource.h"
#include "sci/engine/kernel.h"
#include "sci/engine/state.h"
@@ -492,6 +493,17 @@ void SciMusic::soundSetMasterVolume(uint16 vol) {
_pMixer->setVolumeForSoundType(Audio::Mixer::kPlainSoundType, vol);
}
+void SciMusic::printSongLib(Console *con) {
+ Common::StackLock lock(_mutex);
+ const char *musicStatus[] = { "Stopped", "Initialized", "Paused", "Playing" };
+
+ for (uint32 i = 0; i < _playList.size(); i++) {
+ con->DebugPrintf("%d: %04x:%04x, priority: %d, status: %s\n", i,
+ PRINT_REG(_playList[i]->soundObj), _playList[i]->prio,
+ musicStatus[_playList[i]->status]);
+ }
+}
+
void SciMusic::reconstructSounds(int savegame_version) {
Common::StackLock lock(_mutex);
diff --git a/engines/sci/sfx/music.h b/engines/sci/sfx/music.h
index fb96063ff0..16400efcd0 100644
--- a/engines/sci/sfx/music.h
+++ b/engines/sci/sfx/music.h
@@ -140,6 +140,8 @@ public:
_playList.push_back(slotEntry);
}
+ void printSongLib(Console *con);
+
void reconstructSounds(int savegame_version);
#ifndef USE_OLD_MUSIC_FUNCTIONS