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 rc
=mixerGetLineControlsA((HMIXEROBJ
)mix
,0,
495 MIXER_GETLINECONTROLSF_ALL
);
496 ok(rc
==MMSYSERR_INVALPARAM
,
497 "mixerGetLineControlsA(MIXER_GETLINECONTROLSF_ALL): "
498 "MMSYSERR_INVALPARAM expected, got %s\n",
501 rc
=mixerGetLineControlsA((HMIXEROBJ
)mix
,&controls
,-1);
502 ok(rc
==MMSYSERR_INVALFLAG
||rc
==MMSYSERR_INVALPARAM
,
503 "mixerGetLineControlsA(-1): "
504 "MMSYSERR_INVALFLAG or MMSYSERR_INVALPARAM expected, got %s\n",
507 controls
.cbStruct
= sizeof(MIXERLINECONTROLSA
);
508 controls
.cControls
= mixerlineA
.cControls
;
509 controls
.dwLineID
= mixerlineA
.dwLineID
;
510 controls
.pamxctrl
= array
;
511 controls
.cbmxctrl
= sizeof(MIXERCONTROLA
);
513 /* FIXME: do MIXER_GETLINECONTROLSF_ONEBYID
514 * and MIXER_GETLINECONTROLSF_ONEBYTYPE
516 rc
=mixerGetLineControlsA((HMIXEROBJ
)mix
,&controls
,
517 MIXER_GETLINECONTROLSF_ALL
);
518 ok(rc
==MMSYSERR_NOERROR
,
519 "mixerGetLineControlsA(MIXER_GETLINECONTROLSF_ALL): "
520 "MMSYSERR_NOERROR expected, got %s\n",
522 if (rc
==MMSYSERR_NOERROR
) {
523 for(nc
=0;nc
<mixerlineA
.cControls
;nc
++) {
524 if (winetest_interactive
) {
525 trace(" %d: \"%s\" (%s) ControlID=%d\n", nc
,
526 array
[nc
].szShortName
,
527 array
[nc
].szName
, array
[nc
].dwControlID
);
528 trace(" ControlType=%s\n",
529 control_type(array
[nc
].dwControlType
));
530 trace(" Control=0x%08x(%s)\n",
531 array
[nc
].fdwControl
,
532 control_flags(array
[nc
].fdwControl
));
533 trace(" Items=%d Min=%d Max=%d Step=%d\n",
534 array
[nc
].cMultipleItems
,
535 S1(array
[nc
].Bounds
).dwMinimum
,
536 S1(array
[nc
].Bounds
).dwMaximum
,
537 array
[nc
].Metrics
.cSteps
);
540 mixer_test_controlA(mix
, &array
[nc
]);
544 HeapFree(GetProcessHeap(),0,array
);
552 ok(rc
==MMSYSERR_NOERROR
,
553 "mixerClose: MMSYSERR_BADDEVICEID expected, got %s\n",
558 static void mixer_test_controlW(HMIXER mix
, LPMIXERCONTROLW control
)
562 if ((control
->dwControlType
== MIXERCONTROL_CONTROLTYPE_VOLUME
) ||
563 (control
->dwControlType
== MIXERCONTROL_CONTROLTYPE_UNSIGNED
)) {
564 MIXERCONTROLDETAILS details
;
565 MIXERCONTROLDETAILS_UNSIGNED value
;
567 details
.cbStruct
= sizeof(MIXERCONTROLDETAILS
);
568 details
.dwControlID
= control
->dwControlID
;
569 details
.cChannels
= 1;
570 U(details
).cMultipleItems
= 0;
571 details
.paDetails
= &value
;
572 details
.cbDetails
= sizeof(value
);
574 /* read the current control value */
575 rc
=mixerGetControlDetails((HMIXEROBJ
)mix
,&details
,MIXER_GETCONTROLDETAILSF_VALUE
);
576 ok(rc
==MMSYSERR_NOERROR
,"mixerGetControlDetails(MIXER_GETCONTROLDETAILSF_VALUE): "
577 "MMSYSERR_NOERROR expected, got %s\n",
579 if (rc
==MMSYSERR_NOERROR
&& winetest_interactive
) {
580 MIXERCONTROLDETAILS new_details
;
581 MIXERCONTROLDETAILS_UNSIGNED new_value
;
583 trace(" Value=%d\n",value
.dwValue
);
585 if (value
.dwValue
+ control
->Metrics
.cSteps
< S1(control
->Bounds
).dwMaximum
)
586 new_value
.dwValue
= value
.dwValue
+ control
->Metrics
.cSteps
;
588 new_value
.dwValue
= value
.dwValue
- control
->Metrics
.cSteps
;
590 new_details
.cbStruct
= sizeof(MIXERCONTROLDETAILS
);
591 new_details
.dwControlID
= control
->dwControlID
;
592 new_details
.cChannels
= 1;
593 U(new_details
).cMultipleItems
= 0;
594 new_details
.paDetails
= &new_value
;
595 new_details
.cbDetails
= sizeof(new_value
);
597 /* change the control value by one step */
598 rc
=mixerSetControlDetails((HMIXEROBJ
)mix
,&new_details
,MIXER_SETCONTROLDETAILSF_VALUE
);
599 ok(rc
==MMSYSERR_NOERROR
,"mixerSetControlDetails(MIXER_SETCONTROLDETAILSF_VALUE): "
600 "MMSYSERR_NOERROR expected, got %s\n",
602 if (rc
==MMSYSERR_NOERROR
) {
603 MIXERCONTROLDETAILS ret_details
;
604 MIXERCONTROLDETAILS_UNSIGNED ret_value
;
606 ret_details
.cbStruct
= sizeof(MIXERCONTROLDETAILS
);
607 ret_details
.dwControlID
= control
->dwControlID
;
608 ret_details
.cChannels
= 1;
609 U(ret_details
).cMultipleItems
= 0;
610 ret_details
.paDetails
= &ret_value
;
611 ret_details
.cbDetails
= sizeof(ret_value
);
613 /* read back the new control value */
614 rc
=mixerGetControlDetails((HMIXEROBJ
)mix
,&ret_details
,MIXER_GETCONTROLDETAILSF_VALUE
);
615 ok(rc
==MMSYSERR_NOERROR
,"mixerGetControlDetails(MIXER_GETCONTROLDETAILSF_VALUE): "
616 "MMSYSERR_NOERROR expected, got %s\n",
618 if (rc
==MMSYSERR_NOERROR
) {
619 /* result may not match exactly because of rounding */
620 ok(abs(ret_value
.dwValue
-new_value
.dwValue
)<=1,
621 "Couldn't change value from %d to %d, returned %d\n",
622 value
.dwValue
,new_value
.dwValue
,ret_value
.dwValue
);
624 if (abs(ret_value
.dwValue
-new_value
.dwValue
)<=1) {
625 details
.cbStruct
= sizeof(MIXERCONTROLDETAILS
);
626 details
.dwControlID
= control
->dwControlID
;
627 details
.cChannels
= 1;
628 U(details
).cMultipleItems
= 0;
629 details
.paDetails
= &value
;
630 details
.cbDetails
= sizeof(value
);
632 /* restore original value */
633 rc
=mixerSetControlDetails((HMIXEROBJ
)mix
,&details
,MIXER_SETCONTROLDETAILSF_VALUE
);
634 ok(rc
==MMSYSERR_NOERROR
,"mixerSetControlDetails(MIXER_SETCONTROLDETAILSF_VALUE): "
635 "MMSYSERR_NOERROR expected, got %s\n",
641 } else if ((control
->dwControlType
== MIXERCONTROL_CONTROLTYPE_MUTE
) ||
642 (control
->dwControlType
== MIXERCONTROL_CONTROLTYPE_BOOLEAN
) ||
643 (control
->dwControlType
== MIXERCONTROL_CONTROLTYPE_BUTTON
)) {
644 MIXERCONTROLDETAILS details
;
645 MIXERCONTROLDETAILS_BOOLEAN value
;
647 details
.cbStruct
= sizeof(MIXERCONTROLDETAILS
);
648 details
.dwControlID
= control
->dwControlID
;
649 details
.cChannels
= 1;
650 U(details
).cMultipleItems
= 0;
651 details
.paDetails
= &value
;
652 details
.cbDetails
= sizeof(value
);
654 rc
=mixerGetControlDetails((HMIXEROBJ
)mix
,&details
,MIXER_GETCONTROLDETAILSF_VALUE
);
655 ok(rc
==MMSYSERR_NOERROR
,"mixerGetControlDetails(MIXER_GETCONTROLDETAILSF_VALUE): "
656 "MMSYSERR_NOERROR expected, got %s\n",
658 if (rc
==MMSYSERR_NOERROR
&& winetest_interactive
) {
659 MIXERCONTROLDETAILS new_details
;
660 MIXERCONTROLDETAILS_BOOLEAN new_value
;
662 trace(" Value=%d\n",value
.fValue
);
664 if (value
.fValue
== FALSE
)
665 new_value
.fValue
= TRUE
;
667 new_value
.fValue
= FALSE
;
669 new_details
.cbStruct
= sizeof(MIXERCONTROLDETAILS
);
670 new_details
.dwControlID
= control
->dwControlID
;
671 new_details
.cChannels
= 1;
672 U(new_details
).cMultipleItems
= 0;
673 new_details
.paDetails
= &new_value
;
674 new_details
.cbDetails
= sizeof(new_value
);
676 /* change the control value by one step */
677 rc
=mixerSetControlDetails((HMIXEROBJ
)mix
,&new_details
,MIXER_SETCONTROLDETAILSF_VALUE
);
678 ok(rc
==MMSYSERR_NOERROR
,"mixerSetControlDetails(MIXER_SETCONTROLDETAILSF_VALUE): "
679 "MMSYSERR_NOERROR expected, got %s\n",
681 if (rc
==MMSYSERR_NOERROR
) {
682 MIXERCONTROLDETAILS ret_details
;
683 MIXERCONTROLDETAILS_BOOLEAN ret_value
;
685 ret_details
.cbStruct
= sizeof(MIXERCONTROLDETAILS
);
686 ret_details
.dwControlID
= control
->dwControlID
;
687 ret_details
.cChannels
= 1;
688 U(ret_details
).cMultipleItems
= 0;
689 ret_details
.paDetails
= &ret_value
;
690 ret_details
.cbDetails
= sizeof(ret_value
);
692 /* read back the new control value */
693 rc
=mixerGetControlDetails((HMIXEROBJ
)mix
,&ret_details
,MIXER_GETCONTROLDETAILSF_VALUE
);
694 ok(rc
==MMSYSERR_NOERROR
,"mixerGetControlDetails(MIXER_GETCONTROLDETAILSF_VALUE): "
695 "MMSYSERR_NOERROR expected, got %s\n",
697 if (rc
==MMSYSERR_NOERROR
) {
698 /* result may not match exactly because of rounding */
699 ok(ret_value
.fValue
==new_value
.fValue
,
700 "Couldn't change value from %d to %d, returned %d\n",
701 value
.fValue
,new_value
.fValue
,ret_value
.fValue
);
703 if (ret_value
.fValue
==new_value
.fValue
) {
704 details
.cbStruct
= sizeof(MIXERCONTROLDETAILS
);
705 details
.dwControlID
= control
->dwControlID
;
706 details
.cChannels
= 1;
707 U(details
).cMultipleItems
= 0;
708 details
.paDetails
= &value
;
709 details
.cbDetails
= sizeof(value
);
711 /* restore original value */
712 rc
=mixerSetControlDetails((HMIXEROBJ
)mix
,&details
,MIXER_SETCONTROLDETAILSF_VALUE
);
713 ok(rc
==MMSYSERR_NOERROR
,"mixerSetControlDetails(MIXER_SETCONTROLDETAILSF_VALUE): "
714 "MMSYSERR_NOERROR expected, got %s\n",
725 static void mixer_test_deviceW(int device
)
731 char szShortName
[MIXER_SHORT_NAME_CHARS
];
732 char szName
[MIXER_LONG_NAME_CHARS
];
733 char szPname
[MAXPNAMELEN
];
735 rc
=mixerGetDevCapsW(device
,0,sizeof(capsW
));
736 ok(rc
==MMSYSERR_INVALPARAM
,
737 "mixerGetDevCapsW: MMSYSERR_INVALPARAM expected, got %s\n",
740 rc
=mixerGetDevCapsW(device
,&capsW
,4);
741 ok(rc
==MMSYSERR_NOERROR
,
742 "mixerGetDevCapsW: MMSYSERR_NOERROR expected, got %s\n",
745 rc
=mixerGetDevCapsW(device
,&capsW
,sizeof(capsW
));
746 ok(rc
==MMSYSERR_NOERROR
,
747 "mixerGetDevCapsW: MMSYSERR_NOERROR expected, got %s\n",
750 WideCharToMultiByte(CP_ACP
,0,capsW
.szPname
, MAXPNAMELEN
,szPname
,
751 MAXPNAMELEN
,NULL
,NULL
);
752 if (winetest_interactive
) {
753 trace(" %d: \"%s\" %d.%d (%d:%d) destinations=%d\n", device
,
754 szPname
, capsW
.vDriverVersion
>> 8,
755 capsW
.vDriverVersion
& 0xff,capsW
.wMid
,capsW
.wPid
,
756 capsW
.cDestinations
);
758 trace(" %d: \"%s\" %d.%d (%d:%d)\n", device
,
759 szPname
, capsW
.vDriverVersion
>> 8,
760 capsW
.vDriverVersion
& 0xff,capsW
.wMid
,capsW
.wPid
);
764 rc
=mixerOpen(&mix
, device
, 0, 0, 0);
765 ok(rc
==MMSYSERR_NOERROR
,
766 "mixerOpen: MMSYSERR_BADDEVICEID expected, got %s\n",mmsys_error(rc
));
767 if (rc
==MMSYSERR_NOERROR
) {
768 rc
=mixerOpen(&mix
, device
, 0, 0, CALLBACK_FUNCTION
);
769 ok(rc
==MMSYSERR_INVALFLAG
,
770 "mixerOpen: MMSYSERR_INVALFLAG expected, got %s\n", mmsys_error(rc
));
772 for (d
=0;d
<capsW
.cDestinations
;d
++) {
773 MIXERLINEW mixerlineW
;
774 mixerlineW
.cbStruct
= 0;
775 mixerlineW
.dwDestination
=d
;
776 rc
=mixerGetLineInfoW((HMIXEROBJ
)mix
,&mixerlineW
,
777 MIXER_GETLINEINFOF_DESTINATION
);
778 ok(rc
==MMSYSERR_INVALPARAM
,
779 "mixerGetLineInfoW(MIXER_GETLINEINFOF_DESTINATION): "
780 "MMSYSERR_INVALPARAM expected, got %s\n",
783 mixerlineW
.cbStruct
= sizeof(mixerlineW
);
784 mixerlineW
.dwDestination
=capsW
.cDestinations
;
785 rc
=mixerGetLineInfoW((HMIXEROBJ
)mix
,&mixerlineW
,
786 MIXER_GETLINEINFOF_DESTINATION
);
787 ok(rc
==MMSYSERR_INVALPARAM
||rc
==MIXERR_INVALLINE
,
788 "mixerGetLineInfoW(MIXER_GETLINEINFOF_DESTINATION): "
789 "MMSYSERR_INVALPARAM or MIXERR_INVALLINE expected, got %s\n",
792 mixerlineW
.cbStruct
= sizeof(mixerlineW
);
793 mixerlineW
.dwDestination
=d
;
794 rc
=mixerGetLineInfoW((HMIXEROBJ
)mix
,0,
795 MIXER_GETLINEINFOF_DESTINATION
);
796 ok(rc
==MMSYSERR_INVALPARAM
,
797 "mixerGetLineInfoW(MIXER_GETLINEINFOF_DESTINATION): "
798 "MMSYSERR_INVALPARAM expected, got %s\n",
801 mixerlineW
.cbStruct
= sizeof(mixerlineW
);
802 mixerlineW
.dwDestination
=d
;
803 rc
=mixerGetLineInfoW((HMIXEROBJ
)mix
,&mixerlineW
,-1);
804 ok(rc
==MMSYSERR_INVALFLAG
,
805 "mixerGetLineInfoW(-1): MMSYSERR_INVALFLAG expected, got %s\n",
808 mixerlineW
.cbStruct
= sizeof(mixerlineW
);
809 mixerlineW
.dwDestination
=d
;
810 rc
=mixerGetLineInfoW((HMIXEROBJ
)mix
,&mixerlineW
,
811 MIXER_GETLINEINFOF_DESTINATION
);
812 ok(rc
==MMSYSERR_NOERROR
||rc
==MMSYSERR_NODRIVER
,
813 "mixerGetLineInfoW(MIXER_GETLINEINFOF_DESTINATION): "
814 "MMSYSERR_NOERROR expected, got %s\n",
816 if (rc
==MMSYSERR_NODRIVER
)
817 trace(" No Driver\n");
818 else if (rc
==MMSYSERR_NOERROR
&& winetest_interactive
) {
819 WideCharToMultiByte(CP_ACP
,0,mixerlineW
.szShortName
,
820 MIXER_SHORT_NAME_CHARS
,szShortName
,
821 MIXER_SHORT_NAME_CHARS
,NULL
,NULL
);
822 WideCharToMultiByte(CP_ACP
,0,mixerlineW
.szName
,
823 MIXER_LONG_NAME_CHARS
,szName
,
824 MIXER_LONG_NAME_CHARS
,NULL
,NULL
);
825 WideCharToMultiByte(CP_ACP
,0,mixerlineW
.Target
.szPname
,
827 MAXPNAMELEN
,NULL
, NULL
);
828 trace(" %d: \"%s\" (%s) Destination=%d Source=%d\n",
829 d
,szShortName
,szName
,
830 mixerlineW
.dwDestination
,mixerlineW
.dwSource
);
831 trace(" LineID=%08x Channels=%d "
832 "Connections=%d Controls=%d\n",
833 mixerlineW
.dwLineID
,mixerlineW
.cChannels
,
834 mixerlineW
.cConnections
,mixerlineW
.cControls
);
835 trace(" State=0x%08x(%s)\n",
836 mixerlineW
.fdwLine
,line_flags(mixerlineW
.fdwLine
));
837 trace(" ComponentType=%s\n",
838 component_type(mixerlineW
.dwComponentType
));
840 target_type(mixerlineW
.Target
.dwType
));
841 trace(" Device=%d (%s) %d.%d (%d:%d)\n",
842 mixerlineW
.Target
.dwDeviceID
,szPname
,
843 mixerlineW
.Target
.vDriverVersion
>> 8,
844 mixerlineW
.Target
.vDriverVersion
& 0xff,
845 mixerlineW
.Target
.wMid
, mixerlineW
.Target
.wPid
);
847 ns
=mixerlineW
.cConnections
;
849 mixerlineW
.cbStruct
= sizeof(mixerlineW
);
850 mixerlineW
.dwDestination
=d
;
851 mixerlineW
.dwSource
=s
;
852 rc
=mixerGetLineInfoW((HMIXEROBJ
)mix
,&mixerlineW
,
853 MIXER_GETLINEINFOF_SOURCE
);
854 ok(rc
==MMSYSERR_NOERROR
||rc
==MMSYSERR_NODRIVER
,
855 "mixerGetLineInfoW(MIXER_GETLINEINFOF_SOURCE): "
856 "MMSYSERR_NOERROR expected, got %s\n",
858 if (rc
==MMSYSERR_NODRIVER
)
859 trace(" No Driver\n");
860 else if (rc
==MMSYSERR_NOERROR
) {
861 LPMIXERCONTROLW array
;
862 MIXERLINECONTROLSW controls
;
863 if (winetest_interactive
) {
864 WideCharToMultiByte(CP_ACP
,0,mixerlineW
.szShortName
,
865 MIXER_SHORT_NAME_CHARS
,szShortName
,
866 MIXER_SHORT_NAME_CHARS
,NULL
,NULL
);
867 WideCharToMultiByte(CP_ACP
,0,mixerlineW
.szName
,
868 MIXER_LONG_NAME_CHARS
,szName
,
869 MIXER_LONG_NAME_CHARS
,NULL
,NULL
);
870 WideCharToMultiByte(CP_ACP
,0,mixerlineW
.Target
.szPname
,
872 MAXPNAMELEN
,NULL
, NULL
);
873 trace(" %d: \"%s\" (%s) Destination=%d Source=%d\n",
874 s
,szShortName
,szName
,
875 mixerlineW
.dwDestination
,mixerlineW
.dwSource
);
876 trace(" LineID=%08x Channels=%d "
877 "Connections=%d Controls=%d\n",
878 mixerlineW
.dwLineID
,mixerlineW
.cChannels
,
879 mixerlineW
.cConnections
,mixerlineW
.cControls
);
880 trace(" State=0x%08x(%s)\n",
881 mixerlineW
.fdwLine
,line_flags(mixerlineW
.fdwLine
));
882 trace(" ComponentType=%s\n",
883 component_type(mixerlineW
.dwComponentType
));
885 target_type(mixerlineW
.Target
.dwType
));
886 trace(" Device=%d (%s) %d.%d (%d:%d)\n",
887 mixerlineW
.Target
.dwDeviceID
,szPname
,
888 mixerlineW
.Target
.vDriverVersion
>> 8,
889 mixerlineW
.Target
.vDriverVersion
& 0xff,
890 mixerlineW
.Target
.wMid
, mixerlineW
.Target
.wPid
);
892 if (mixerlineW
.cControls
) {
893 array
=HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY
,
894 mixerlineW
.cControls
*sizeof(MIXERCONTROLW
));
896 rc
=mixerGetLineControlsW((HMIXEROBJ
)mix
,0,
897 MIXER_GETLINECONTROLSF_ALL
);
898 ok(rc
==MMSYSERR_INVALPARAM
,
899 "mixerGetLineControlsW(MIXER_GETLINECONTROLSF_ALL): "
900 "MMSYSERR_INVALPARAM expected, got %s\n",
902 rc
=mixerGetLineControlsW((HMIXEROBJ
)mix
,&controls
,
904 ok(rc
==MMSYSERR_INVALFLAG
||rc
==MMSYSERR_INVALPARAM
,
905 "mixerGetLineControlsA(-1): "
906 "MMSYSERR_INVALFLAG or MMSYSERR_INVALPARAM expected, got %s\n",
909 controls
.cbStruct
= sizeof(MIXERLINECONTROLSW
);
910 controls
.cControls
= mixerlineW
.cControls
;
911 controls
.dwLineID
= mixerlineW
.dwLineID
;
912 controls
.pamxctrl
= array
;
913 controls
.cbmxctrl
= sizeof(MIXERCONTROLW
);
915 /* FIXME: do MIXER_GETLINECONTROLSF_ONEBYID
916 * and MIXER_GETLINECONTROLSF_ONEBYTYPE
918 rc
=mixerGetLineControlsW((HMIXEROBJ
)mix
,&controls
,
919 MIXER_GETLINECONTROLSF_ALL
);
920 ok(rc
==MMSYSERR_NOERROR
,
921 "mixerGetLineControlsW(MIXER_GETLINECONTROLSF_ALL): "
922 "MMSYSERR_NOERROR expected, got %s\n",
924 if (rc
==MMSYSERR_NOERROR
) {
925 for(nc
=0;nc
<mixerlineW
.cControls
;nc
++) {
926 if (winetest_interactive
) {
927 WideCharToMultiByte(CP_ACP
,0,array
[nc
].szShortName
,
928 MIXER_SHORT_NAME_CHARS
,szShortName
,
929 MIXER_SHORT_NAME_CHARS
,NULL
,NULL
);
930 WideCharToMultiByte(CP_ACP
,0,array
[nc
].szName
,
931 MIXER_LONG_NAME_CHARS
,szName
,
932 MIXER_LONG_NAME_CHARS
,NULL
,NULL
);
933 trace(" %d: \"%s\" (%s) ControlID=%d\n", nc
,
934 szShortName
, szName
, array
[nc
].dwControlID
);
935 trace(" ControlType=%s\n",
936 control_type(array
[nc
].dwControlType
));
937 trace(" Control=0x%08x(%s)\n",
938 array
[nc
].fdwControl
,
939 control_flags(array
[nc
].fdwControl
));
940 trace(" Items=%d Min=%d Max=%d Step=%d\n",
941 array
[nc
].cMultipleItems
,
942 S1(array
[nc
].Bounds
).dwMinimum
,
943 S1(array
[nc
].Bounds
).dwMaximum
,
944 array
[nc
].Metrics
.cSteps
);
946 mixer_test_controlW(mix
, &array
[nc
]);
950 HeapFree(GetProcessHeap(),0,array
);
957 ok(rc
==MMSYSERR_NOERROR
,
958 "mixerClose: MMSYSERR_BADDEVICEID expected, got %s\n",
963 static void mixer_testsA(void)
970 trace("--- Testing ASCII functions ---\n");
972 ndev
=mixerGetNumDevs();
973 trace("found %d Mixer devices\n",ndev
);
975 rc
=mixerGetDevCapsA(ndev
+1,&capsA
,sizeof(capsA
));
976 ok(rc
==MMSYSERR_BADDEVICEID
,
977 "mixerGetDevCapsA: MMSYSERR_BADDEVICEID expected, got %s\n",
980 rc
=mixerOpen(&mix
, ndev
+1, 0, 0, 0);
981 ok(rc
==MMSYSERR_BADDEVICEID
,
982 "mixerOpen: MMSYSERR_BADDEVICEID expected, got %s\n",
986 mixer_test_deviceA(d
);
989 static void mixer_testsW(void)
996 trace("--- Testing WCHAR functions ---\n");
998 ndev
=mixerGetNumDevs();
999 trace("found %d Mixer devices\n",ndev
);
1001 rc
=mixerGetDevCapsW(ndev
+1,&capsW
,sizeof(capsW
));
1002 ok(rc
==MMSYSERR_BADDEVICEID
||rc
==MMSYSERR_NOTSUPPORTED
,
1003 "mixerGetDevCapsW: MMSYSERR_BADDEVICEID or MMSYSERR_NOTSUPPORTED "
1004 "expected, got %s\n", mmsys_error(rc
));
1005 if (rc
==MMSYSERR_NOTSUPPORTED
)
1008 rc
=mixerOpen(&mix
, ndev
+1, 0, 0, 0);
1009 ok(rc
==MMSYSERR_BADDEVICEID
,
1010 "mixerOpen: MMSYSERR_BADDEVICEID expected, got %s\n",
1013 for (d
=0;d
<ndev
;d
++)
1014 mixer_test_deviceW(d
);