blob: 454a68b0cdbcc403f483f953d5681e9929748161 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#include "ds2.h"
#include "strsafe.h"
static const GUID NULL_GUID;
static bool _getcaps(IDirectSound * pDS,LPDSCAPS pCaps,DWORD * speakercfg)
{
bool rv=1;
if (pCaps)
{
memset(pCaps,0,sizeof(*pCaps));
pCaps->dwSize=sizeof(*pCaps);
if (FAILED(pDS->GetCaps(pCaps))) rv=0;
}
if (speakercfg)
{
if (FAILED(pDS->GetSpeakerConfig(speakercfg))) rv=0;
}
return rv;
}
bool DS2::TryGetDevCaps(const GUID *g,LPDSCAPS pCaps,DWORD * speakercfg)
{
bool rv=0;
SYNC_IN();
if (!g) g=&NULL_GUID;
if (pDS && GetCurDev()==*g)
{
rv=_getcaps(pDS,pCaps,speakercfg);
}
SYNC_OUT();
return rv;
}
|