[Scummvm-cvs-logs] CVS: scummvm/sound mididrv.cpp,1.59,1.60 mididrv.h,1.41,1.42

Jerome Fisher kingguppy at users.sourceforge.net
Sun Apr 3 15:02:09 CEST 2005


Update of /cvsroot/scummvm/scummvm/sound
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30995/sound

Modified Files:
	mididrv.cpp mididrv.h 
Log Message:
Committed patch #1168149 (Shared GM/MT-32 mapping) by eriktorbjorn as-is. This does the following:
- Replaces multiple identical MT-32-to-General MIDI mapping tables with a common one in MidiDriver.
- Changes Sky's GmChannel class to allow NULL instrument and velocity mapping tables, giving a 1-to-1 mapping without creating a dummy table.


Index: mididrv.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/mididrv.cpp,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -d -r1.59 -r1.60
--- mididrv.cpp	6 Mar 2005 13:23:39 -0000	1.59
+++ mididrv.cpp	3 Apr 2005 22:01:37 -0000	1.60
@@ -69,6 +69,29 @@
 	{0, 0, 0}
 };
 
+const byte MidiDriver::_mt32ToGm[128] = {
+//	  0    1    2    3    4    5    6    7    8    9    A    B    C    D    E    F
+	  0,   1,   0,   2,   4,   4,   5,   3,  16,  17,  18,  16,  16,  19,  20,  21, // 0x
+	  6,   6,   6,   7,   7,   7,   8, 112,  62,  62,  63,  63,  38,  38,  39,  39, // 1x
+	 88,  95,  52,  98,  97,  99,  14,  54, 102,  96,  53, 102,  81, 100,  14,  80, // 2x
+	 48,  48,  49,  45,  41,  40,  42,  42,  43,  46,  45,  24,  25,  28,  27, 104, // 3x
+	 32,  32,  34,  33,  36,  37,  35,  35,  79,  73,  72,  72,  74,  75,  64,  65, // 4x
+	 66,  67,  71,  71,  68,  69,  70,  22,  56,  59,  57,  57,  60,  60,  58,  61, // 5x
+	 61,  11,  11,  98,  14,   9,  14,  13,  12, 107, 107,  77,  78,  78,  76,  76, // 6x
+	 47, 117, 127, 118, 118, 116, 115, 119, 115, 112,  55, 124, 123,   0,  14, 117  // 7x
+};
+
+const byte MidiDriver::_gmToMt32[128] = {
+//	  0    1    2    3    4    5    6    7    8    9    A    B    C    D    E    F
+	  5,   1,   2,   7,   3,   5,  16,  21,  22, 101, 101,  97, 104, 103, 102,  20, // 0x
+	  8,   9,  11,  12,  14,  15,  87,  15,  59,  60,  61,  62,  67,  44,  79,  23, // 1x
+	 64,  67,  66,  70,  68,  69,  28,  31,  52,  54,  55,  56,  49,  51,  57, 112, // 2x
+	 48,  50,  45,  26,  34,  35,  45, 122,  89,  90,  94,  81,  92,  95,  24,  25, // 3x
+	 80,  78,  79,  78,  84,  85,  86,  82,  74,  72,  76,  77, 110, 107, 108,  76, // 4x
+	 47,  44, 111,  45,  44,  34,  44,  30,  32,  33,  88,  34,  35,  35,  38,  33, // 5x
+	 41,  36, 100,  37,  40,  34,  43,  40,  63,  21,  99, 105, 103,  86,  55,  84, // 6x
+	101, 103, 100, 120, 117, 113,  99, 128, 128, 128, 128, 124, 123, 128, 128, 128, // 7x
+};
 
 const MidiDriverDescription *MidiDriver::getAvailableMidiDrivers() {
 	return midiDrivers;

Index: mididrv.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/mididrv.h,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- mididrv.h	1 Jan 2005 16:09:23 -0000	1.41
+++ mididrv.h	3 Apr 2005 22:01:38 -0000	1.42
@@ -91,6 +91,9 @@
 public:
 	virtual ~MidiDriver() { }
 
+	static const byte _mt32ToGm[128];
+	static const byte _gmToMt32[128];
+
 	/**
 	 * Error codes returned by open.
 	 * Can be converted to a string with getErrorName().





More information about the Scummvm-git-logs mailing list