[Scummvm-cvs-logs] CVS: scummvm/backends/midi quicktime.cpp,1.8,1.9

Max Horn fingolfin at users.sourceforge.net
Tue Dec 23 18:27:00 CET 2003


Update of /cvsroot/scummvm/scummvm/backends/midi
In directory sc8-pr-cvs1:/tmp/cvs-serv9900

Modified Files:
	quicktime.cpp 
Log Message:
fix drum channel

Index: quicktime.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/midi/quicktime.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- quicktime.cpp	10 Sep 2003 12:23:42 -0000	1.8
+++ quicktime.cpp	24 Dec 2003 02:25:59 -0000	1.9
@@ -94,6 +94,9 @@
 		qtErr = NANewNoteChannel(qtNoteAllocator, &simpleNoteRequest, &(qtNoteChannel[i]));
 		if ((qtErr != noErr) || (qtNoteChannel == NULL))
 			goto bail;
+		// Channel 10 (i.e. index 9) is the drum channel. Set it up as such.
+		// All other channels default to piano.
+		NASetInstrumentNumber(qtNoteAllocator, qtNoteChannel[i], (i == 9 ? kFirstDrumkit : kFirstGMInstrument) + 1);
 	}
 	return 0;
 
@@ -200,8 +203,11 @@
 		break;
 
 	case 0xC0:										// Program change
-		// FIXME: For chanID 9 (drum channel), shouldn't we use kFirstDrumkit instead of kFirstGMInstrument ?
-		NASetInstrumentNumber(qtNoteAllocator, qtNoteChannel[chanID], midiCmd[1] + kFirstGMInstrument);
+		// Don't change instrument for the drum channel (I have no idea how a
+		// program change for the drum channel would work; maybe we would just
+		// have to use 'midiCmd[1] + kFirstDrumkit' ?).
+		if (chanID != 9)
+			NASetInstrumentNumber(qtNoteAllocator, qtNoteChannel[chanID], midiCmd[1] + kFirstGMInstrument);
 		break;
 
 	case 0xE0:{									// Pitch bend





More information about the Scummvm-git-logs mailing list