log sound drivers

This commit is contained in:
Glenn Maynard
2003-02-17 02:37:38 +00:00
parent 5f47abd1f7
commit 91d5ac72a2
2 changed files with 14 additions and 1 deletions
+13 -1
View File
@@ -12,13 +12,25 @@
#pragma comment(lib, "dsound.lib")
#pragma comment(lib, "dxguid.lib")
BOOL CALLBACK DSound::EnumCallback(LPGUID lpGuid, LPCSTR lpcstrDescription, LPCSTR lpcstrModule, LPVOID lpContext)
{
LOG->Info("DirectSound Driver: %s (%s)", lpcstrDescription, lpcstrModule);
if(lpGuid)
LOG->Info(" ID: {%8.8x-%4.4x-%4.4x-%6.6x}", lpGuid->Data1, lpGuid->Data2, lpGuid->Data3, lpGuid->Data4);
return TRUE;
}
DSound::DSound()
{
HRESULT hr;
if(FAILED(hr=DirectSoundCreate8(NULL, &ds8, NULL)))
RageException::ThrowNonfatal(hr_ssprintf(hr, "DirectSoundCreate8"));
DirectSoundEnumerate(EnumCallback, 0);
/* Try to set primary mixing privileges */
hr = ds8->SetCooperativeLevel(GetDesktopWindow(), DSSCL_PRIORITY);
}
+1
View File
@@ -9,6 +9,7 @@ struct IDirectSoundBuffer8;
class DSound
{
IDirectSound8 *ds8;
static BOOL CALLBACK EnumCallback( LPGUID lpGuid, LPCSTR lpcstrDescription, LPCSTR lpcstrModule, LPVOID lpContext);
public:
IDirectSound8 *GetDS8() const { return ds8; }