log sound drivers
This commit is contained in:
@@ -12,13 +12,25 @@
|
|||||||
#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;
|
||||||
|
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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; }
|
||||||
|
|||||||
Reference in New Issue
Block a user