[Scummvm-cvs-logs] scummvm master -> 12366c91e526bfe1575db1b05e02c8bfb8e58c4c

waltervn waltervn at users.sourceforge.net
Tue Jun 7 01:42:27 CEST 2011


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:
12366c91e5 SCI: Use Sound debug channel in AmigaMac sound driver.


Commit: 12366c91e526bfe1575db1b05e02c8bfb8e58c4c
    https://github.com/scummvm/scummvm/commit/12366c91e526bfe1575db1b05e02c8bfb8e58c4c
Author: Walter van Niftrik (walter at scummvm.org)
Date: 2011-06-06T16:39:00-07:00

Commit Message:
SCI: Use Sound debug channel in AmigaMac sound driver.

Changed paths:
    engines/sci/sound/drivers/amigamac.cpp



diff --git a/engines/sci/sound/drivers/amigamac.cpp b/engines/sci/sound/drivers/amigamac.cpp
index 158b4b0..2f159c2 100644
--- a/engines/sci/sound/drivers/amigamac.cpp
+++ b/engines/sci/sound/drivers/amigamac.cpp
@@ -33,8 +33,6 @@
 
 namespace Sci {
 
-//#define DEBUG
-
 class MidiDriver_AmigaMac : public MidiDriver_Emulated {
 public:
 	enum {
@@ -287,12 +285,10 @@ void MidiDriver_AmigaMac::playInstrument(int16 *dest, Voice *channel, int count)
 }
 
 void MidiDriver_AmigaMac::changeInstrument(int channel, int instrument) {
-#ifdef DEBUG
-	if (_bank.instruments[instrument][0])
-		debugN("Amiga/Mac driver: Setting channel %i to \"%s\" (%i)\n", channel, _bank.instruments[instrument].name, instrument);
+	if (((uint)instrument < _bank.instruments.size()) && (_bank.instruments[instrument].size() > 0))
+		debugC(1, kDebugLevelSound, "Amiga/Mac driver: Setting channel %i to \"%s\" (%i)", channel, _bank.instruments[instrument].name, instrument);
 	else
-		warning("Amiga/Mac driver: instrument %i does not exist (channel %i)", instrument, channel);
-#endif
+		debugC(kDebugLevelSound, "Amiga/Mac driver: instrument %i does not exist (channel %i)", instrument, channel);
 	_channels[channel].instrument = instrument;
 }
 
@@ -325,9 +321,7 @@ void MidiDriver_AmigaMac::stopNote(int ch, int note) {
 			break;
 
 	if (channel == kChannels) {
-#ifdef DEBUG
-		warning("Amiga/Mac driver: cannot stop note %i on channel %i", note, ch);
-#endif
+		debugC(1, kDebugLevelSound, "Amiga/Mac driver: cannot stop note %i on channel %i", note, ch);
 		return;
 	}
 
@@ -488,15 +482,13 @@ MidiDriver_AmigaMac::InstrumentSample *MidiDriver_AmigaMac::readInstrumentSCI0(C
 	strncpy(instrument->name, (char *) header + 2, 29);
 	instrument->name[29] = 0;
 
-#ifdef DEBUG
-	debugN("Amiga/Mac driver: Reading instrument %i: \"%s\" (%i bytes)\n",
-	          *id, instrument->name, size);
-	debugN("                Mode: %02x\n", instrument->mode);
-	debugN("                Looping: %s\n", instrument->mode & kModeLoop ? "on" : "off");
-	debugN("                Pitch changes: %s\n", instrument->mode & kModePitch ? "on" : "off");
-	debugN("                Segment sizes: %i %i %i\n", seg_size[0], seg_size[1], seg_size[2]);
-	debugN("                Segment offsets: 0 %i %i\n", loop_offset, (int32)READ_BE_UINT32(header + 43));
-#endif
+	debugC(kDebugLevelSound, "Amiga/Mac driver: Reading instrument %i: \"%s\" (%i bytes)",
+	       *id, instrument->name, size);
+	debugC(kDebugLevelSound, "    Mode: %02x", instrument->mode);
+	debugC(kDebugLevelSound, "    Looping: %s", instrument->mode & kModeLoop ? "on" : "off");
+	debugC(kDebugLevelSound, "    Pitch changes: %s", instrument->mode & kModePitch ? "on" : "off");
+	debugC(kDebugLevelSound, "    Segment sizes: %i %i %i", seg_size[0], seg_size[1], seg_size[2]);
+	debugC(kDebugLevelSound, "    Segment offsets: 0 %i %i", loop_offset, (int32)READ_BE_UINT32(header + 43));
 
 	instrument->samples = (int8 *) malloc(size + 1);
 	if (file.read(instrument->samples, size) < (unsigned int)size) {






More information about the Scummvm-git-logs mailing list