exceptions

This commit is contained in:
Glenn Maynard
2004-11-30 21:49:02 +00:00
parent ce1c9d35ed
commit 227e8ee78b
2 changed files with 16 additions and 7 deletions
@@ -62,11 +62,14 @@ RageSound_DSound_Software::RageSound_DSound_Software()
{ {
shutdown_mixer_thread = false; shutdown_mixer_thread = false;
pcm = NULL; pcm = NULL;
}
CString RageSound_DSound_Software::Init()
{
/* If we're emulated, we're better off with the WaveOut driver; DS /* If we're emulated, we're better off with the WaveOut driver; DS
* emulation tends to be desynced. */ * emulation tends to be desynced. */
if( ds.IsEmulated() ) if( ds.IsEmulated() )
RageException::ThrowNonfatal( "Driver unusable (emulated device)" ); return "Driver unusable (emulated device)";
max_writeahead = safe_writeahead; max_writeahead = safe_writeahead;
if( PREFSMAN->m_iSoundWriteAhead ) if( PREFSMAN->m_iSoundWriteAhead )
@@ -92,17 +95,22 @@ RageSound_DSound_Software::RageSound_DSound_Software()
MixingThread.SetName("Mixer thread"); MixingThread.SetName("Mixer thread");
MixingThread.Create( MixerThread_start, this ); MixingThread.Create( MixerThread_start, this );
return "";
} }
RageSound_DSound_Software::~RageSound_DSound_Software() RageSound_DSound_Software::~RageSound_DSound_Software()
{ {
/* Signal the mixing thread to quit. */ /* Signal the mixing thread to quit. */
shutdown_mixer_thread = true; if( MixingThread.IsCreated() )
LOG->Trace("Shutting down mixer thread ..."); {
LOG->Flush(); shutdown_mixer_thread = true;
MixingThread.Wait(); LOG->Trace("Shutting down mixer thread ...");
LOG->Trace("Mixer thread shut down."); LOG->Flush();
LOG->Flush(); MixingThread.Wait();
LOG->Trace("Mixer thread shut down.");
LOG->Flush();
}
delete pcm; delete pcm;
} }
@@ -26,6 +26,7 @@ public:
RageSound_DSound_Software(); RageSound_DSound_Software();
virtual ~RageSound_DSound_Software(); virtual ~RageSound_DSound_Software();
CString Init();
}; };
#endif #endif