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;
pcm = NULL;
}
CString RageSound_DSound_Software::Init()
{
/* If we're emulated, we're better off with the WaveOut driver; DS
* emulation tends to be desynced. */
if( ds.IsEmulated() )
RageException::ThrowNonfatal( "Driver unusable (emulated device)" );
return "Driver unusable (emulated device)";
max_writeahead = safe_writeahead;
if( PREFSMAN->m_iSoundWriteAhead )
@@ -92,17 +95,22 @@ RageSound_DSound_Software::RageSound_DSound_Software()
MixingThread.SetName("Mixer thread");
MixingThread.Create( MixerThread_start, this );
return "";
}
RageSound_DSound_Software::~RageSound_DSound_Software()
{
/* Signal the mixing thread to quit. */
shutdown_mixer_thread = true;
LOG->Trace("Shutting down mixer thread ...");
LOG->Flush();
MixingThread.Wait();
LOG->Trace("Mixer thread shut down.");
LOG->Flush();
if( MixingThread.IsCreated() )
{
shutdown_mixer_thread = true;
LOG->Trace("Shutting down mixer thread ...");
LOG->Flush();
MixingThread.Wait();
LOG->Trace("Mixer thread shut down.");
LOG->Flush();
}
delete pcm;
}
@@ -26,6 +26,7 @@ public:
RageSound_DSound_Software();
virtual ~RageSound_DSound_Software();
CString Init();
};
#endif