[Scummvm-cvs-logs] CVS: scummvm/sound imuse.cpp,1.37,1.38 mixer.cpp,1.36,1.37

Max Horn fingolfin at users.sourceforge.net
Mon Jul 22 05:45:06 CEST 2002


Update of /cvsroot/scummvm/scummvm/sound
In directory usw-pr-cvs1:/tmp/cvs-serv19670/sound

Modified Files:
	imuse.cpp mixer.cpp 
Log Message:
pulled out arisme's recent changes to pauseMode, they are not correct as they break pause mode for all systems that use real MIDI drivers (see bug #584684). If you need a mute music mode, then add an according function to iMUSE/mixer but don't abuse pause mode, please

Index: imuse.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/imuse.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- imuse.cpp	7 Jul 2002 18:04:02 -0000	1.37
+++ imuse.cpp	22 Jul 2002 12:44:57 -0000	1.38
@@ -44,18 +44,17 @@
 /* Roland to General Midi patch table. Still needs some work. */
 static const byte mt32_to_gmidi[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, 54, 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
+	  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,  54,  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
 };
 
 
-
 /* Put IMUSE specific classes here, instead of in a .h file
  * they will only be used from this file, so it will reduce
  * compile time */
@@ -1270,8 +1269,7 @@
 {
 	if (vol > 100)
 		vol = 100;
-
-	if (vol < 1)
+	else if (vol < 1)
 		vol = 1;
 
 	_music_volume = vol;
@@ -1288,7 +1286,6 @@
 		vol = vol / (100 / _music_volume);
 
 	_master_volume = vol;
-//  _s->_sound_volume_master = vol;
 	for (i = 0; i != 8; i++)
 		_channel_volume_eff[i] = (_channel_volume[i] + 1) * vol >> 7;
 	update_volumes();
@@ -1747,6 +1744,7 @@
 			return false;
 		}
 	}
+
 	_mt32emulate = _se->isMT32(sound);
 	_parts = NULL;
 	_active = true;

Index: mixer.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/mixer.cpp,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- mixer.cpp	21 Jul 2002 06:55:33 -0000	1.36
+++ mixer.cpp	22 Jul 2002 12:44:57 -0000	1.37
@@ -109,7 +109,11 @@
 
 void SoundMixer::mix(int16 *buf, uint len)
 {
-
+	if (_paused) {
+		memset(buf, 0, 2 * len * sizeof(int16));
+		return;
+	}
+	
 	if (_premix_proc) {
 		int i;
 		_premix_proc(_premix_param, buf, len);
@@ -117,14 +121,8 @@
 			buf[2 * i] = buf[2 * i + 1] = buf[i];
 		}
 	} else {
-		/* no premixer available, zero the buf out */
-		memset(buf, 0, 2 * len * sizeof(int16));
-	}
-
-	/* Arisme : moved to let iMUSE generate the events */
-	if (_paused) {
+		// no premixer available, zero the buf out
 		memset(buf, 0, 2 * len * sizeof(int16));
-		return;
 	}
 
 	_syst->lock_mutex(_mutex);





More information about the Scummvm-git-logs mailing list