From cd0eb352f3356db6af531a05ab159c49f35d3661 Mon Sep 17 00:00:00 2001 From: Ross Bencina Date: Sun, 11 Sep 2016 00:14:49 +1000 Subject: [PATCH] wmme: document default device selection algorithm --- src/hostapi/wmme/pa_win_wmme.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/hostapi/wmme/pa_win_wmme.c b/src/hostapi/wmme/pa_win_wmme.c index 5a34588..5f373f5 100644 --- a/src/hostapi/wmme/pa_win_wmme.c +++ b/src/hostapi/wmme/pa_win_wmme.c @@ -1018,6 +1018,16 @@ PaError PaWinMme_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiInd winMmeHostApi->inputDeviceCount = 0; winMmeHostApi->outputDeviceCount = 0; + /* Default device determination: + Here we query for the system preferred input and output devices using + DRVM_MAPPER_PREFERRED_GET; on error fall back to WAVE_MAPPER. Preferred + devices are stored in wave{In, Out}PreferredDevice. + + When enumerating devices, set PA default devices to the MME devices + with ids matching wave{In, Out}PreferredDevice. If such devices are not + encountered during enumeration, the first device enumerated for each of + {input, output} will be selected as the PA default device. + */ preferredDeviceStatusFlags = 0; waveInPreferredDevice = WAVE_MAPPER; if( waveInMessage( (HWAVEIN)WAVE_MAPPER, DRVM_MAPPER_PREFERRED_GET, (DWORD_PTR)&waveInPreferredDevice, (DWORD_PTR)&preferredDeviceStatusFlags ) != MMSYSERR_NOERROR ) -- 2.43.0