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
@@ -12,6 +12,16 @@
#pragma comment(lib, "dsound.lib") #pragma comment(lib, "dsound.lib")
#pragma comment(lib, "dxguid.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() DSound::DSound()
{ {
HRESULT hr; HRESULT hr;
@@ -19,6 +29,8 @@ DSound::DSound()
if(FAILED(hr=DirectSoundCreate8(NULL, &ds8, NULL))) if(FAILED(hr=DirectSoundCreate8(NULL, &ds8, NULL)))
RageException::ThrowNonfatal(hr_ssprintf(hr, "DirectSoundCreate8")); RageException::ThrowNonfatal(hr_ssprintf(hr, "DirectSoundCreate8"));
DirectSoundEnumerate(EnumCallback, 0);
/* Try to set primary mixing privileges */ /* Try to set primary mixing privileges */
hr = ds8->SetCooperativeLevel(GetDesktopWindow(), DSSCL_PRIORITY); hr = ds8->SetCooperativeLevel(GetDesktopWindow(), DSSCL_PRIORITY);
} }
+1
View File
@@ -9,6 +9,7 @@ struct IDirectSoundBuffer8;
class DSound class DSound
{ {
IDirectSound8 *ds8; IDirectSound8 *ds8;
static BOOL CALLBACK EnumCallback( LPGUID lpGuid, LPCSTR lpcstrDescription, LPCSTR lpcstrModule, LPVOID lpContext);
public: public:
IDirectSound8 *GetDS8() const { return ds8; } IDirectSound8 *GetDS8() const { return ds8; }