From 48da1d52ad20c2503b52dbfe8d838e39f04af691 Mon Sep 17 00:00:00 2001 From: Robert Reif Date: Wed, 1 Jun 2005 20:04:06 +0000 Subject: [PATCH] Fix property set description for more than one capture device bug. Add better traces messages. --- dlls/dsound/propset.c | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/dlls/dsound/propset.c b/dlls/dsound/propset.c index 9f71e94234c..774a1ea37d0 100644 --- a/dlls/dsound/propset.c +++ b/dlls/dsound/propset.c @@ -609,7 +609,10 @@ static HRESULT WINAPI DSPROPERTY_DescriptionA( IsEqualGUID( &ppd->DeviceId , &DSDEVID_DefaultVoicePlayback) ) { ULONG wod; 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; wodn = waveOutGetNumDevs(); for (wod = 0; wod < wodn; wod++) { @@ -655,7 +658,10 @@ static HRESULT WINAPI DSPROPERTY_DescriptionA( IsEqualGUID( &ppd->DeviceId , &DSDEVID_DefaultVoiceCapture) ) { ULONG wid; 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; widn = waveInGetNumDevs(); for (wid = 0; wid < widn; wid++) { @@ -702,11 +708,12 @@ static HRESULT WINAPI DSPROPERTY_DescriptionA( ULONG wod; unsigned int wodn; /* given specific device so try the render devices first */ + TRACE("Checking renderer devices\n"); wodn = waveOutGetNumDevs(); for (wod = 0; wod < wodn; wod++) { if (IsEqualGUID( &ppd->DeviceId, &DSOUND_renderer_guids[wod] ) ) { DSDRIVERDESC desc; - TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_RENDER\n"); + TRACE("DSOUND_renderer_guids[%ld]\n", wod); ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER; ppd->WaveDeviceId = wod; err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); @@ -749,12 +756,13 @@ static HRESULT WINAPI DSPROPERTY_DescriptionA( if (found == FALSE) { ULONG wid; unsigned int widn; - TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE\n"); + TRACE("Checking capture devices\n"); ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE; widn = waveInGetNumDevs(); for (wid = 0; wid < widn; wid++) { - if (IsEqualGUID( &ppd->DeviceId, &DSOUND_capture_guids[wod] ) ) { + if (IsEqualGUID( &ppd->DeviceId, &DSOUND_capture_guids[wid] ) ) { DSDRIVERDESC desc; + TRACE("DSOUND_capture_guids[%ld]\n", wid); ppd->WaveDeviceId = wid; err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); if (err == DS_OK) { @@ -842,12 +850,16 @@ static HRESULT WINAPI DSPROPERTY_DescriptionW( IsEqualGUID( &ppd->DeviceId , &DSDEVID_DefaultVoicePlayback) ) { ULONG wod; 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; wodn = waveOutGetNumDevs(); for (wod = 0; wod < wodn; wod++) { if (IsEqualGUID( &dev_guid, &DSOUND_renderer_guids[wod] ) ) { DSDRIVERDESC desc; + TRACE("DSOUND_renderer_guids[%ld]\n", wod); ppd->WaveDeviceId = wod; err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); if (err == DS_OK) { @@ -888,7 +900,10 @@ static HRESULT WINAPI DSPROPERTY_DescriptionW( IsEqualGUID( &ppd->DeviceId , &DSDEVID_DefaultVoiceCapture) ) { ULONG wid; 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; widn = waveInGetNumDevs(); for (wid = 0; wid < widn; wid++) { @@ -934,12 +949,13 @@ static HRESULT WINAPI DSPROPERTY_DescriptionW( BOOL found = FALSE; ULONG wod; unsigned int wodn; + TRACE("Checking renderer devices\n"); /* given specific device so try the render devices first */ wodn = waveOutGetNumDevs(); for (wod = 0; wod < wodn; wod++) { if (IsEqualGUID( &ppd->DeviceId, &DSOUND_renderer_guids[wod] ) ) { DSDRIVERDESC desc; - TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_RENDER\n"); + TRACE("DSOUND_renderer_guids[%ld]\n", wod); ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_RENDER; ppd->WaveDeviceId = wod; err = mmErr(waveOutMessage((HWAVEOUT)wod,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); @@ -982,12 +998,13 @@ static HRESULT WINAPI DSPROPERTY_DescriptionW( if (found == FALSE) { ULONG wid; unsigned int widn; - TRACE("DataFlow=DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE\n"); + TRACE("Checking capture devices\n"); ppd->DataFlow = DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE; widn = waveInGetNumDevs(); for (wid = 0; wid < widn; wid++) { if (IsEqualGUID( &dev_guid, &DSOUND_capture_guids[wid] ) ) { DSDRIVERDESC desc; + TRACE("DSOUND_capture_guids[%ld]\n", wid); ppd->WaveDeviceId = wid; err = mmErr(waveInMessage((HWAVEIN)wid,DRV_QUERYDSOUNDDESC,(DWORD)&(desc),0)); if (err == DS_OK) {