Diff for /np2/win9xc/soundmng.cpp between versions 1.2 and 1.3

version 1.2, 2003/11/21 06:51:15 version 1.3, 2004/02/13 20:31:55
Line 29  static LPDIRECTSOUND  pDSound; Line 29  static LPDIRECTSOUND  pDSound;
 static  LPDIRECTSOUNDBUFFER     pDSData3;  static  LPDIRECTSOUNDBUFFER     pDSData3;
 static  UINT                            dsstreambytes;  static  UINT                            dsstreambytes;
 static  BYTE                            dsstreamevent;  static  BYTE                            dsstreamevent;
 static  BYTE                            mute;  static  UINT                            mute;
   static  void                            (PARTSCALL *fnmix)(SINT16 *dst,
                                                                                                   const SINT32 *src, UINT size);
   
   
 // ---- directsound  // ---- directsound
Line 77  UINT soundmng_create(UINT rate, UINT ms) Line 79  UINT soundmng_create(UINT rate, UINT ms)
         samples = (rate * ms) / 2000;          samples = (rate * ms) / 2000;
         samples = (samples + 3) & (~3);          samples = (samples + 3) & (~3);
         dsstreambytes = samples * 2 * sizeof(SINT16);          dsstreambytes = samples * 2 * sizeof(SINT16);
           soundmng_setreverse(FALSE);
   
         ZeroMemory(&pcmwf, sizeof(PCMWAVEFORMAT));          ZeroMemory(&pcmwf, sizeof(PCMWAVEFORMAT));
         pcmwf.wf.wFormatTag = WAVE_FORMAT_PCM;          pcmwf.wf.wFormatTag = WAVE_FORMAT_PCM;
Line 191  const SINT32 *pcm; Line 194  const SINT32 *pcm;
         }          }
         if (SUCCEEDED(hr)) {          if (SUCCEEDED(hr)) {
                 if (pcm) {                  if (pcm) {
                         satuation_s16((SINT16 *)blockptr1, pcm, blocksize1);                          (*fnmix)((SINT16 *)blockptr1, pcm, blocksize1);
                 }                  }
                 else {                  else {
                         ZeroMemory(blockptr1, blocksize1);                          ZeroMemory(blockptr1, blocksize1);
Line 225  void soundmng_sync(void) { Line 228  void soundmng_sync(void) {
 }  }
   
 void soundmng_setreverse(BOOL reverse) {  void soundmng_setreverse(BOOL reverse) {
   
           if (!reverse) {
                   fnmix = satuation_s16;
           }
           else {
                   fnmix = satuation_s16x;
           }
 }  }
   
   
Line 251  void soundmng_deinitialize(void) { Line 261  void soundmng_deinitialize(void) {
   
 // ----  // ----
   
 void soundmng_enable(void) {  void soundmng_enable(UINT proc) {
   
         if (mute) {          if (!(mute & (1 << proc))) {
                 mute = 0;                  return;
           }
           mute &= ~(1 << proc);
           if (!mute) {
                 soundmng_reset();                  soundmng_reset();
                 streamenable(TRUE);                  streamenable(TRUE);
         }          }
 }  }
   
 void soundmng_disable(void) {  void soundmng_disable(UINT proc) {
   
         if (!mute) {          if (!mute) {
                 mute = 1;  
                 streamenable(FALSE);                  streamenable(FALSE);
         }          }
           mute |= 1 << proc;
 }  }
   

Removed from v.1.2  
changed lines
  Added in v.1.3


RetroPC.NET-CVS <cvs@retropc.net>