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

svn-id: r4615
This commit is contained in:
Max Horn 2002-07-22 12:44:57 +00:00
parent 72cfdcf415
commit 1c4167f080
3 changed files with 18 additions and 22 deletions

View file

@ -536,11 +536,11 @@ void Scumm::pauseSounds(bool pause)
{
/* Arisme : do not pause iMuse as this will disable synch events */
/* the sound is really "paused" in the mixer */
/*
IMuse *se = _imuse;
if (se)
se->pause(pause);
*/
_soundsPaused = pause;
_mixer->pause(pause);
}

View file

@ -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 @@ int IMuseInternal::set_music_volume(uint vol)
{
if (vol > 100)
vol = 100;
if (vol < 1)
else if (vol < 1)
vol = 1;
_music_volume = vol;
@ -1288,7 +1286,6 @@ int IMuseInternal::set_master_volume(uint vol)
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 @@ bool Player::start_sound(int sound)
return false;
}
}
_mt32emulate = _se->isMT32(sound);
_parts = NULL;
_active = true;

View file

@ -109,7 +109,11 @@ int SoundMixer::play_mp3_cdtrack(PlayingSoundHandle *handle, FILE * file, mad_ti
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,16 +121,10 @@ void SoundMixer::mix(int16 *buf, uint len)
buf[2 * i] = buf[2 * i + 1] = buf[i];
}
} else {
/* no premixer available, zero the buf out */
// no premixer available, zero the buf out
memset(buf, 0, 2 * len * sizeof(int16));
}
/* Arisme : moved to let iMUSE generate the events */
if (_paused) {
memset(buf, 0, 2 * len * sizeof(int16));
return;
}
_syst->lock_mutex(_mutex);
/* now mix all channels */
for (int i = 0; i != NUM_CHANNELS; i++)