--- np2/win9x/soundmng.cpp 2003/10/26 08:59:53 1.3 +++ np2/win9x/soundmng.cpp 2003/11/28 08:01:33 1.6 @@ -38,7 +38,7 @@ static LPDIRECTSOUNDBUFFER pDSData3; static UINT dsstreambytes; static BYTE dsstreamevent; static LPDIRECTSOUNDBUFFER pDSwave3[SOUND_MAXPCM]; -static BYTE mute; +static UINT mute; static void (PARTSCALL *fnmix)(SINT16 *dst, const SINT32 *src, UINT size); @@ -74,16 +74,13 @@ UINT soundmng_create(UINT rate, UINT ms) UINT samples; DSBUFFERDESC dsbdesc; PCMWAVEFORMAT pcmwf; -#if defined(VERMOUTH_LIB) - UINT num; -#endif if ((pDSound == NULL) || (rate != 11025) && (rate != 22050) && (rate != 44100)) { goto stcre_err1; } - if (ms < 50) { - ms = 50; + if (ms < 40) { + ms = 40; } else if (ms > 1000) { ms = 1000; @@ -118,10 +115,7 @@ UINT soundmng_create(UINT rate, UINT ms) #if defined(VERMOUTH_LIB) vermouth_module = midimod_create(rate); - for (num=0; num<128; num++) { - midimod_loadprogram(vermouth_module, num); - midimod_loadrhythm(vermouth_module, num); - } + midimod_loadall(vermouth_module); #endif dsstreamevent = (BYTE)-1; soundmng_reset(); @@ -465,21 +459,24 @@ void soundmng_deinitialize(void) { // ---- -void soundmng_enable(void) { +void soundmng_enable(UINT proc) { - if (mute) { - mute = 0; + if (!(mute & (1 << proc))) { + return; + } + mute &= ~(1 << proc); + if (!mute) { soundmng_reset(); streamenable(TRUE); } } -void soundmng_disable(void) { +void soundmng_disable(UINT proc) { if (!mute) { - mute = 1; streamenable(FALSE); pcmstop(); } + mute |= 1 << proc; }