From: <gma...@us...> - 2002-12-31 01:14:00
|
Update of /cvsroot/stepmania/stepmania/src/arch/Sound In directory sc8-pr-cvs1:/tmp/cvs-serv12481 Modified Files: RageSoundDriver_DSound_Software.cpp RageSoundDriver_WaveOut.cpp Log Message: use better mixer Index: RageSoundDriver_DSound_Software.cpp =================================================================== RCS file: /cvsroot/stepmania/stepmania/src/arch/Sound/RageSoundDriver_DSound_Software.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- RageSoundDriver_DSound_Software.cpp 22 Dec 2002 08:07:36 -0000 1.11 +++ RageSoundDriver_DSound_Software.cpp 31 Dec 2002 01:13:58 -0000 1.12 @@ -63,17 +63,15 @@ /* Silence the buffer. */ memset(locked_buf, 0, len); - /* Create a 32-bit buffer to mix sounds. */ - static Sint32 *mixbuf = NULL; static Sint16 *buf = NULL; int bufsize = buffersize_frames * channels; if(!buf) { buf = new Sint16[bufsize]; - mixbuf = new Sint32[bufsize]; } memset(buf, 0, bufsize*sizeof(Uint16)); - memset(mixbuf, 0, bufsize*sizeof(Uint32)); + + SoundMixBuffer mix; for(unsigned i = 0; i < sounds.size(); ++i) { @@ -83,8 +81,7 @@ /* Call the callback. */ unsigned got = sounds[i]->snd->GetPCM((char *) buf, len, play_pos); - SOUNDMAN->MixAudio( - (Uint8 *) locked_buf, (Uint8 *) buf, got, SDL_MIX_MAXVOLUME/2); + mix.write((Sint16 *) buf, got); if(got < len) { @@ -93,6 +90,8 @@ sounds[i]->flush_pos = str_ds->GetMaxPosition(); } } + + mix.read((Sint16 *) locked_buf); str_ds->release_output_buf(locked_buf, len); Index: RageSoundDriver_WaveOut.cpp =================================================================== RCS file: /cvsroot/stepmania/stepmania/src/arch/Sound/RageSoundDriver_WaveOut.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- RageSoundDriver_WaveOut.cpp 28 Dec 2002 16:07:19 -0000 1.12 +++ RageSoundDriver_WaveOut.cpp 31 Dec 2002 01:13:58 -0000 1.13 @@ -91,7 +91,7 @@ unsigned got = sounds[i]->snd->GetPCM((char *) buf, chunksize, last_cursor_pos); SOUNDMAN->MixAudio( - (Uint8 *) buffers[b].lpData, (Uint8 *) buf, got, SDL_MIX_MAXVOLUME/2); + (Sint16 *) buffers[b].lpData, buf, got, .5); if(got < chunksize) { |