4 * Copyright (c) 2004 Robert Reif
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 * add interactive tests
31 #include "wine/test.h"
37 #include "winmm_test.h"
39 static const char * line_flags(DWORD fdwLine
)
41 static char flags
[100];
44 if (fdwLine
&MIXERLINE_LINEF_ACTIVE
) {
45 strcat(flags
,"MIXERLINE_LINEF_ACTIVE");
48 if (fdwLine
&MIXERLINE_LINEF_DISCONNECTED
) {
52 strcat(flags
,"MIXERLINE_LINEF_DISCONNECTED");
56 if (fdwLine
&MIXERLINE_LINEF_SOURCE
) {
60 strcat(flags
,"MIXERLINE_LINEF_SOURCE");
66 static const char * component_type(DWORD dwComponentType
)
68 #define TYPE_TO_STR(x) case x: return #x
69 switch (dwComponentType
) {
70 TYPE_TO_STR(MIXERLINE_COMPONENTTYPE_DST_UNDEFINED
);
71 TYPE_TO_STR(MIXERLINE_COMPONENTTYPE_DST_DIGITAL
);
72 TYPE_TO_STR(MIXERLINE_COMPONENTTYPE_DST_LINE
);
73 TYPE_TO_STR(MIXERLINE_COMPONENTTYPE_DST_MONITOR
);
74 TYPE_TO_STR(MIXERLINE_COMPONENTTYPE_DST_SPEAKERS
);
75 TYPE_TO_STR(MIXERLINE_COMPONENTTYPE_DST_HEADPHONES
);
76 TYPE_TO_STR(MIXERLINE_COMPONENTTYPE_DST_TELEPHONE
);
77 TYPE_TO_STR(MIXERLINE_COMPONENTTYPE_DST_WAVEIN
);
78 TYPE_TO_STR(MIXERLINE_COMPONENTTYPE_DST_VOICEIN
);
79 TYPE_TO_STR(MIXERLINE_COMPONENTTYPE_SRC_UNDEFINED
);
80 TYPE_TO_STR(MIXERLINE_COMPONENTTYPE_SRC_DIGITAL
);
81 TYPE_TO_STR(MIXERLINE_COMPONENTTYPE_SRC_LINE
);
82 TYPE_TO_STR(MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE
);
83 TYPE_TO_STR(MIXERLINE_COMPONENTTYPE_SRC_SYNTHESIZER
);
84 TYPE_TO_STR(MIXERLINE_COMPONENTTYPE_SRC_COMPACTDISC
);
85 TYPE_TO_STR(MIXERLINE_COMPONENTTYPE_SRC_TELEPHONE
);
86 TYPE_TO_STR(MIXERLINE_COMPONENTTYPE_SRC_PCSPEAKER
);
87 TYPE_TO_STR(MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT
);
88 TYPE_TO_STR(MIXERLINE_COMPONENTTYPE_SRC_AUXILIARY
);
89 TYPE_TO_STR(MIXERLINE_COMPONENTTYPE_SRC_ANALOG
);
95 static const char * target_type(DWORD dwType
)
97 #define TYPE_TO_STR(x) case x: return #x
99 TYPE_TO_STR(MIXERLINE_TARGETTYPE_UNDEFINED
);
100 TYPE_TO_STR(MIXERLINE_TARGETTYPE_WAVEOUT
);
101 TYPE_TO_STR(MIXERLINE_TARGETTYPE_WAVEIN
);
102 TYPE_TO_STR(MIXERLINE_TARGETTYPE_MIDIOUT
);
103 TYPE_TO_STR(MIXERLINE_TARGETTYPE_MIDIIN
);
104 TYPE_TO_STR(MIXERLINE_TARGETTYPE_AUX
);
110 static const char * control_type(DWORD dwControlType
)
112 #define TYPE_TO_STR(x) case x: return #x
113 switch (dwControlType
) {
114 TYPE_TO_STR(MIXERCONTROL_CONTROLTYPE_CUSTOM
);
115 TYPE_TO_STR(MIXERCONTROL_CONTROLTYPE_BOOLEANMETER
);
116 TYPE_TO_STR(MIXERCONTROL_CONTROLTYPE_SIGNEDMETER
);
117 TYPE_TO_STR(MIXERCONTROL_CONTROLTYPE_PEAKMETER
);
118 TYPE_TO_STR(MIXERCONTROL_CONTROLTYPE_UNSIGNEDMETER
);
119 TYPE_TO_STR(MIXERCONTROL_CONTROLTYPE_BOOLEAN
);
120 TYPE_TO_STR(MIXERCONTROL_CONTROLTYPE_ONOFF
);
121 TYPE_TO_STR(MIXERCONTROL_CONTROLTYPE_MUTE
);
122 TYPE_TO_STR(MIXERCONTROL_CONTROLTYPE_MONO
);
123 TYPE_TO_STR(MIXERCONTROL_CONTROLTYPE_LOUDNESS
);
124 TYPE_TO_STR(MIXERCONTROL_CONTROLTYPE_STEREOENH
);
125 TYPE_TO_STR(MIXERCONTROL_CONTROLTYPE_BASS_BOOST
);
126 TYPE_TO_STR(MIXERCONTROL_CONTROLTYPE_BUTTON
);
127 TYPE_TO_STR(MIXERCONTROL_CONTROLTYPE_DECIBELS
);
128 TYPE_TO_STR(MIXERCONTROL_CONTROLTYPE_SIGNED
);
129 TYPE_TO_STR(MIXERCONTROL_CONTROLTYPE_UNSIGNED
);
130 TYPE_TO_STR(MIXERCONTROL_CONTROLTYPE_PERCENT
);
131 TYPE_TO_STR(MIXERCONTROL_CONTROLTYPE_SLIDER
);
132 TYPE_TO_STR(MIXERCONTROL_CONTROLTYPE_PAN
);
133 TYPE_TO_STR(MIXERCONTROL_CONTROLTYPE_QSOUNDPAN
);
134 TYPE_TO_STR(MIXERCONTROL_CONTROLTYPE_FADER
);
135 TYPE_TO_STR(MIXERCONTROL_CONTROLTYPE_VOLUME
);
136 TYPE_TO_STR(MIXERCONTROL_CONTROLTYPE_BASS
);
137 TYPE_TO_STR(MIXERCONTROL_CONTROLTYPE_TREBLE
);
138 TYPE_TO_STR(MIXERCONTROL_CONTROLTYPE_EQUALIZER
);
139 TYPE_TO_STR(MIXERCONTROL_CONTROLTYPE_SINGLESELECT
);
140 TYPE_TO_STR(MIXERCONTROL_CONTROLTYPE_MUX
);
141 TYPE_TO_STR(MIXERCONTROL_CONTROLTYPE_MULTIPLESELECT
);
142 TYPE_TO_STR(MIXERCONTROL_CONTROLTYPE_MIXER
);
143 TYPE_TO_STR(MIXERCONTROL_CONTROLTYPE_MICROTIME
);
144 TYPE_TO_STR(MIXERCONTROL_CONTROLTYPE_MILLITIME
);
150 static const char * control_flags(DWORD fdwControl
)
152 static char flags
[100];
155 if (fdwControl
&MIXERCONTROL_CONTROLF_UNIFORM
) {
156 strcat(flags
,"MIXERCONTROL_CONTROLF_UNIFORM");
159 if (fdwControl
&MIXERCONTROL_CONTROLF_MULTIPLE
) {
163 strcat(flags
,"MIXERCONTROL_CONTROLF_MULTIPLE");
167 if (fdwControl
&MIXERCONTROL_CONTROLF_DISABLED
) {
171 strcat(flags
,"MIXERCONTROL_CONTROLF_DISABLED");
177 static void mixer_test_controlA(HMIXER mix
, LPMIXERCONTROLA control
)
181 if ((control
->dwControlType
== MIXERCONTROL_CONTROLTYPE_VOLUME
) ||
182 (control
->dwControlType
== MIXERCONTROL_CONTROLTYPE_UNSIGNED
)) {
183 MIXERCONTROLDETAILS details
;
184 MIXERCONTROLDETAILS_UNSIGNED value
;
186 details
.cbStruct
= sizeof(MIXERCONTROLDETAILS
);
187 details
.dwControlID
= control
->dwControlID
;
188 details
.cChannels
= 1;
189 U(details
).cMultipleItems
= 0;
190 details
.paDetails
= &value
;
191 details
.cbDetails
= sizeof(value
);
193 /* read the current control value */
194 rc
=mixerGetControlDetails((HMIXEROBJ
)mix
,&details
,MIXER_GETCONTROLDETAILSF_VALUE
);
195 ok(rc
==MMSYSERR_NOERROR
,"mixerGetControlDetails(MIXER_GETCONTROLDETAILSF_VALUE): "
196 "MMSYSERR_NOERROR expected, got %s\n",
198 if (rc
==MMSYSERR_NOERROR
&& winetest_interactive
) {
199 MIXERCONTROLDETAILS new_details
;
200 MIXERCONTROLDETAILS_UNSIGNED new_value
;
202 trace(" Value=%d\n",value
.dwValue
);
204 if (value
.dwValue
+ control
->Metrics
.cSteps
< S1(control
->Bounds
).dwMaximum
)
205 new_value
.dwValue
= value
.dwValue
+ control
->Metrics
.cSteps
;
207 new_value
.dwValue
= value
.dwValue
- control
->Metrics
.cSteps
;
209 new_details
.cbStruct
= sizeof(MIXERCONTROLDETAILS
);
210 new_details
.dwControlID
= control
->dwControlID
;
211 new_details
.cChannels
= 1;
212 U(new_details
).cMultipleItems
= 0;
213 new_details
.paDetails
= &new_value
;
214 new_details
.cbDetails
= sizeof(new_value
);
216 /* change the control value by one step */
217 rc
=mixerSetControlDetails((HMIXEROBJ
)mix
,&new_details
,MIXER_SETCONTROLDETAILSF_VALUE
);
218 ok(rc
==MMSYSERR_NOERROR
,"mixerSetControlDetails(MIXER_SETCONTROLDETAILSF_VALUE): "
219 "MMSYSERR_NOERROR expected, got %s\n",
221 if (rc
==MMSYSERR_NOERROR
) {
222 MIXERCONTROLDETAILS ret_details
;
223 MIXERCONTROLDETAILS_UNSIGNED ret_value
;
225 ret_details
.cbStruct
= sizeof(MIXERCONTROLDETAILS
);
226 ret_details
.dwControlID
= control
->dwControlID
;
227 ret_details
.cChannels
= 1;
228 U(ret_details
).cMultipleItems
= 0;
229 ret_details
.paDetails
= &ret_value
;
230 ret_details
.cbDetails
= sizeof(ret_value
);
232 /* read back the new control value */
233 rc
=mixerGetControlDetails((HMIXEROBJ
)mix
,&ret_details
,MIXER_GETCONTROLDETAILSF_VALUE
);
234 ok(rc
==MMSYSERR_NOERROR
,"mixerGetControlDetails(MIXER_GETCONTROLDETAILSF_VALUE): "
235 "MMSYSERR_NOERROR expected, got %s\n",
237 if (rc
==MMSYSERR_NOERROR
) {
238 /* result may not match exactly because of rounding */
239 ok(abs(ret_value
.dwValue
-new_value
.dwValue
)<=1,
240 "Couldn't change value from %d to %d, returned %d\n",
241 value
.dwValue
,new_value
.dwValue
,ret_value
.dwValue
);
243 if (abs(ret_value
.dwValue
-new_value
.dwValue
)<=1) {
244 details
.cbStruct
= sizeof(MIXERCONTROLDETAILS
);
245 details
.dwControlID
= control
->dwControlID
;
246 details
.cChannels
= 1;
247 U(details
).cMultipleItems
= 0;
248 details
.paDetails
= &value
;
249 details
.cbDetails
= sizeof(value
);
251 /* restore original value */
252 rc
=mixerSetControlDetails((HMIXEROBJ
)mix
,&details
,MIXER_SETCONTROLDETAILSF_VALUE
);
253 ok(rc
==MMSYSERR_NOERROR
,"mixerSetControlDetails(MIXER_SETCONTROLDETAILSF_VALUE): "
254 "MMSYSERR_NOERROR expected, got %s\n",
260 } else if ((control
->dwControlType
== MIXERCONTROL_CONTROLTYPE_MUTE
) ||
261 (control
->dwControlType
== MIXERCONTROL_CONTROLTYPE_BOOLEAN
) ||
262 (control
->dwControlType
== MIXERCONTROL_CONTROLTYPE_BUTTON
)) {
263 MIXERCONTROLDETAILS details
;
264 MIXERCONTROLDETAILS_BOOLEAN value
;
266 details
.cbStruct
= sizeof(MIXERCONTROLDETAILS
);
267 details
.dwControlID
= control
->dwControlID
;
268 details
.cChannels
= 1;
269 U(details
).cMultipleItems
= 0;
270 details
.paDetails
= &value
;
271 details
.cbDetails
= sizeof(value
);
273 rc
=mixerGetControlDetails((HMIXEROBJ
)mix
,&details
,MIXER_GETCONTROLDETAILSF_VALUE
);
274 ok(rc
==MMSYSERR_NOERROR
,"mixerGetControlDetails(MIXER_GETCONTROLDETAILSF_VALUE): "
275 "MMSYSERR_NOERROR expected, got %s\n",
277 if (rc
==MMSYSERR_NOERROR
&& winetest_interactive
) {
278 MIXERCONTROLDETAILS new_details
;
279 MIXERCONTROLDETAILS_BOOLEAN new_value
;
281 trace(" Value=%d\n",value
.fValue
);
283 if (value
.fValue
== FALSE
)
284 new_value
.fValue
= TRUE
;
286 new_value
.fValue
= FALSE
;
288 new_details
.cbStruct
= sizeof(MIXERCONTROLDETAILS
);
289 new_details
.dwControlID
= control
->dwControlID
;
290 new_details
.cChannels
= 1;
291 U(new_details
).cMultipleItems
= 0;
292 new_details
.paDetails
= &new_value
;
293 new_details
.cbDetails
= sizeof(new_value
);
295 /* change the control value by one step */
296 rc
=mixerSetControlDetails((HMIXEROBJ
)mix
,&new_details
,MIXER_SETCONTROLDETAILSF_VALUE
);
297 ok(rc
==MMSYSERR_NOERROR
,"mixerSetControlDetails(MIXER_SETCONTROLDETAILSF_VALUE): "
298 "MMSYSERR_NOERROR expected, got %s\n",
300 if (rc
==MMSYSERR_NOERROR
) {
301 MIXERCONTROLDETAILS ret_details
;
302 MIXERCONTROLDETAILS_BOOLEAN ret_value
;
304 ret_details
.cbStruct
= sizeof(MIXERCONTROLDETAILS
);
305 ret_details
.dwControlID
= control
->dwControlID
;
306 ret_details
.cChannels
= 1;
307 U(ret_details
).cMultipleItems
= 0;
308 ret_details
.paDetails
= &ret_value
;
309 ret_details
.cbDetails
= sizeof(ret_value
);
311 /* read back the new control value */
312 rc
=mixerGetControlDetails((HMIXEROBJ
)mix
,&ret_details
,MIXER_GETCONTROLDETAILSF_VALUE
);
313 ok(rc
==MMSYSERR_NOERROR
,"mixerGetControlDetails(MIXER_GETCONTROLDETAILSF_VALUE): "
314 "MMSYSERR_NOERROR expected, got %s\n",
316 if (rc
==MMSYSERR_NOERROR
) {
317 /* result may not match exactly because of rounding */
318 ok(ret_value
.fValue
==new_value
.fValue
,
319 "Couldn't change value from %d to %d, returned %d\n",
320 value
.fValue
,new_value
.fValue
,ret_value
.fValue
);
322 if (ret_value
.fValue
==new_value
.fValue
) {
323 details
.cbStruct
= sizeof(MIXERCONTROLDETAILS
);
324 details
.dwControlID
= control
->dwControlID
;
325 details
.cChannels
= 1;
326 U(details
).cMultipleItems
= 0;
327 details
.paDetails
= &value
;
328 details
.cbDetails
= sizeof(value
);
330 /* restore original value */
331 rc
=mixerSetControlDetails((HMIXEROBJ
)mix
,&details
,MIXER_SETCONTROLDETAILSF_VALUE
);
332 ok(rc
==MMSYSERR_NOERROR
,"mixerSetControlDetails(MIXER_SETCONTROLDETAILSF_VALUE): "
333 "MMSYSERR_NOERROR expected, got %s\n",
344 static void mixer_test_deviceA(int device
)
351 rc
=mixerGetDevCapsA(device
,0,sizeof(capsA
));
352 ok(rc
==MMSYSERR_INVALPARAM
,
353 "mixerGetDevCapsA: MMSYSERR_INVALPARAM expected, got %s\n",
356 rc
=mixerGetDevCapsA(device
,&capsA
,4);
357 ok(rc
==MMSYSERR_NOERROR
,
358 "mixerGetDevCapsA: MMSYSERR_NOERROR expected, got %s\n",
361 rc
=mixerGetDevCapsA(device
,&capsA
,sizeof(capsA
));
362 ok(rc
==MMSYSERR_NOERROR
,
363 "mixerGetDevCapsA: MMSYSERR_NOERROR expected, got %s\n",
366 if (winetest_interactive
) {
367 trace(" %d: \"%s\" %d.%d (%d:%d) destinations=%d\n", device
,
368 capsA
.szPname
, capsA
.vDriverVersion
>> 8,
369 capsA
.vDriverVersion
& 0xff,capsA
.wMid
,capsA
.wPid
,
370 capsA
.cDestinations
);
372 trace(" %d: \"%s\" %d.%d (%d:%d)\n", device
,
373 capsA
.szPname
, capsA
.vDriverVersion
>> 8,
374 capsA
.vDriverVersion
& 0xff,capsA
.wMid
,capsA
.wPid
);
377 rc
=mixerOpen(&mix
, device
, 0, 0, 0);
378 ok(rc
==MMSYSERR_NOERROR
,
379 "mixerOpen: MMSYSERR_NOERROR expected, got %s\n",mmsys_error(rc
));
380 if (rc
==MMSYSERR_NOERROR
) {
381 rc
=mixerOpen(&mix
, device
, 0, 0, CALLBACK_FUNCTION
);
382 ok(rc
==MMSYSERR_INVALFLAG
,
383 "mixerOpen: MMSYSERR_INVALFLAG expected, got %s\n", mmsys_error(rc
));
385 for (d
=0;d
<capsA
.cDestinations
;d
++) {
386 MIXERLINEA mixerlineA
;
387 mixerlineA
.cbStruct
= 0;
388 mixerlineA
.dwDestination
=d
;
389 rc
=mixerGetLineInfoA((HMIXEROBJ
)mix
,&mixerlineA
,
390 MIXER_GETLINEINFOF_DESTINATION
);
391 ok(rc
==MMSYSERR_INVALPARAM
,
392 "mixerGetLineInfoA(MIXER_GETLINEINFOF_DESTINATION): "
393 "MMSYSERR_INVALPARAM expected, got %s\n",
396 mixerlineA
.cbStruct
= sizeof(mixerlineA
);
397 mixerlineA
.dwDestination
=capsA
.cDestinations
;
398 rc
=mixerGetLineInfoA((HMIXEROBJ
)mix
,&mixerlineA
,
399 MIXER_GETLINEINFOF_DESTINATION
);
400 ok(rc
==MMSYSERR_INVALPARAM
||rc
==MIXERR_INVALLINE
,
401 "mixerGetLineInfoA(MIXER_GETLINEINFOF_DESTINATION): "
402 "MMSYSERR_INVALPARAM or MIXERR_INVALLINE expected, got %s\n",
405 mixerlineA
.cbStruct
= sizeof(mixerlineA
);
406 mixerlineA
.dwDestination
=d
;
407 rc
=mixerGetLineInfoA((HMIXEROBJ
)mix
,0,
408 MIXER_GETLINEINFOF_DESTINATION
);
409 ok(rc
==MMSYSERR_INVALPARAM
,
410 "mixerGetLineInfoA(MIXER_GETLINEINFOF_DESTINATION): "
411 "MMSYSERR_INVALPARAM expected, got %s\n",
414 mixerlineA
.cbStruct
= sizeof(mixerlineA
);
415 mixerlineA
.dwDestination
=d
;
416 rc
=mixerGetLineInfoA((HMIXEROBJ
)mix
,&mixerlineA
,-1);
417 ok(rc
==MMSYSERR_INVALFLAG
,
418 "mixerGetLineInfoA(-1): MMSYSERR_INVALFLAG expected, got %s\n",
421 mixerlineA
.cbStruct
= sizeof(mixerlineA
);
422 mixerlineA
.dwDestination
=d
;
423 rc
=mixerGetLineInfoA((HMIXEROBJ
)mix
,&mixerlineA
,
424 MIXER_GETLINEINFOF_DESTINATION
);
425 ok(rc
==MMSYSERR_NOERROR
||rc
==MMSYSERR_NODRIVER
,
426 "mixerGetLineInfoA(MIXER_GETLINEINFOF_DESTINATION): "
427 "MMSYSERR_NOERROR expected, got %s\n",
429 if (rc
==MMSYSERR_NODRIVER
)
430 trace(" No Driver\n");
431 else if (rc
==MMSYSERR_NOERROR
) {
432 if (winetest_interactive
) {
433 trace(" %d: \"%s\" (%s) Destination=%d Source=%d\n",
434 d
,mixerlineA
.szShortName
, mixerlineA
.szName
,
435 mixerlineA
.dwDestination
,mixerlineA
.dwSource
);
436 trace(" LineID=%08x Channels=%d "
437 "Connections=%d Controls=%d\n",
438 mixerlineA
.dwLineID
,mixerlineA
.cChannels
,
439 mixerlineA
.cConnections
,mixerlineA
.cControls
);
440 trace(" State=0x%08x(%s)\n",
441 mixerlineA
.fdwLine
,line_flags(mixerlineA
.fdwLine
));
442 trace(" ComponentType=%s\n",
443 component_type(mixerlineA
.dwComponentType
));
445 target_type(mixerlineA
.Target
.dwType
));
446 trace(" Device=%d (%s) %d.%d (%d:%d)\n",
447 mixerlineA
.Target
.dwDeviceID
,
448 mixerlineA
.Target
.szPname
,
449 mixerlineA
.Target
.vDriverVersion
>> 8,
450 mixerlineA
.Target
.vDriverVersion
& 0xff,
451 mixerlineA
.Target
.wMid
, mixerlineA
.Target
.wPid
);
453 ns
=mixerlineA
.cConnections
;
455 mixerlineA
.cbStruct
= sizeof(mixerlineA
);
456 mixerlineA
.dwDestination
=d
;
457 mixerlineA
.dwSource
=s
;
458 rc
=mixerGetLineInfoA((HMIXEROBJ
)mix
,&mixerlineA
,
459 MIXER_GETLINEINFOF_SOURCE
);
460 ok(rc
==MMSYSERR_NOERROR
||rc
==MMSYSERR_NODRIVER
,
461 "mixerGetLineInfoA(MIXER_GETLINEINFOF_SOURCE): "
462 "MMSYSERR_NOERROR expected, got %s\n",
464 if (rc
==MMSYSERR_NODRIVER
)
465 trace(" No Driver\n");
466 else if (rc
==MMSYSERR_NOERROR
) {
467 LPMIXERCONTROLA array
;
468 MIXERLINECONTROLSA controls
;
469 if (winetest_interactive
) {
470 trace(" %d: \"%s\" (%s) Destination=%d Source=%d\n",
471 s
,mixerlineA
.szShortName
, mixerlineA
.szName
,
472 mixerlineA
.dwDestination
,mixerlineA
.dwSource
);
473 trace(" LineID=%08x Channels=%d "
474 "Connections=%d Controls=%d\n",
475 mixerlineA
.dwLineID
,mixerlineA
.cChannels
,
476 mixerlineA
.cConnections
,mixerlineA
.cControls
);
477 trace(" State=0x%08x(%s)\n",
478 mixerlineA
.fdwLine
,line_flags(mixerlineA
.fdwLine
));
479 trace(" ComponentType=%s\n",
480 component_type(mixerlineA
.dwComponentType
));
482 target_type(mixerlineA
.Target
.dwType
));
483 trace(" Device=%d (%s) %d.%d (%d:%d)\n",
484 mixerlineA
.Target
.dwDeviceID
,
485 mixerlineA
.Target
.szPname
,
486 mixerlineA
.Target
.vDriverVersion
>> 8,
487 mixerlineA
.Target
.vDriverVersion
& 0xff,
488 mixerlineA
.Target
.wMid
, mixerlineA
.Target
.wPid
);
490 if (mixerlineA
.cControls
) {
491 array
=HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY
,
492 mixerlineA
.cControls
*sizeof(MIXERCONTROLA
));
494 memset(&controls
, 0, sizeof(controls
));
496 rc
=mixerGetLineControlsA((HMIXEROBJ
)mix
,0,
497 MIXER_GETLINECONTROLSF_ALL
);
498 ok(rc
==MMSYSERR_INVALPARAM
,
499 "mixerGetLineControlsA(MIXER_GETLINECONTROLSF_ALL): "
500 "MMSYSERR_INVALPARAM expected, got %s\n",
503 rc
=mixerGetLineControlsA((HMIXEROBJ
)mix
,&controls
,-1);
504 ok(rc
==MMSYSERR_INVALFLAG
||rc
==MMSYSERR_INVALPARAM
,
505 "mixerGetLineControlsA(-1): "
506 "MMSYSERR_INVALFLAG or MMSYSERR_INVALPARAM expected, got %s\n",
509 controls
.cbStruct
= sizeof(MIXERLINECONTROLSA
);
510 controls
.cControls
= mixerlineA
.cControls
;
511 controls
.dwLineID
= mixerlineA
.dwLineID
;
512 controls
.pamxctrl
= array
;
513 controls
.cbmxctrl
= sizeof(MIXERCONTROLA
);
515 /* FIXME: do MIXER_GETLINECONTROLSF_ONEBYID
516 * and MIXER_GETLINECONTROLSF_ONEBYTYPE
518 rc
=mixerGetLineControlsA((HMIXEROBJ
)mix
,&controls
,
519 MIXER_GETLINECONTROLSF_ALL
);
520 ok(rc
==MMSYSERR_NOERROR
,
521 "mixerGetLineControlsA(MIXER_GETLINECONTROLSF_ALL): "
522 "MMSYSERR_NOERROR expected, got %s\n",
524 if (rc
==MMSYSERR_NOERROR
) {
525 for(nc
=0;nc
<mixerlineA
.cControls
;nc
++) {
526 if (winetest_interactive
) {
527 trace(" %d: \"%s\" (%s) ControlID=%d\n", nc
,
528 array
[nc
].szShortName
,
529 array
[nc
].szName
, array
[nc
].dwControlID
);
530 trace(" ControlType=%s\n",
531 control_type(array
[nc
].dwControlType
));
532 trace(" Control=0x%08x(%s)\n",
533 array
[nc
].fdwControl
,
534 control_flags(array
[nc
].fdwControl
));
535 trace(" Items=%d Min=%d Max=%d Step=%d\n",
536 array
[nc
].cMultipleItems
,
537 S1(array
[nc
].Bounds
).dwMinimum
,
538 S1(array
[nc
].Bounds
).dwMaximum
,
539 array
[nc
].Metrics
.cSteps
);
542 mixer_test_controlA(mix
, &array
[nc
]);
546 HeapFree(GetProcessHeap(),0,array
);
554 ok(rc
==MMSYSERR_NOERROR
|| rc
==MMSYSERR_INVALHANDLE
,
555 "mixerClose: MMSYSERR_NOERROR or MMSYSERR_INVALHANDLE expected, got %s\n",
560 static void mixer_test_controlW(HMIXER mix
, LPMIXERCONTROLW control
)
564 if ((control
->dwControlType
== MIXERCONTROL_CONTROLTYPE_VOLUME
) ||
565 (control
->dwControlType
== MIXERCONTROL_CONTROLTYPE_UNSIGNED
)) {
566 MIXERCONTROLDETAILS details
;
567 MIXERCONTROLDETAILS_UNSIGNED value
;
569 details
.cbStruct
= sizeof(MIXERCONTROLDETAILS
);
570 details
.dwControlID
= control
->dwControlID
;
571 details
.cChannels
= 1;
572 U(details
).cMultipleItems
= 0;
573 details
.paDetails
= &value
;
574 details
.cbDetails
= sizeof(value
);
576 /* read the current control value */
577 rc
=mixerGetControlDetails((HMIXEROBJ
)mix
,&details
,MIXER_GETCONTROLDETAILSF_VALUE
);
578 ok(rc
==MMSYSERR_NOERROR
,"mixerGetControlDetails(MIXER_GETCONTROLDETAILSF_VALUE): "
579 "MMSYSERR_NOERROR expected, got %s\n",
581 if (rc
==MMSYSERR_NOERROR
&& winetest_interactive
) {
582 MIXERCONTROLDETAILS new_details
;
583 MIXERCONTROLDETAILS_UNSIGNED new_value
;
585 trace(" Value=%d\n",value
.dwValue
);
587 if (value
.dwValue
+ control
->Metrics
.cSteps
< S1(control
->Bounds
).dwMaximum
)
588 new_value
.dwValue
= value
.dwValue
+ control
->Metrics
.cSteps
;
590 new_value
.dwValue
= value
.dwValue
- control
->Metrics
.cSteps
;
592 new_details
.cbStruct
= sizeof(MIXERCONTROLDETAILS
);
593 new_details
.dwControlID
= control
->dwControlID
;
594 new_details
.cChannels
= 1;
595 U(new_details
).cMultipleItems
= 0;
596 new_details
.paDetails
= &new_value
;
597 new_details
.cbDetails
= sizeof(new_value
);
599 /* change the control value by one step */
600 rc
=mixerSetControlDetails((HMIXEROBJ
)mix
,&new_details
,MIXER_SETCONTROLDETAILSF_VALUE
);
601 ok(rc
==MMSYSERR_NOERROR
,"mixerSetControlDetails(MIXER_SETCONTROLDETAILSF_VALUE): "
602 "MMSYSERR_NOERROR expected, got %s\n",
604 if (rc
==MMSYSERR_NOERROR
) {
605 MIXERCONTROLDETAILS ret_details
;
606 MIXERCONTROLDETAILS_UNSIGNED ret_value
;
608 ret_details
.cbStruct
= sizeof(MIXERCONTROLDETAILS
);
609 ret_details
.dwControlID
= control
->dwControlID
;
610 ret_details
.cChannels
= 1;
611 U(ret_details
).cMultipleItems
= 0;
612 ret_details
.paDetails
= &ret_value
;
613 ret_details
.cbDetails
= sizeof(ret_value
);
615 /* read back the new control value */
616 rc
=mixerGetControlDetails((HMIXEROBJ
)mix
,&ret_details
,MIXER_GETCONTROLDETAILSF_VALUE
);
617 ok(rc
==MMSYSERR_NOERROR
,"mixerGetControlDetails(MIXER_GETCONTROLDETAILSF_VALUE): "
618 "MMSYSERR_NOERROR expected, got %s\n",
620 if (rc
==MMSYSERR_NOERROR
) {
621 /* result may not match exactly because of rounding */
622 ok(abs(ret_value
.dwValue
-new_value
.dwValue
)<=1,
623 "Couldn't change value from %d to %d, returned %d\n",
624 value
.dwValue
,new_value
.dwValue
,ret_value
.dwValue
);
626 if (abs(ret_value
.dwValue
-new_value
.dwValue
)<=1) {
627 details
.cbStruct
= sizeof(MIXERCONTROLDETAILS
);
628 details
.dwControlID
= control
->dwControlID
;
629 details
.cChannels
= 1;
630 U(details
).cMultipleItems
= 0;
631 details
.paDetails
= &value
;
632 details
.cbDetails
= sizeof(value
);
634 /* restore original value */
635 rc
=mixerSetControlDetails((HMIXEROBJ
)mix
,&details
,MIXER_SETCONTROLDETAILSF_VALUE
);
636 ok(rc
==MMSYSERR_NOERROR
,"mixerSetControlDetails(MIXER_SETCONTROLDETAILSF_VALUE): "
637 "MMSYSERR_NOERROR expected, got %s\n",
643 } else if ((control
->dwControlType
== MIXERCONTROL_CONTROLTYPE_MUTE
) ||
644 (control
->dwControlType
== MIXERCONTROL_CONTROLTYPE_BOOLEAN
) ||
645 (control
->dwControlType
== MIXERCONTROL_CONTROLTYPE_BUTTON
)) {
646 MIXERCONTROLDETAILS details
;
647 MIXERCONTROLDETAILS_BOOLEAN value
;
649 details
.cbStruct
= sizeof(MIXERCONTROLDETAILS
);
650 details
.dwControlID
= control
->dwControlID
;
651 details
.cChannels
= 1;
652 U(details
).cMultipleItems
= 0;
653 details
.paDetails
= &value
;
654 details
.cbDetails
= sizeof(value
);
656 rc
=mixerGetControlDetails((HMIXEROBJ
)mix
,&details
,MIXER_GETCONTROLDETAILSF_VALUE
);
657 ok(rc
==MMSYSERR_NOERROR
,"mixerGetControlDetails(MIXER_GETCONTROLDETAILSF_VALUE): "
658 "MMSYSERR_NOERROR expected, got %s\n",
660 if (rc
==MMSYSERR_NOERROR
&& winetest_interactive
) {
661 MIXERCONTROLDETAILS new_details
;
662 MIXERCONTROLDETAILS_BOOLEAN new_value
;
664 trace(" Value=%d\n",value
.fValue
);
666 if (value
.fValue
== FALSE
)
667 new_value
.fValue
= TRUE
;
669 new_value
.fValue
= FALSE
;
671 new_details
.cbStruct
= sizeof(MIXERCONTROLDETAILS
);
672 new_details
.dwControlID
= control
->dwControlID
;
673 new_details
.cChannels
= 1;
674 U(new_details
).cMultipleItems
= 0;
675 new_details
.paDetails
= &new_value
;
676 new_details
.cbDetails
= sizeof(new_value
);
678 /* change the control value by one step */
679 rc
=mixerSetControlDetails((HMIXEROBJ
)mix
,&new_details
,MIXER_SETCONTROLDETAILSF_VALUE
);
680 ok(rc
==MMSYSERR_NOERROR
,"mixerSetControlDetails(MIXER_SETCONTROLDETAILSF_VALUE): "
681 "MMSYSERR_NOERROR expected, got %s\n",
683 if (rc
==MMSYSERR_NOERROR
) {
684 MIXERCONTROLDETAILS ret_details
;
685 MIXERCONTROLDETAILS_BOOLEAN ret_value
;
687 ret_details
.cbStruct
= sizeof(MIXERCONTROLDETAILS
);
688 ret_details
.dwControlID
= control
->dwControlID
;
689 ret_details
.cChannels
= 1;
690 U(ret_details
).cMultipleItems
= 0;
691 ret_details
.paDetails
= &ret_value
;
692 ret_details
.cbDetails
= sizeof(ret_value
);
694 /* read back the new control value */
695 rc
=mixerGetControlDetails((HMIXEROBJ
)mix
,&ret_details
,MIXER_GETCONTROLDETAILSF_VALUE
);
696 ok(rc
==MMSYSERR_NOERROR
,"mixerGetControlDetails(MIXER_GETCONTROLDETAILSF_VALUE): "
697 "MMSYSERR_NOERROR expected, got %s\n",
699 if (rc
==MMSYSERR_NOERROR
) {
700 /* result may not match exactly because of rounding */
701 ok(ret_value
.fValue
==new_value
.fValue
,
702 "Couldn't change value from %d to %d, returned %d\n",
703 value
.fValue
,new_value
.fValue
,ret_value
.fValue
);
705 if (ret_value
.fValue
==new_value
.fValue
) {
706 details
.cbStruct
= sizeof(MIXERCONTROLDETAILS
);
707 details
.dwControlID
= control
->dwControlID
;
708 details
.cChannels
= 1;
709 U(details
).cMultipleItems
= 0;
710 details
.paDetails
= &value
;
711 details
.cbDetails
= sizeof(value
);
713 /* restore original value */
714 rc
=mixerSetControlDetails((HMIXEROBJ
)mix
,&details
,MIXER_SETCONTROLDETAILSF_VALUE
);
715 ok(rc
==MMSYSERR_NOERROR
,"mixerSetControlDetails(MIXER_SETCONTROLDETAILSF_VALUE): "
716 "MMSYSERR_NOERROR expected, got %s\n",
727 static void mixer_test_deviceW(int device
)
733 char szShortName
[MIXER_SHORT_NAME_CHARS
];
734 char szName
[MIXER_LONG_NAME_CHARS
];
735 char szPname
[MAXPNAMELEN
];
737 rc
=mixerGetDevCapsW(device
,0,sizeof(capsW
));
738 ok(rc
==MMSYSERR_INVALPARAM
,
739 "mixerGetDevCapsW: MMSYSERR_INVALPARAM expected, got %s\n",
742 rc
=mixerGetDevCapsW(device
,&capsW
,4);
743 ok(rc
==MMSYSERR_NOERROR
,
744 "mixerGetDevCapsW: MMSYSERR_NOERROR expected, got %s\n",
747 rc
=mixerGetDevCapsW(device
,&capsW
,sizeof(capsW
));
748 ok(rc
==MMSYSERR_NOERROR
,
749 "mixerGetDevCapsW: MMSYSERR_NOERROR expected, got %s\n",
752 WideCharToMultiByte(CP_ACP
,0,capsW
.szPname
, MAXPNAMELEN
,szPname
,
753 MAXPNAMELEN
,NULL
,NULL
);
754 if (winetest_interactive
) {
755 trace(" %d: \"%s\" %d.%d (%d:%d) destinations=%d\n", device
,
756 szPname
, capsW
.vDriverVersion
>> 8,
757 capsW
.vDriverVersion
& 0xff,capsW
.wMid
,capsW
.wPid
,
758 capsW
.cDestinations
);
760 trace(" %d: \"%s\" %d.%d (%d:%d)\n", device
,
761 szPname
, capsW
.vDriverVersion
>> 8,
762 capsW
.vDriverVersion
& 0xff,capsW
.wMid
,capsW
.wPid
);
766 rc
=mixerOpen(&mix
, device
, 0, 0, 0);
767 ok(rc
==MMSYSERR_NOERROR
,
768 "mixerOpen: MMSYSERR_BADDEVICEID expected, got %s\n",mmsys_error(rc
));
769 if (rc
==MMSYSERR_NOERROR
) {
770 rc
=mixerOpen(&mix
, device
, 0, 0, CALLBACK_FUNCTION
);
771 ok(rc
==MMSYSERR_INVALFLAG
,
772 "mixerOpen: MMSYSERR_INVALFLAG expected, got %s\n", mmsys_error(rc
));
774 for (d
=0;d
<capsW
.cDestinations
;d
++) {
775 MIXERLINEW mixerlineW
;
776 mixerlineW
.cbStruct
= 0;
777 mixerlineW
.dwDestination
=d
;
778 rc
=mixerGetLineInfoW((HMIXEROBJ
)mix
,&mixerlineW
,
779 MIXER_GETLINEINFOF_DESTINATION
);
780 ok(rc
==MMSYSERR_INVALPARAM
,
781 "mixerGetLineInfoW(MIXER_GETLINEINFOF_DESTINATION): "
782 "MMSYSERR_INVALPARAM expected, got %s\n",
785 mixerlineW
.cbStruct
= sizeof(mixerlineW
);
786 mixerlineW
.dwDestination
=capsW
.cDestinations
;
787 rc
=mixerGetLineInfoW((HMIXEROBJ
)mix
,&mixerlineW
,
788 MIXER_GETLINEINFOF_DESTINATION
);
789 ok(rc
==MMSYSERR_INVALPARAM
||rc
==MIXERR_INVALLINE
,
790 "mixerGetLineInfoW(MIXER_GETLINEINFOF_DESTINATION): "
791 "MMSYSERR_INVALPARAM or MIXERR_INVALLINE expected, got %s\n",
794 mixerlineW
.cbStruct
= sizeof(mixerlineW
);
795 mixerlineW
.dwDestination
=d
;
796 rc
=mixerGetLineInfoW((HMIXEROBJ
)mix
,0,
797 MIXER_GETLINEINFOF_DESTINATION
);
798 ok(rc
==MMSYSERR_INVALPARAM
,
799 "mixerGetLineInfoW(MIXER_GETLINEINFOF_DESTINATION): "
800 "MMSYSERR_INVALPARAM expected, got %s\n",
803 mixerlineW
.cbStruct
= sizeof(mixerlineW
);
804 mixerlineW
.dwDestination
=d
;
805 rc
=mixerGetLineInfoW((HMIXEROBJ
)mix
,&mixerlineW
,-1);
806 ok(rc
==MMSYSERR_INVALFLAG
,
807 "mixerGetLineInfoW(-1): MMSYSERR_INVALFLAG expected, got %s\n",
810 mixerlineW
.cbStruct
= sizeof(mixerlineW
);
811 mixerlineW
.dwDestination
=d
;
812 rc
=mixerGetLineInfoW((HMIXEROBJ
)mix
,&mixerlineW
,
813 MIXER_GETLINEINFOF_DESTINATION
);
814 ok(rc
==MMSYSERR_NOERROR
||rc
==MMSYSERR_NODRIVER
,
815 "mixerGetLineInfoW(MIXER_GETLINEINFOF_DESTINATION): "
816 "MMSYSERR_NOERROR expected, got %s\n",
818 if (rc
==MMSYSERR_NODRIVER
)
819 trace(" No Driver\n");
820 else if (rc
==MMSYSERR_NOERROR
&& winetest_interactive
) {
821 WideCharToMultiByte(CP_ACP
,0,mixerlineW
.szShortName
,
822 MIXER_SHORT_NAME_CHARS
,szShortName
,
823 MIXER_SHORT_NAME_CHARS
,NULL
,NULL
);
824 WideCharToMultiByte(CP_ACP
,0,mixerlineW
.szName
,
825 MIXER_LONG_NAME_CHARS
,szName
,
826 MIXER_LONG_NAME_CHARS
,NULL
,NULL
);
827 WideCharToMultiByte(CP_ACP
,0,mixerlineW
.Target
.szPname
,
829 MAXPNAMELEN
,NULL
, NULL
);
830 trace(" %d: \"%s\" (%s) Destination=%d Source=%d\n",
831 d
,szShortName
,szName
,
832 mixerlineW
.dwDestination
,mixerlineW
.dwSource
);
833 trace(" LineID=%08x Channels=%d "
834 "Connections=%d Controls=%d\n",
835 mixerlineW
.dwLineID
,mixerlineW
.cChannels
,
836 mixerlineW
.cConnections
,mixerlineW
.cControls
);
837 trace(" State=0x%08x(%s)\n",
838 mixerlineW
.fdwLine
,line_flags(mixerlineW
.fdwLine
));
839 trace(" ComponentType=%s\n",
840 component_type(mixerlineW
.dwComponentType
));
842 target_type(mixerlineW
.Target
.dwType
));
843 trace(" Device=%d (%s) %d.%d (%d:%d)\n",
844 mixerlineW
.Target
.dwDeviceID
,szPname
,
845 mixerlineW
.Target
.vDriverVersion
>> 8,
846 mixerlineW
.Target
.vDriverVersion
& 0xff,
847 mixerlineW
.Target
.wMid
, mixerlineW
.Target
.wPid
);
849 ns
=mixerlineW
.cConnections
;
851 mixerlineW
.cbStruct
= sizeof(mixerlineW
);
852 mixerlineW
.dwDestination
=d
;
853 mixerlineW
.dwSource
=s
;
854 rc
=mixerGetLineInfoW((HMIXEROBJ
)mix
,&mixerlineW
,
855 MIXER_GETLINEINFOF_SOURCE
);
856 ok(rc
==MMSYSERR_NOERROR
||rc
==MMSYSERR_NODRIVER
,
857 "mixerGetLineInfoW(MIXER_GETLINEINFOF_SOURCE): "
858 "MMSYSERR_NOERROR expected, got %s\n",
860 if (rc
==MMSYSERR_NODRIVER
)
861 trace(" No Driver\n");
862 else if (rc
==MMSYSERR_NOERROR
) {
863 LPMIXERCONTROLW array
;
864 MIXERLINECONTROLSW controls
;
865 if (winetest_interactive
) {
866 WideCharToMultiByte(CP_ACP
,0,mixerlineW
.szShortName
,
867 MIXER_SHORT_NAME_CHARS
,szShortName
,
868 MIXER_SHORT_NAME_CHARS
,NULL
,NULL
);
869 WideCharToMultiByte(CP_ACP
,0,mixerlineW
.szName
,
870 MIXER_LONG_NAME_CHARS
,szName
,
871 MIXER_LONG_NAME_CHARS
,NULL
,NULL
);
872 WideCharToMultiByte(CP_ACP
,0,mixerlineW
.Target
.szPname
,
874 MAXPNAMELEN
,NULL
, NULL
);
875 trace(" %d: \"%s\" (%s) Destination=%d Source=%d\n",
876 s
,szShortName
,szName
,
877 mixerlineW
.dwDestination
,mixerlineW
.dwSource
);
878 trace(" LineID=%08x Channels=%d "
879 "Connections=%d Controls=%d\n",
880 mixerlineW
.dwLineID
,mixerlineW
.cChannels
,
881 mixerlineW
.cConnections
,mixerlineW
.cControls
);
882 trace(" State=0x%08x(%s)\n",
883 mixerlineW
.fdwLine
,line_flags(mixerlineW
.fdwLine
));
884 trace(" ComponentType=%s\n",
885 component_type(mixerlineW
.dwComponentType
));
887 target_type(mixerlineW
.Target
.dwType
));
888 trace(" Device=%d (%s) %d.%d (%d:%d)\n",
889 mixerlineW
.Target
.dwDeviceID
,szPname
,
890 mixerlineW
.Target
.vDriverVersion
>> 8,
891 mixerlineW
.Target
.vDriverVersion
& 0xff,
892 mixerlineW
.Target
.wMid
, mixerlineW
.Target
.wPid
);
894 if (mixerlineW
.cControls
) {
895 array
=HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY
,
896 mixerlineW
.cControls
*sizeof(MIXERCONTROLW
));
898 rc
=mixerGetLineControlsW((HMIXEROBJ
)mix
,0,
899 MIXER_GETLINECONTROLSF_ALL
);
900 ok(rc
==MMSYSERR_INVALPARAM
,
901 "mixerGetLineControlsW(MIXER_GETLINECONTROLSF_ALL): "
902 "MMSYSERR_INVALPARAM expected, got %s\n",
904 rc
=mixerGetLineControlsW((HMIXEROBJ
)mix
,&controls
,
906 ok(rc
==MMSYSERR_INVALFLAG
||rc
==MMSYSERR_INVALPARAM
,
907 "mixerGetLineControlsA(-1): "
908 "MMSYSERR_INVALFLAG or MMSYSERR_INVALPARAM expected, got %s\n",
911 controls
.cbStruct
= sizeof(MIXERLINECONTROLSW
);
912 controls
.cControls
= mixerlineW
.cControls
;
913 controls
.dwLineID
= mixerlineW
.dwLineID
;
914 controls
.pamxctrl
= array
;
915 controls
.cbmxctrl
= sizeof(MIXERCONTROLW
);
917 /* FIXME: do MIXER_GETLINECONTROLSF_ONEBYID
918 * and MIXER_GETLINECONTROLSF_ONEBYTYPE
920 rc
=mixerGetLineControlsW((HMIXEROBJ
)mix
,&controls
,
921 MIXER_GETLINECONTROLSF_ALL
);
922 ok(rc
==MMSYSERR_NOERROR
,
923 "mixerGetLineControlsW(MIXER_GETLINECONTROLSF_ALL): "
924 "MMSYSERR_NOERROR expected, got %s\n",
926 if (rc
==MMSYSERR_NOERROR
) {
927 for(nc
=0;nc
<mixerlineW
.cControls
;nc
++) {
928 if (winetest_interactive
) {
929 WideCharToMultiByte(CP_ACP
,0,array
[nc
].szShortName
,
930 MIXER_SHORT_NAME_CHARS
,szShortName
,
931 MIXER_SHORT_NAME_CHARS
,NULL
,NULL
);
932 WideCharToMultiByte(CP_ACP
,0,array
[nc
].szName
,
933 MIXER_LONG_NAME_CHARS
,szName
,
934 MIXER_LONG_NAME_CHARS
,NULL
,NULL
);
935 trace(" %d: \"%s\" (%s) ControlID=%d\n", nc
,
936 szShortName
, szName
, array
[nc
].dwControlID
);
937 trace(" ControlType=%s\n",
938 control_type(array
[nc
].dwControlType
));
939 trace(" Control=0x%08x(%s)\n",
940 array
[nc
].fdwControl
,
941 control_flags(array
[nc
].fdwControl
));
942 trace(" Items=%d Min=%d Max=%d Step=%d\n",
943 array
[nc
].cMultipleItems
,
944 S1(array
[nc
].Bounds
).dwMinimum
,
945 S1(array
[nc
].Bounds
).dwMaximum
,
946 array
[nc
].Metrics
.cSteps
);
948 mixer_test_controlW(mix
, &array
[nc
]);
952 HeapFree(GetProcessHeap(),0,array
);
959 ok(rc
==MMSYSERR_NOERROR
|| rc
==MMSYSERR_INVALHANDLE
,
960 "mixerClose: MMSYSERR_NOERROR or MMSYSERR_INVALHANDLE expected, got %s\n",
965 static void mixer_testsA(void)
972 trace("--- Testing ASCII functions ---\n");
974 ndev
=mixerGetNumDevs();
975 trace("found %d Mixer devices\n",ndev
);
977 rc
=mixerGetDevCapsA(ndev
+1,&capsA
,sizeof(capsA
));
978 ok(rc
==MMSYSERR_BADDEVICEID
,
979 "mixerGetDevCapsA: MMSYSERR_BADDEVICEID expected, got %s\n",
982 rc
=mixerOpen(&mix
, ndev
+1, 0, 0, 0);
983 ok(rc
==MMSYSERR_BADDEVICEID
,
984 "mixerOpen: MMSYSERR_BADDEVICEID expected, got %s\n",
988 mixer_test_deviceA(d
);
991 static void mixer_testsW(void)
998 trace("--- Testing WCHAR functions ---\n");
1000 ndev
=mixerGetNumDevs();
1001 trace("found %d Mixer devices\n",ndev
);
1003 rc
=mixerGetDevCapsW(ndev
+1,&capsW
,sizeof(capsW
));
1004 ok(rc
==MMSYSERR_BADDEVICEID
||rc
==MMSYSERR_NOTSUPPORTED
,
1005 "mixerGetDevCapsW: MMSYSERR_BADDEVICEID or MMSYSERR_NOTSUPPORTED "
1006 "expected, got %s\n", mmsys_error(rc
));
1007 if (rc
==MMSYSERR_NOTSUPPORTED
)
1010 rc
=mixerOpen(&mix
, ndev
+1, 0, 0, 0);
1011 ok(rc
==MMSYSERR_BADDEVICEID
,
1012 "mixerOpen: MMSYSERR_BADDEVICEID expected, got %s\n",
1015 for (d
=0;d
<ndev
;d
++)
1016 mixer_test_deviceW(d
);