aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/sound/audio32.cpp
diff options
context:
space:
mode:
authorColin Snover2017-03-12 16:03:06 -0500
committerColin Snover2017-04-23 13:07:25 -0500
commit8bdfb7889572b680add712d461ebd868329e42b9 (patch)
treeb9d44facc720bbc1a64e77b38666c3a16de5fb47 /engines/sci/sound/audio32.cpp
parenteb9965274d18d6bc23c976fe7e7b72747001fb8e (diff)
downloadscummvm-rg350-8bdfb7889572b680add712d461ebd868329e42b9.tar.gz
scummvm-rg350-8bdfb7889572b680add712d461ebd868329e42b9.tar.bz2
scummvm-rg350-8bdfb7889572b680add712d461ebd868329e42b9.zip
SCI32: Add debugger command to list digital audio samples
Diffstat (limited to 'engines/sci/sound/audio32.cpp')
-rw-r--r--engines/sci/sound/audio32.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/engines/sci/sound/audio32.cpp b/engines/sci/sound/audio32.cpp
index df21a5fdcb..b61bbd9a4e 100644
--- a/engines/sci/sound/audio32.cpp
+++ b/engines/sci/sound/audio32.cpp
@@ -35,6 +35,7 @@
#include "common/textconsole.h" // for warning
#include "common/types.h" // for Flag::NO
#include "engine.h" // for Engine, g_engine
+#include "sci/console.h" // for Console
#include "sci/engine/features.h" // for GameFeatures
#include "sci/engine/guest_additions.h" // for GuestAdditions
#include "sci/engine/state.h" // for EngineState
@@ -1185,4 +1186,34 @@ void Audio32::kernelLoop(const int argc, const reg_t *const argv) {
setLoop(channelIndex, loop);
}
+#pragma mark -
+#pragma mark Debugging
+
+void Audio32::printAudioList(Console *con) const {
+ Common::StackLock lock(_mutex);
+ for (int i = 0; i < _numActiveChannels; ++i) {
+ const AudioChannel &channel = _channels[i];
+ con->debugPrintf(" %d[%04x:%04x]: %s, started at %d, pos %d/%d, vol %d, pan %d%s%s\n",
+ i,
+ PRINT_REG(channel.soundNode),
+ channel.robot ? "robot" : channel.resource->name().c_str(),
+ channel.startedAtTick,
+ (g_sci->getTickCount() - channel.startedAtTick) % channel.duration,
+ channel.duration,
+ channel.volume,
+ channel.pan,
+ channel.loop ? ", looping" : "",
+ channel.pausedAtTick ? ", paused" : "");
+ if (channel.fadeStartTick) {
+ con->debugPrintf(" fade: vol %d -> %d, started at %d, pos %d/%d%s\n",
+ channel.fadeStartVolume,
+ channel.fadeTargetVolume,
+ channel.fadeStartTick,
+ (g_sci->getTickCount() - channel.fadeStartTick) % channel.duration,
+ channel.fadeDuration,
+ channel.stopChannelOnFade ? ", stopping" : "");
+ }
+ }
+}
+
} // End of namespace Sci