Fix property set description for more than one capture device bug.

Add better traces messages.
This commit is contained in:
Robert Reif 2005-06-01 20:04:06 +00:00 committed by Alexandre Julliard
parent b67da5b946
commit 48da1d52ad
1 changed files with 26 additions and 9 deletions

View File

@ -609,7 +609,10 @@ static HRESULT WINAPI DSPROPERTY_DescriptionA(
IsEqualGUID( &ppd->DeviceId , &DSDEVID_DefaultVoicePlayback) ) { IsEqualGUID( &ppd->DeviceId , &DSDEVID_DefaultVoicePlayback) ) {
ULONG wod; ULONG wod;
unsigned int wodn; unsigned int wodn;
TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_RENDER\n"); if (IsEqualGUID( &ppd->DeviceId , &DSDEVID_DefaultPlayback) )
TRACE("DSDEVID_DefaultPlayback\n");
else
TRACE("DSDEVID_DefaultVoicePlayback\n");
ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER; ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER;
wodn = waveOutGetNumDevs(); wodn = waveOutGetNumDevs();
for (wod = 0; wod < wodn; wod++) { for (wod = 0; wod < wodn; wod++) {
@ -655,7 +658,10 @@ static HRESULT WINAPI DSPROPERTY_DescriptionA(
IsEqualGUID( &ppd->DeviceId , &DSDEVID_DefaultVoiceCapture) ) { IsEqualGUID( &ppd->DeviceId , &DSDEVID_DefaultVoiceCapture) ) {
ULONG wid; ULONG wid;
unsigned int widn; unsigned int widn;
TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE\n"); if (IsEqualGUID( &ppd->DeviceId , &DSDEVID_DefaultCapture) )
TRACE("DSDEVID_DefaultCapture\n");
else
TRACE("DSDEVID_DefaultVoiceCapture\n");
ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE; ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE;
widn = waveInGetNumDevs(); widn = waveInGetNumDevs();
for (wid = 0; wid < widn; wid++) { for (wid = 0; wid < widn; wid++) {
@ -702,11 +708,12 @@ static HRESULT WINAPI DSPROPERTY_DescriptionA(
ULONG wod; ULONG wod;
unsigned int wodn; unsigned int wodn;
/* given specific device so try the render devices first */ /* given specific device so try the render devices first */
TRACE("Checking renderer devices\n");
wodn = waveOutGetNumDevs(); wodn = waveOutGetNumDevs();
for (wod = 0; wod < wodn; wod++) { for (wod = 0; wod < wodn; wod++) {
if (IsEqualGUID( &ppd->DeviceId, &DSOUND_renderer_guids[wod] ) ) { if (IsEqualGUID( &ppd->DeviceId, &DSOUND_renderer_guids[wod] ) ) {
DSDRIVERDESC desc; DSDRIVERDESC desc;
TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_RENDER\n"); TRACE("DSOUND_renderer_guids[%ld]\n", wod);
ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER; ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER;
ppd->WaveDeviceId = wod; ppd->WaveDeviceId = wod;
err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0));
@ -749,12 +756,13 @@ static HRESULT WINAPI DSPROPERTY_DescriptionA(
if (found == FALSE) { if (found == FALSE) {
ULONG wid; ULONG wid;
unsigned int widn; unsigned int widn;
TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE\n"); TRACE("Checking capture devices\n");
ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE; ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE;
widn = waveInGetNumDevs(); widn = waveInGetNumDevs();
for (wid = 0; wid < widn; wid++) { for (wid = 0; wid < widn; wid++) {
if (IsEqualGUID( &ppd->DeviceId, &DSOUND_capture_guids[wod] ) ) { if (IsEqualGUID( &ppd->DeviceId, &DSOUND_capture_guids[wid] ) ) {
DSDRIVERDESC desc; DSDRIVERDESC desc;
TRACE("DSOUND_capture_guids[%ld]\n", wid);
ppd->WaveDeviceId = wid; ppd->WaveDeviceId = wid;
err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0));
if (err == DS_OK) { if (err == DS_OK) {
@ -842,12 +850,16 @@ static HRESULT WINAPI DSPROPERTY_DescriptionW(
IsEqualGUID( &ppd->DeviceId , &DSDEVID_DefaultVoicePlayback) ) { IsEqualGUID( &ppd->DeviceId , &DSDEVID_DefaultVoicePlayback) ) {
ULONG wod; ULONG wod;
unsigned int wodn; unsigned int wodn;
TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_RENDER\n"); if (IsEqualGUID( &ppd->DeviceId , &DSDEVID_DefaultPlayback) )
TRACE("DSDEVID_DefaultPlayback\n");
else
TRACE("DSDEVID_DefaultVoicePlayback\n");
ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER; ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER;
wodn = waveOutGetNumDevs(); wodn = waveOutGetNumDevs();
for (wod = 0; wod < wodn; wod++) { for (wod = 0; wod < wodn; wod++) {
if (IsEqualGUID( &dev_guid, &DSOUND_renderer_guids[wod] ) ) { if (IsEqualGUID( &dev_guid, &DSOUND_renderer_guids[wod] ) ) {
DSDRIVERDESC desc; DSDRIVERDESC desc;
TRACE("DSOUND_renderer_guids[%ld]\n", wod);
ppd->WaveDeviceId = wod; ppd->WaveDeviceId = wod;
err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0));
if (err == DS_OK) { if (err == DS_OK) {
@ -888,7 +900,10 @@ static HRESULT WINAPI DSPROPERTY_DescriptionW(
IsEqualGUID( &ppd->DeviceId , &DSDEVID_DefaultVoiceCapture) ) { IsEqualGUID( &ppd->DeviceId , &DSDEVID_DefaultVoiceCapture) ) {
ULONG wid; ULONG wid;
unsigned int widn; unsigned int widn;
TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE\n"); if (IsEqualGUID( &ppd->DeviceId , &DSDEVID_DefaultCapture))
TRACE("DSDEVID_DefaultCapture\n");
else
TRACE("DSDEVID_DefaultVoiceCapture\n");
ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE; ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE;
widn = waveInGetNumDevs(); widn = waveInGetNumDevs();
for (wid = 0; wid < widn; wid++) { for (wid = 0; wid < widn; wid++) {
@ -934,12 +949,13 @@ static HRESULT WINAPI DSPROPERTY_DescriptionW(
BOOL found = FALSE; BOOL found = FALSE;
ULONG wod; ULONG wod;
unsigned int wodn; unsigned int wodn;
TRACE("Checking renderer devices\n");
/* given specific device so try the render devices first */ /* given specific device so try the render devices first */
wodn = waveOutGetNumDevs(); wodn = waveOutGetNumDevs();
for (wod = 0; wod < wodn; wod++) { for (wod = 0; wod < wodn; wod++) {
if (IsEqualGUID( &ppd->DeviceId, &DSOUND_renderer_guids[wod] ) ) { if (IsEqualGUID( &ppd->DeviceId, &DSOUND_renderer_guids[wod] ) ) {
DSDRIVERDESC desc; DSDRIVERDESC desc;
TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_RENDER\n"); TRACE("DSOUND_renderer_guids[%ld]\n", wod);
ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER; ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER;
ppd->WaveDeviceId = wod; ppd->WaveDeviceId = wod;
err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0));
@ -982,12 +998,13 @@ static HRESULT WINAPI DSPROPERTY_DescriptionW(
if (found == FALSE) { if (found == FALSE) {
ULONG wid; ULONG wid;
unsigned int widn; unsigned int widn;
TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE\n"); TRACE("Checking capture devices\n");
ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE; ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE;
widn = waveInGetNumDevs(); widn = waveInGetNumDevs();
for (wid = 0; wid < widn; wid++) { for (wid = 0; wid < widn; wid++) {
if (IsEqualGUID( &dev_guid, &DSOUND_capture_guids[wid] ) ) { if (IsEqualGUID( &dev_guid, &DSOUND_capture_guids[wid] ) ) {
DSDRIVERDESC desc; DSDRIVERDESC desc;
TRACE("DSOUND_capture_guids[%ld]\n", wid);
ppd->WaveDeviceId = wid; ppd->WaveDeviceId = wid;
err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0));
if (err == DS_OK) { if (err == DS_OK) {