From b739306a3334d6af7ff9bad129c97d24575d7fe3 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 16 Jan 2004 23:24:05 +0000 Subject: [PATCH] Simplify (why'd I do this? unneeded) --- stepmania/src/arch/Sound/RageSoundDriver_DSound.cpp | 11 ++--------- stepmania/src/arch/Sound/RageSoundDriver_DSound.h | 1 - 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/stepmania/src/arch/Sound/RageSoundDriver_DSound.cpp b/stepmania/src/arch/Sound/RageSoundDriver_DSound.cpp index b3a94e2040..3f1b40473f 100644 --- a/stepmania/src/arch/Sound/RageSoundDriver_DSound.cpp +++ b/stepmania/src/arch/Sound/RageSoundDriver_DSound.cpp @@ -46,10 +46,10 @@ void RageSound_DSound::MixerThread() while(!shutdown) { CHECKPOINT; - /* Sleep for the size of one chunk, or until we're signalled. */ + /* Sleep for the size of one chunk. */ const int chunksize_frames = buffersize_frames / num_chunks; float sleep_secs = (float(chunksize_frames) / samplerate); - WaitForSingleObject( m_ThreadWakeupEvent, int(1000 * sleep_secs) ); + Sleep(int(1000 * sleep_secs)); CHECKPOINT; LockMutex L(SOUNDMAN->lock); @@ -217,7 +217,6 @@ RageSound_DSound::RageSound_DSound() /* Set channel volumes. */ VolumeChanged(); - m_ThreadWakeupEvent = CreateEvent( NULL, false, false, NULL ); MixingThread.SetName("Mixer thread"); MixingThread.Create( MixerThread_start, this ); } @@ -234,8 +233,6 @@ RageSound_DSound::~RageSound_DSound() for(unsigned i = 0; i < stream_pool.size(); ++i) delete stream_pool[i]; - - CloseHandle( m_ThreadWakeupEvent ); } void RageSound_DSound::VolumeChanged() @@ -283,10 +280,6 @@ void RageSound_DSound::StartMixing( RageSoundBase *snd ) if(stream_pool[i]->state == stream_pool[i]->INACTIVE) stream_pool[i]->state = stream_pool[i]->PLAYING; - /* Kick the decoder thread, so it'll start this sound up quickly. */ - L.Unlock(); - SetEvent( m_ThreadWakeupEvent ); - // LOG->Trace("new sound assigned to channel %i", i); } diff --git a/stepmania/src/arch/Sound/RageSoundDriver_DSound.h b/stepmania/src/arch/Sound/RageSoundDriver_DSound.h index c3df2d4b0e..23d3bb69db 100644 --- a/stepmania/src/arch/Sound/RageSoundDriver_DSound.h +++ b/stepmania/src/arch/Sound/RageSoundDriver_DSound.h @@ -40,7 +40,6 @@ class RageSound_DSound: public RageSoundDriver DSound ds; - HANDLE m_ThreadWakeupEvent; bool shutdown; /* tells the MixerThread to shut down */ static int MixerThread_start(void *p); void MixerThread();