CVS: winex/dlls/dsound capture.c, 1.10, 1.11 dsound_main.c, 1.88, 1.89
[email protected] 31 Jul 2007 19:52:16 -0000
| Newsgroups | gmane.comp.emulators.winex.cvs |
|---|---|
| Message-ID | <[email protected]> |
Subject: winex/dlls/dsound capture.c,1.10,1.11 dsound_main.c,1.88,1.89Update of /var/lib/cvsd/cvsroot/winex/dlls/dsound
In directory agravaine:/tmp/cvs-serv1373/dlls/dsound
Modified Files:
capture.c dsound_main.c
Log Message:
- implement DirectSoundCaptureEnumerateW and DirectSoundEnumerateW
- enhance GetDeviceID to map the Voice GUIDs to those returned from the enumerate functions
Index: capture.c
===================================================================
RCS file: /var/lib/cvsd/cvsroot/winex/dlls/dsound/capture.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- capture.c 27 Mar 2007 20:31:17 -0000 1.10
+++ capture.c 31 Jul 2007 19:52:14 -0000 1.11
@@ -192,12 +192,27 @@
* Success: DS_OK
* Failure: DSERR_INVALIDPARAM
*/
+static WCHAR WPSCD[] = {'T', 'G', ' ', 'P', 'r', 'i', 'm', 'a', 'r', 'y', ' ',
+ 'S', 'o', 'u', 'n', 'd', ' ', 'C', 'a', 'p', 't',
+ 'u', 'r', 'e', ' ', 'D', 'r', 'i', 'v', 'e', 'r', 0};
+static WCHAR WSoundCap[] = {'S', 'o', 'u', 'n', 'd', 'C', 'a', 'p', 0};
+static WCHAR WDCD[] = {'D', 'e', 'f', 'a', 'u', 'l', 't', ' ', 'C', 'a', 'p',
+ 't', 'u', 'r', 'e', ' ', 'D', 'e', 'v', 'i', 'c', 'e', 0};
+
HRESULT WINAPI DirectSoundCaptureEnumerateW(
LPDSENUMCALLBACKW lpDSEnumCallback,
LPVOID lpContext)
{
- FIXME("(%p,%p):stub\n", lpDSEnumCallback, lpContext );
- return DS_OK;
+ TRACE ("(%p,%p)\n", lpDSEnumCallback, lpContext);
+
+ if (lpDSEnumCallback)
+ {
+ if (lpDSEnumCallback (NULL, WPSCD, WSoundCap, lpContext))
+ lpDSEnumCallback ((LPGUID)&DSDEVID_DefaultCapture,
+ WDCD, WSoundCap, lpContext);
+ }
+
+ return DS_OK;
}
static HRESULT WINAPI
Index: dsound_main.c
===================================================================
RCS file: /var/lib/cvsd/cvsroot/winex/dlls/dsound/dsound_main.c,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -d -r1.88 -r1.89
--- dsound_main.c 29 Mar 2007 14:38:36 -0000 1.88
+++ dsound_main.c 31 Jul 2007 19:52:14 -0000 1.89
@@ -104,14 +104,27 @@
* Success: DS_OK
* Failure: DSERR_INVALIDPARAM
*/
+static WCHAR WTGDS[] = {'T', 'G', ' ', 'D', 'i', 'r', 'e', 'c', 't', 'S', 'o',
+ 'u', 'n', 'd', 0};
+static WCHAR WSound[] = {'s', 'o', 'u', 'n', 'd', 0};
+static WCHAR WDPD[] = {'D', 'e', 'f', 'a', 'u', 'l', 't', ' ', 'P', 'l', 'a',
+ 'y', 'b', 'a', 'c', 'k', ' ', 'D', 'e', 'v', 'i', 'c',
+ 'e', 0};
+
HRESULT WINAPI DirectSoundEnumerateW(
LPDSENUMCALLBACKW lpDSEnumCallback,
LPVOID lpContext )
{
- FIXME("lpDSEnumCallback = %p, lpContext = %p: stub\n",
- lpDSEnumCallback, lpContext);
+ TRACE ("lpDSEnumCallback = %p, lpContext = %p\n", lpDSEnumCallback,
+ lpContext);
- return DS_OK;
+ if (lpDSEnumCallback != NULL) {
+ if (lpDSEnumCallback (NULL, WTGDS, WSound, lpContext))
+ lpDSEnumCallback ((LPGUID)&DSDEVID_DefaultPlayback, WDPD,
+ WSound, lpContext);
+ }
+
+ return DS_OK;
}
@@ -633,10 +646,19 @@
HRESULT WINAPI GetDeviceID(LPCGUID lpGuidSrc, LPGUID lpGuidDest)
{
TRACE("(%s,%p)\n", debugstr_guid(lpGuidSrc), lpGuidDest);
- /* lpGuidSrc can be stuff like DSDEVID_DefaultPlayback and friends, and
- * in that case lpGuidDest received the "real" device guid. But our
- * device don't have any particular GUIDs, so just copy the default. */
- memcpy(lpGuidDest, lpGuidSrc, sizeof(GUID));
+
+ if (IsEqualGUID (lpGuidSrc, &DSDEVID_DefaultVoiceCapture))
+ memcpy (lpGuidDest, &DSDEVID_DefaultCapture, sizeof (GUID));
+ else if (IsEqualGUID (lpGuidSrc, &DSDEVID_DefaultVoicePlayback))
+ memcpy (lpGuidDest, &DSDEVID_DefaultPlayback, sizeof (GUID));
+ else
+ {
+ /* lpGuidSrc can be stuff like DSDEVID_DefaultPlayback and friends,
+ and in that case lpGuidDest received the "real" device guid.
+ But our device don't have any particular GUIDs, so just copy
+ the default. */
+ memcpy(lpGuidDest, lpGuidSrc, sizeof(GUID));
+ }
return DS_OK;
}