ReactOS 0.4.16-dev-122-g325d74c
mixer.c
Go to the documentation of this file.
1/*
2 * Test mixer
3 *
4 * Copyright (c) 2004 Robert Reif
5 *
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.
10 *
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.
15 *
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
19 */
20
21/*
22 * To Do:
23 * add interactive tests
24 */
25
26#include <stdarg.h>
27#include <stdio.h>
28#include <stdlib.h>
29#include <math.h>
30
31#include "wine/test.h"
32#include "windef.h"
33#include "winbase.h"
34#include "winnls.h"
35#include "mmsystem.h"
36
37#include "winmm_test.h"
38
39static const char * line_flags(DWORD fdwLine)
40{
41 static char flags[100];
43 flags[0]=0;
44 if (fdwLine&MIXERLINE_LINEF_ACTIVE) {
45 strcat(flags,"MIXERLINE_LINEF_ACTIVE");
47 }
48 if (fdwLine&MIXERLINE_LINEF_DISCONNECTED) {
49 if (!first)
50 strcat(flags, "|");
51
52 strcat(flags,"MIXERLINE_LINEF_DISCONNECTED");
54 }
55
56 if (fdwLine&MIXERLINE_LINEF_SOURCE) {
57 if (!first)
58 strcat(flags, "|");
59
60 strcat(flags,"MIXERLINE_LINEF_SOURCE");
61 }
62
63 return flags;
64}
65
66static const char * component_type(DWORD dwComponentType)
67{
68#define TYPE_TO_STR(x) case x: return #x
69 switch (dwComponentType) {
90 }
91#undef TYPE_TO_STR
92 return "UNKNOWN";
93}
94
95static const char * target_type(DWORD dwType)
96{
97#define TYPE_TO_STR(x) case x: return #x
98 switch (dwType) {
105 }
106#undef TYPE_TO_STR
107 return "UNKNOWN";
108}
109
110static const char * control_type(DWORD dwControlType)
111{
112#define TYPE_TO_STR(x) case x: return #x
113 switch (dwControlType) {
145 }
146#undef TYPE_TO_STR
147 return "UNKNOWN";
148}
149
150static const char * control_flags(DWORD fdwControl)
151{
152 static char flags[100];
154 flags[0]=0;
155 if (fdwControl&MIXERCONTROL_CONTROLF_UNIFORM) {
156 strcat(flags,"MIXERCONTROL_CONTROLF_UNIFORM");
157 first=FALSE;
158 }
159 if (fdwControl&MIXERCONTROL_CONTROLF_MULTIPLE) {
160 if (!first)
161 strcat(flags, "|");
162
163 strcat(flags,"MIXERCONTROL_CONTROLF_MULTIPLE");
164 first=FALSE;
165 }
166
167 if (fdwControl&MIXERCONTROL_CONTROLF_DISABLED) {
168 if (!first)
169 strcat(flags, "|");
170
171 strcat(flags,"MIXERCONTROL_CONTROLF_DISABLED");
172 }
173
174 return flags;
175}
176
177static void test_mixerClose(HMIXER mix)
178{
179 MMRESULT rc;
180
181 rc = mixerClose(mix);
183 "mixerClose: MMSYSERR_NOERROR or MMSYSERR_INVALHANDLE expected, got %s\n",
184 mmsys_error(rc));
185}
186
188{
189 MMRESULT rc;
190
191 if ((control->dwControlType == MIXERCONTROL_CONTROLTYPE_VOLUME) ||
192 (control->dwControlType == MIXERCONTROL_CONTROLTYPE_UNSIGNED)) {
195
196 details.cbStruct = sizeof(MIXERCONTROLDETAILS);
197 details.dwControlID = control->dwControlID;
198 details.cChannels = 1;
199 U(details).cMultipleItems = 0;
200 details.cbDetails = sizeof(value);
201
202 /* test NULL paDetails */
203 details.paDetails = NULL;
206 "mixerGetDevCapsA: MMSYSERR_INVALPARAM expected, got %s\n",
207 mmsys_error(rc));
208
209 /* read the current control value */
210 details.paDetails = &value;
212 ok(rc==MMSYSERR_NOERROR,"mixerGetControlDetails(MIXER_GETCONTROLDETAILSF_VALUE): "
213 "MMSYSERR_NOERROR expected, got %s\n",
214 mmsys_error(rc));
216 MIXERCONTROLDETAILS new_details;
218
219 trace(" Value=%d\n",value.dwValue);
220
221 if (value.dwValue + control->Metrics.cSteps < S1(control->Bounds).dwMaximum)
222 new_value.dwValue = value.dwValue + control->Metrics.cSteps;
223 else
224 new_value.dwValue = value.dwValue - control->Metrics.cSteps;
225
226 new_details.cbStruct = sizeof(MIXERCONTROLDETAILS);
227 new_details.dwControlID = control->dwControlID;
228 new_details.cChannels = 1;
229 U(new_details).cMultipleItems = 0;
230 new_details.paDetails = &new_value;
231 new_details.cbDetails = sizeof(new_value);
232
233 /* change the control value by one step */
235 ok(rc==MMSYSERR_NOERROR,"mixerSetControlDetails(MIXER_SETCONTROLDETAILSF_VALUE): "
236 "MMSYSERR_NOERROR expected, got %s\n",
237 mmsys_error(rc));
238 if (rc==MMSYSERR_NOERROR) {
239 MIXERCONTROLDETAILS ret_details;
241
242 ret_details.cbStruct = sizeof(MIXERCONTROLDETAILS);
243 ret_details.dwControlID = control->dwControlID;
244 ret_details.cChannels = 1;
245 U(ret_details).cMultipleItems = 0;
246 ret_details.paDetails = &ret_value;
247 ret_details.cbDetails = sizeof(ret_value);
248
249 /* read back the new control value */
251 ok(rc==MMSYSERR_NOERROR,"mixerGetControlDetails(MIXER_GETCONTROLDETAILSF_VALUE): "
252 "MMSYSERR_NOERROR expected, got %s\n",
253 mmsys_error(rc));
254 if (rc==MMSYSERR_NOERROR) {
255 /* result may not match exactly because of rounding */
256 ok(abs(ret_value.dwValue-new_value.dwValue)<=1,
257 "Couldn't change value from %d to %d, returned %d\n",
258 value.dwValue,new_value.dwValue,ret_value.dwValue);
259
260 if (abs(ret_value.dwValue-new_value.dwValue)<=1) {
261 details.cbStruct = sizeof(MIXERCONTROLDETAILS);
262 details.dwControlID = control->dwControlID;
263 details.cChannels = 1;
264 U(details).cMultipleItems = 0;
265 details.paDetails = &value;
266 details.cbDetails = sizeof(value);
267
268 /* restore original value */
270 ok(rc==MMSYSERR_NOERROR,"mixerSetControlDetails(MIXER_SETCONTROLDETAILSF_VALUE): "
271 "MMSYSERR_NOERROR expected, got %s\n",
272 mmsys_error(rc));
273 }
274 }
275 }
276 }
277 } else if ((control->dwControlType == MIXERCONTROL_CONTROLTYPE_MUTE) ||
278 (control->dwControlType == MIXERCONTROL_CONTROLTYPE_BOOLEAN) ||
279 (control->dwControlType == MIXERCONTROL_CONTROLTYPE_BUTTON)) {
282
283 details.cbStruct = sizeof(MIXERCONTROLDETAILS);
284 details.dwControlID = control->dwControlID;
285 details.cChannels = 1;
286 U(details).cMultipleItems = 0;
287 details.paDetails = &value;
288 details.cbDetails = sizeof(value);
289
291 ok(rc==MMSYSERR_NOERROR,"mixerGetControlDetails(MIXER_GETCONTROLDETAILSF_VALUE): "
292 "MMSYSERR_NOERROR expected, got %s\n",
293 mmsys_error(rc));
295 MIXERCONTROLDETAILS new_details;
297
298 trace(" Value=%d\n",value.fValue);
299
300 if (value.fValue == FALSE)
301 new_value.fValue = TRUE;
302 else
303 new_value.fValue = FALSE;
304
305 new_details.cbStruct = sizeof(MIXERCONTROLDETAILS);
306 new_details.dwControlID = control->dwControlID;
307 new_details.cChannels = 1;
308 U(new_details).cMultipleItems = 0;
309 new_details.paDetails = &new_value;
310 new_details.cbDetails = sizeof(new_value);
311
312 /* change the control value by one step */
314 ok(rc==MMSYSERR_NOERROR,"mixerSetControlDetails(MIXER_SETCONTROLDETAILSF_VALUE): "
315 "MMSYSERR_NOERROR expected, got %s\n",
316 mmsys_error(rc));
317 if (rc==MMSYSERR_NOERROR) {
318 MIXERCONTROLDETAILS ret_details;
320
321 ret_details.cbStruct = sizeof(MIXERCONTROLDETAILS);
322 ret_details.dwControlID = control->dwControlID;
323 ret_details.cChannels = 1;
324 U(ret_details).cMultipleItems = 0;
325 ret_details.paDetails = &ret_value;
326 ret_details.cbDetails = sizeof(ret_value);
327
328 /* read back the new control value */
330 ok(rc==MMSYSERR_NOERROR,"mixerGetControlDetails(MIXER_GETCONTROLDETAILSF_VALUE): "
331 "MMSYSERR_NOERROR expected, got %s\n",
332 mmsys_error(rc));
333 if (rc==MMSYSERR_NOERROR) {
334 /* result may not match exactly because of rounding */
335 ok(ret_value.fValue==new_value.fValue,
336 "Couldn't change value from %d to %d, returned %d\n",
337 value.fValue,new_value.fValue,ret_value.fValue);
338
339 if (ret_value.fValue==new_value.fValue) {
340 details.cbStruct = sizeof(MIXERCONTROLDETAILS);
341 details.dwControlID = control->dwControlID;
342 details.cChannels = 1;
343 U(details).cMultipleItems = 0;
344 details.paDetails = &value;
345 details.cbDetails = sizeof(value);
346
347 /* restore original value */
349 ok(rc==MMSYSERR_NOERROR,"mixerSetControlDetails(MIXER_SETCONTROLDETAILSF_VALUE): "
350 "MMSYSERR_NOERROR expected, got %s\n",
351 mmsys_error(rc));
352 }
353 }
354 }
355 }
356 } else {
357 /* FIXME */
358 }
359}
360
362{
363 MIXERCAPSA capsA;
364 HMIXEROBJ mix;
365 MMRESULT rc;
366 DWORD d,s,ns,nc;
367
368 rc=mixerGetDevCapsA(device,0,sizeof(capsA));
370 "mixerGetDevCapsA: MMSYSERR_INVALPARAM expected, got %s\n",
371 mmsys_error(rc));
372
373 rc=mixerGetDevCapsA(device,&capsA,4);
375 "mixerGetDevCapsA: MMSYSERR_NOERROR expected, got %s\n",
376 mmsys_error(rc));
377
378 rc=mixerGetDevCapsA(device,&capsA,sizeof(capsA));
380 "mixerGetDevCapsA: MMSYSERR_NOERROR expected, got %s\n",
381 mmsys_error(rc));
382
384 trace(" %d: \"%s\" %d.%d (%d:%d) destinations=%d\n", device,
385 capsA.szPname, capsA.vDriverVersion >> 8,
386 capsA.vDriverVersion & 0xff,capsA.wMid,capsA.wPid,
387 capsA.cDestinations);
388 } else {
389 trace(" %d: \"%s\" %d.%d (%d:%d)\n", device,
390 capsA.szPname, capsA.vDriverVersion >> 8,
391 capsA.vDriverVersion & 0xff,capsA.wMid,capsA.wPid);
392 }
393
394 rc = mixerOpen((HMIXER*)&mix, device, 0, 0, 0);
396 "mixerOpen: MMSYSERR_NOERROR expected, got %s\n",mmsys_error(rc));
397 if (rc==MMSYSERR_NOERROR) {
398 MIXERCAPSA capsA2;
399
400 rc=mixerGetDevCapsA((UINT_PTR)mix,&capsA2,sizeof(capsA2));
402 "mixerGetDevCapsA: MMSYSERR_NOERROR expected, got %s\n",
403 mmsys_error(rc));
404 ok(!strcmp(capsA2.szPname, capsA.szPname), "Got wrong device caps\n");
405
406 for (d=0;d<capsA.cDestinations;d++) {
407 MIXERLINEA mixerlineA;
408 mixerlineA.cbStruct = 0;
409 mixerlineA.dwDestination=d;
412 "mixerGetLineInfoA(MIXER_GETLINEINFOF_DESTINATION): "
413 "MMSYSERR_INVALPARAM expected, got %s\n",
414 mmsys_error(rc));
415
416 mixerlineA.cbStruct = sizeof(mixerlineA);
417 mixerlineA.dwDestination=capsA.cDestinations;
420 "mixerGetLineInfoA(MIXER_GETLINEINFOF_DESTINATION): "
421 "MMSYSERR_INVALPARAM or MIXERR_INVALLINE expected, got %s\n",
422 mmsys_error(rc));
423
424 mixerlineA.cbStruct = sizeof(mixerlineA);
425 mixerlineA.dwDestination=d;
428 "mixerGetLineInfoA(MIXER_GETLINEINFOF_DESTINATION): "
429 "MMSYSERR_INVALPARAM expected, got %s\n",
430 mmsys_error(rc));
431
432 mixerlineA.cbStruct = sizeof(mixerlineA);
433 mixerlineA.dwDestination=d;
434 rc = mixerGetLineInfoA(mix, &mixerlineA, -1);
436 "mixerGetLineInfoA(-1): MMSYSERR_INVALFLAG expected, got %s\n",
437 mmsys_error(rc));
438
439 mixerlineA.cbStruct = sizeof(mixerlineA);
440 mixerlineA.dwDestination=d;
441 mixerlineA.dwUser = (ULONG_PTR)0xdeadbeef;
444 "mixerGetLineInfoA(MIXER_GETLINEINFOF_DESTINATION): "
445 "MMSYSERR_NOERROR expected, got %s\n",
446 mmsys_error(rc));
447 ok(mixerlineA.dwUser == 0, "dwUser was not reset\n");
448 if (rc==MMSYSERR_NODRIVER)
449 trace(" No Driver\n");
450 else if (rc==MMSYSERR_NOERROR) {
452 trace(" %d: \"%s\" (%s) Destination=%d Source=%d\n",
453 d,mixerlineA.szShortName, mixerlineA.szName,
454 mixerlineA.dwDestination,mixerlineA.dwSource);
455 trace(" LineID=%08x Channels=%d "
456 "Connections=%d Controls=%d\n",
457 mixerlineA.dwLineID,mixerlineA.cChannels,
458 mixerlineA.cConnections,mixerlineA.cControls);
459 trace(" State=0x%08x(%s)\n",
460 mixerlineA.fdwLine,line_flags(mixerlineA.fdwLine));
461 trace(" ComponentType=%s\n",
462 component_type(mixerlineA.dwComponentType));
463 trace(" Type=%s\n",
464 target_type(mixerlineA.Target.dwType));
465 trace(" Device=%d (%s) %d.%d (%d:%d)\n",
466 mixerlineA.Target.dwDeviceID,
467 mixerlineA.Target.szPname,
468 mixerlineA.Target.vDriverVersion >> 8,
469 mixerlineA.Target.vDriverVersion & 0xff,
470 mixerlineA.Target.wMid, mixerlineA.Target.wPid);
471 }
472 ns=mixerlineA.cConnections;
473 for(s=0;s<ns;s++) {
474 mixerlineA.cbStruct = sizeof(mixerlineA);
475 mixerlineA.dwDestination=d;
476 mixerlineA.dwSource=s;
479 "mixerGetLineInfoA(MIXER_GETLINEINFOF_SOURCE): "
480 "MMSYSERR_NOERROR expected, got %s\n",
481 mmsys_error(rc));
482 if (rc==MMSYSERR_NODRIVER)
483 trace(" No Driver\n");
484 else if (rc==MMSYSERR_NOERROR) {
486 MIXERLINECONTROLSA controls;
488 trace(" %d: \"%s\" (%s) Destination=%d Source=%d\n",
489 s,mixerlineA.szShortName, mixerlineA.szName,
490 mixerlineA.dwDestination,mixerlineA.dwSource);
491 trace(" LineID=%08x Channels=%d "
492 "Connections=%d Controls=%d\n",
493 mixerlineA.dwLineID,mixerlineA.cChannels,
494 mixerlineA.cConnections,mixerlineA.cControls);
495 trace(" State=0x%08x(%s)\n",
496 mixerlineA.fdwLine,line_flags(mixerlineA.fdwLine));
497 trace(" ComponentType=%s\n",
498 component_type(mixerlineA.dwComponentType));
499 trace(" Type=%s\n",
500 target_type(mixerlineA.Target.dwType));
501 trace(" Device=%d (%s) %d.%d (%d:%d)\n",
502 mixerlineA.Target.dwDeviceID,
503 mixerlineA.Target.szPname,
504 mixerlineA.Target.vDriverVersion >> 8,
505 mixerlineA.Target.vDriverVersion & 0xff,
506 mixerlineA.Target.wMid, mixerlineA.Target.wPid);
507 }
508 if (mixerlineA.cControls) {
510 mixerlineA.cControls*sizeof(MIXERCONTROLA));
511 if (array) {
512 memset(&controls, 0, sizeof(controls));
513
516 "mixerGetLineControlsA(MIXER_GETLINECONTROLSF_ALL): "
517 "MMSYSERR_INVALPARAM expected, got %s\n",
518 mmsys_error(rc));
519
520 rc = mixerGetLineControlsA(mix, &controls, -1);
522 "mixerGetLineControlsA(-1): "
523 "MMSYSERR_INVALFLAG or MMSYSERR_INVALPARAM expected, got %s\n",
524 mmsys_error(rc));
525
526 controls.cbStruct = sizeof(MIXERLINECONTROLSA);
527 controls.cControls = mixerlineA.cControls;
528 controls.dwLineID = mixerlineA.dwLineID;
529 controls.pamxctrl = array;
530 controls.cbmxctrl = sizeof(MIXERCONTROLA);
531
532 /* FIXME: do MIXER_GETLINECONTROLSF_ONEBYID
533 * and MIXER_GETLINECONTROLSF_ONEBYTYPE
534 */
537 "mixerGetLineControlsA(MIXER_GETLINECONTROLSF_ALL): "
538 "MMSYSERR_NOERROR expected, got %s\n",
539 mmsys_error(rc));
540 if (rc==MMSYSERR_NOERROR) {
541 for(nc=0;nc<mixerlineA.cControls;nc++) {
543 trace(" %d: \"%s\" (%s) ControlID=%d\n", nc,
544 array[nc].szShortName,
545 array[nc].szName, array[nc].dwControlID);
546 trace(" ControlType=%s\n",
547 control_type(array[nc].dwControlType));
548 trace(" Control=0x%08x(%s)\n",
549 array[nc].fdwControl,
550 control_flags(array[nc].fdwControl));
551 trace(" Items=%d Min=%d Max=%d Step=%d\n",
552 array[nc].cMultipleItems,
553 S1(array[nc].Bounds).dwMinimum,
554 S1(array[nc].Bounds).dwMaximum,
555 array[nc].Metrics.cSteps);
556 }
557
559 }
560 }
561
563 }
564 }
565 }
566 }
567 }
568 }
569 test_mixerClose((HMIXER)mix);
570 }
571}
572
574{
575 MMRESULT rc;
576
577 if ((control->dwControlType == MIXERCONTROL_CONTROLTYPE_VOLUME) ||
578 (control->dwControlType == MIXERCONTROL_CONTROLTYPE_UNSIGNED)) {
581
582 details.cbStruct = sizeof(MIXERCONTROLDETAILS);
583 details.dwControlID = control->dwControlID;
584 details.cChannels = 1;
585 U(details).cMultipleItems = 0;
586 details.paDetails = &value;
587 details.cbDetails = sizeof(value);
588
589 /* read the current control value */
591 ok(rc==MMSYSERR_NOERROR,"mixerGetControlDetails(MIXER_GETCONTROLDETAILSF_VALUE): "
592 "MMSYSERR_NOERROR expected, got %s\n",
593 mmsys_error(rc));
595 MIXERCONTROLDETAILS new_details;
597
598 trace(" Value=%d\n",value.dwValue);
599
600 if (value.dwValue + control->Metrics.cSteps < S1(control->Bounds).dwMaximum)
601 new_value.dwValue = value.dwValue + control->Metrics.cSteps;
602 else
603 new_value.dwValue = value.dwValue - control->Metrics.cSteps;
604
605 new_details.cbStruct = sizeof(MIXERCONTROLDETAILS);
606 new_details.dwControlID = control->dwControlID;
607 new_details.cChannels = 1;
608 U(new_details).cMultipleItems = 0;
609 new_details.paDetails = &new_value;
610 new_details.cbDetails = sizeof(new_value);
611
612 /* change the control value by one step */
614 ok(rc==MMSYSERR_NOERROR,"mixerSetControlDetails(MIXER_SETCONTROLDETAILSF_VALUE): "
615 "MMSYSERR_NOERROR expected, got %s\n",
616 mmsys_error(rc));
617 if (rc==MMSYSERR_NOERROR) {
618 MIXERCONTROLDETAILS ret_details;
620
621 ret_details.cbStruct = sizeof(MIXERCONTROLDETAILS);
622 ret_details.dwControlID = control->dwControlID;
623 ret_details.cChannels = 1;
624 U(ret_details).cMultipleItems = 0;
625 ret_details.paDetails = &ret_value;
626 ret_details.cbDetails = sizeof(ret_value);
627
628 /* read back the new control value */
630 ok(rc==MMSYSERR_NOERROR,"mixerGetControlDetails(MIXER_GETCONTROLDETAILSF_VALUE): "
631 "MMSYSERR_NOERROR expected, got %s\n",
632 mmsys_error(rc));
633 if (rc==MMSYSERR_NOERROR) {
634 /* result may not match exactly because of rounding */
635 ok(abs(ret_value.dwValue-new_value.dwValue)<=1,
636 "Couldn't change value from %d to %d, returned %d\n",
637 value.dwValue,new_value.dwValue,ret_value.dwValue);
638
639 if (abs(ret_value.dwValue-new_value.dwValue)<=1) {
640 details.cbStruct = sizeof(MIXERCONTROLDETAILS);
641 details.dwControlID = control->dwControlID;
642 details.cChannels = 1;
643 U(details).cMultipleItems = 0;
644 details.paDetails = &value;
645 details.cbDetails = sizeof(value);
646
647 /* restore original value */
649 ok(rc==MMSYSERR_NOERROR,"mixerSetControlDetails(MIXER_SETCONTROLDETAILSF_VALUE): "
650 "MMSYSERR_NOERROR expected, got %s\n",
651 mmsys_error(rc));
652 }
653 }
654 }
655 }
656 } else if ((control->dwControlType == MIXERCONTROL_CONTROLTYPE_MUTE) ||
657 (control->dwControlType == MIXERCONTROL_CONTROLTYPE_BOOLEAN) ||
658 (control->dwControlType == MIXERCONTROL_CONTROLTYPE_BUTTON)) {
661
662 details.cbStruct = sizeof(MIXERCONTROLDETAILS);
663 details.dwControlID = control->dwControlID;
664 details.cChannels = 1;
665 U(details).cMultipleItems = 0;
666 details.paDetails = &value;
667 details.cbDetails = sizeof(value);
668
670 ok(rc==MMSYSERR_NOERROR,"mixerGetControlDetails(MIXER_GETCONTROLDETAILSF_VALUE): "
671 "MMSYSERR_NOERROR expected, got %s\n",
672 mmsys_error(rc));
674 MIXERCONTROLDETAILS new_details;
676
677 trace(" Value=%d\n",value.fValue);
678
679 if (value.fValue == FALSE)
680 new_value.fValue = TRUE;
681 else
682 new_value.fValue = FALSE;
683
684 new_details.cbStruct = sizeof(MIXERCONTROLDETAILS);
685 new_details.dwControlID = control->dwControlID;
686 new_details.cChannels = 1;
687 U(new_details).cMultipleItems = 0;
688 new_details.paDetails = &new_value;
689 new_details.cbDetails = sizeof(new_value);
690
691 /* change the control value by one step */
693 ok(rc==MMSYSERR_NOERROR,"mixerSetControlDetails(MIXER_SETCONTROLDETAILSF_VALUE): "
694 "MMSYSERR_NOERROR expected, got %s\n",
695 mmsys_error(rc));
696 if (rc==MMSYSERR_NOERROR) {
697 MIXERCONTROLDETAILS ret_details;
699
700 ret_details.cbStruct = sizeof(MIXERCONTROLDETAILS);
701 ret_details.dwControlID = control->dwControlID;
702 ret_details.cChannels = 1;
703 U(ret_details).cMultipleItems = 0;
704 ret_details.paDetails = &ret_value;
705 ret_details.cbDetails = sizeof(ret_value);
706
707 /* read back the new control value */
709 ok(rc==MMSYSERR_NOERROR,"mixerGetControlDetails(MIXER_GETCONTROLDETAILSF_VALUE): "
710 "MMSYSERR_NOERROR expected, got %s\n",
711 mmsys_error(rc));
712 if (rc==MMSYSERR_NOERROR) {
713 /* result may not match exactly because of rounding */
714 ok(ret_value.fValue==new_value.fValue,
715 "Couldn't change value from %d to %d, returned %d\n",
716 value.fValue,new_value.fValue,ret_value.fValue);
717
718 if (ret_value.fValue==new_value.fValue) {
719 details.cbStruct = sizeof(MIXERCONTROLDETAILS);
720 details.dwControlID = control->dwControlID;
721 details.cChannels = 1;
722 U(details).cMultipleItems = 0;
723 details.paDetails = &value;
724 details.cbDetails = sizeof(value);
725
726 /* restore original value */
728 ok(rc==MMSYSERR_NOERROR,"mixerSetControlDetails(MIXER_SETCONTROLDETAILSF_VALUE): "
729 "MMSYSERR_NOERROR expected, got %s\n",
730 mmsys_error(rc));
731 }
732 }
733 }
734 }
735 } else {
736 /* FIXME */
737 }
738}
739
741{
742 MIXERCAPSW capsW;
743 HMIXEROBJ mix;
744 MMRESULT rc;
745 DWORD d,s,ns,nc;
746 char szShortName[MIXER_SHORT_NAME_CHARS];
748 char szPname[MAXPNAMELEN];
749
750 rc=mixerGetDevCapsW(device,0,sizeof(capsW));
752 "mixerGetDevCapsW: MMSYSERR_INVALPARAM expected, got %s\n",
753 mmsys_error(rc));
754
755 rc=mixerGetDevCapsW(device,&capsW,4);
756 ok(rc==MMSYSERR_NOERROR ||
757 rc==MMSYSERR_INVALPARAM, /* Vista and W2K8 */
758 "mixerGetDevCapsW: MMSYSERR_NOERROR or MMSYSERR_INVALPARAM expected, got %s\n",
759 mmsys_error(rc));
760
761 rc=mixerGetDevCapsW(device,&capsW,sizeof(capsW));
763 "mixerGetDevCapsW: MMSYSERR_NOERROR expected, got %s\n",
764 mmsys_error(rc));
765
769 trace(" %d: \"%s\" %d.%d (%d:%d) destinations=%d\n", device,
770 szPname, capsW.vDriverVersion >> 8,
771 capsW.vDriverVersion & 0xff,capsW.wMid,capsW.wPid,
772 capsW.cDestinations);
773 } else {
774 trace(" %d: \"%s\" %d.%d (%d:%d)\n", device,
775 szPname, capsW.vDriverVersion >> 8,
776 capsW.vDriverVersion & 0xff,capsW.wMid,capsW.wPid);
777 }
778
779
780 rc = mixerOpen((HMIXER*)&mix, device, 0, 0, 0);
782 "mixerOpen: MMSYSERR_NOERROR expected, got %s\n",mmsys_error(rc));
783 if (rc==MMSYSERR_NOERROR) {
784 MIXERCAPSW capsW2;
785
786 rc=mixerGetDevCapsW((UINT_PTR)mix,&capsW2,sizeof(capsW2));
788 "mixerGetDevCapsW: MMSYSERR_NOERROR expected, got %s\n",
789 mmsys_error(rc));
790 ok(!lstrcmpW(capsW2.szPname, capsW.szPname), "Got wrong device caps\n");
791
792 for (d=0;d<capsW.cDestinations;d++) {
793 MIXERLINEW mixerlineW;
794 mixerlineW.cbStruct = 0;
795 mixerlineW.dwDestination=d;
798 "mixerGetLineInfoW(MIXER_GETLINEINFOF_DESTINATION): "
799 "MMSYSERR_INVALPARAM expected, got %s\n",
800 mmsys_error(rc));
801
802 mixerlineW.cbStruct = sizeof(mixerlineW);
803 mixerlineW.dwDestination=capsW.cDestinations;
806 "mixerGetLineInfoW(MIXER_GETLINEINFOF_DESTINATION): "
807 "MMSYSERR_INVALPARAM or MIXERR_INVALLINE expected, got %s\n",
808 mmsys_error(rc));
809
810 mixerlineW.cbStruct = sizeof(mixerlineW);
811 mixerlineW.dwDestination=d;
814 "mixerGetLineInfoW(MIXER_GETLINEINFOF_DESTINATION): "
815 "MMSYSERR_INVALPARAM expected, got %s\n",
816 mmsys_error(rc));
817
818 mixerlineW.cbStruct = sizeof(mixerlineW);
819 mixerlineW.dwDestination=d;
820 rc = mixerGetLineInfoW(mix, &mixerlineW, -1);
822 "mixerGetLineInfoW(-1): MMSYSERR_INVALFLAG expected, got %s\n",
823 mmsys_error(rc));
824
825 mixerlineW.cbStruct = sizeof(mixerlineW);
826 mixerlineW.dwDestination=d;
827 mixerlineW.dwUser = (ULONG_PTR)0xdeadbeef;
830 "mixerGetLineInfoW(MIXER_GETLINEINFOF_DESTINATION): "
831 "MMSYSERR_NOERROR expected, got %s\n",
832 mmsys_error(rc));
833 ok(mixerlineW.dwUser == 0, "dwUser was not reset\n");
834 if (rc==MMSYSERR_NODRIVER)
835 trace(" No Driver\n");
836 else if (rc==MMSYSERR_NOERROR && winetest_interactive) {
838 MIXER_SHORT_NAME_CHARS,szShortName,
840 WideCharToMultiByte(CP_ACP,0,mixerlineW.szName,
843 WideCharToMultiByte(CP_ACP,0,mixerlineW.Target.szPname,
844 MAXPNAMELEN,szPname,
846 trace(" %d: \"%s\" (%s) Destination=%d Source=%d\n",
847 d,szShortName,szName,
848 mixerlineW.dwDestination,mixerlineW.dwSource);
849 trace(" LineID=%08x Channels=%d "
850 "Connections=%d Controls=%d\n",
851 mixerlineW.dwLineID,mixerlineW.cChannels,
852 mixerlineW.cConnections,mixerlineW.cControls);
853 trace(" State=0x%08x(%s)\n",
854 mixerlineW.fdwLine,line_flags(mixerlineW.fdwLine));
855 trace(" ComponentType=%s\n",
856 component_type(mixerlineW.dwComponentType));
857 trace(" Type=%s\n",
858 target_type(mixerlineW.Target.dwType));
859 trace(" Device=%d (%s) %d.%d (%d:%d)\n",
860 mixerlineW.Target.dwDeviceID,szPname,
861 mixerlineW.Target.vDriverVersion >> 8,
862 mixerlineW.Target.vDriverVersion & 0xff,
863 mixerlineW.Target.wMid, mixerlineW.Target.wPid);
864 }
865 ns=mixerlineW.cConnections;
866 for(s=0;s<ns;s++) {
867 mixerlineW.cbStruct = sizeof(mixerlineW);
868 mixerlineW.dwDestination=d;
869 mixerlineW.dwSource=s;
872 "mixerGetLineInfoW(MIXER_GETLINEINFOF_SOURCE): "
873 "MMSYSERR_NOERROR expected, got %s\n",
874 mmsys_error(rc));
875 if (rc==MMSYSERR_NODRIVER)
876 trace(" No Driver\n");
877 else if (rc==MMSYSERR_NOERROR) {
879 MIXERLINECONTROLSW controls;
882 MIXER_SHORT_NAME_CHARS,szShortName,
884 WideCharToMultiByte(CP_ACP,0,mixerlineW.szName,
887 WideCharToMultiByte(CP_ACP,0,mixerlineW.Target.szPname,
888 MAXPNAMELEN,szPname,
890 trace(" %d: \"%s\" (%s) Destination=%d Source=%d\n",
891 s,szShortName,szName,
892 mixerlineW.dwDestination,mixerlineW.dwSource);
893 trace(" LineID=%08x Channels=%d "
894 "Connections=%d Controls=%d\n",
895 mixerlineW.dwLineID,mixerlineW.cChannels,
896 mixerlineW.cConnections,mixerlineW.cControls);
897 trace(" State=0x%08x(%s)\n",
898 mixerlineW.fdwLine,line_flags(mixerlineW.fdwLine));
899 trace(" ComponentType=%s\n",
900 component_type(mixerlineW.dwComponentType));
901 trace(" Type=%s\n",
902 target_type(mixerlineW.Target.dwType));
903 trace(" Device=%d (%s) %d.%d (%d:%d)\n",
904 mixerlineW.Target.dwDeviceID,szPname,
905 mixerlineW.Target.vDriverVersion >> 8,
906 mixerlineW.Target.vDriverVersion & 0xff,
907 mixerlineW.Target.wMid, mixerlineW.Target.wPid);
908 }
909 if (mixerlineW.cControls) {
911 mixerlineW.cControls*sizeof(MIXERCONTROLW));
912 if (array) {
915 "mixerGetLineControlsW(MIXER_GETLINECONTROLSF_ALL): "
916 "MMSYSERR_INVALPARAM expected, got %s\n",
917 mmsys_error(rc));
918 rc = mixerGetLineControlsW(mix, &controls, -1);
920 "mixerGetLineControlsW(-1): "
921 "MMSYSERR_INVALFLAG or MMSYSERR_INVALPARAM expected, got %s\n",
922 mmsys_error(rc));
923
924 controls.cbStruct = sizeof(MIXERLINECONTROLSW);
925 controls.cControls = mixerlineW.cControls;
926 controls.dwLineID = mixerlineW.dwLineID;
927 controls.pamxctrl = array;
928 controls.cbmxctrl = sizeof(MIXERCONTROLW);
929
930 /* FIXME: do MIXER_GETLINECONTROLSF_ONEBYID
931 * and MIXER_GETLINECONTROLSF_ONEBYTYPE
932 */
935 "mixerGetLineControlsW(MIXER_GETLINECONTROLSF_ALL): "
936 "MMSYSERR_NOERROR expected, got %s\n",
937 mmsys_error(rc));
938 if (rc==MMSYSERR_NOERROR) {
939 for(nc=0;nc<mixerlineW.cControls;nc++) {
941 WideCharToMultiByte(CP_ACP,0,array[nc].szShortName,
942 MIXER_SHORT_NAME_CHARS,szShortName,
947 trace(" %d: \"%s\" (%s) ControlID=%d\n", nc,
948 szShortName, szName, array[nc].dwControlID);
949 trace(" ControlType=%s\n",
950 control_type(array[nc].dwControlType));
951 trace(" Control=0x%08x(%s)\n",
952 array[nc].fdwControl,
953 control_flags(array[nc].fdwControl));
954 trace(" Items=%d Min=%d Max=%d Step=%d\n",
955 array[nc].cMultipleItems,
956 S1(array[nc].Bounds).dwMinimum,
957 S1(array[nc].Bounds).dwMaximum,
958 array[nc].Metrics.cSteps);
959 }
961 }
962 }
963
965 }
966 }
967 }
968 }
969 }
970 test_mixerClose((HMIXER)mix);
971 }
972}
973
974static void mixer_testsA(void)
975{
976 MIXERCAPSA capsA;
977 MMRESULT rc;
978 UINT ndev, d;
979
980 trace("--- Testing ASCII functions ---\n");
981
982 ndev=mixerGetNumDevs();
983 trace("found %d Mixer devices\n",ndev);
984
985 rc=mixerGetDevCapsA(ndev+1,&capsA,sizeof(capsA));
987 "mixerGetDevCapsA: MMSYSERR_BADDEVICEID expected, got %s\n",
988 mmsys_error(rc));
989
990 for (d=0;d<ndev;d++)
992}
993
994static void mixer_testsW(void)
995{
996 MIXERCAPSW capsW;
997 MMRESULT rc;
998 UINT ndev, d;
999
1000 trace("--- Testing WCHAR functions ---\n");
1001
1002 ndev=mixerGetNumDevs();
1003 trace("found %d Mixer devices\n",ndev);
1004
1005 rc=mixerGetDevCapsW(ndev+1,&capsW,sizeof(capsW));
1007 "mixerGetDevCapsW: MMSYSERR_BADDEVICEID or MMSYSERR_NOTSUPPORTED "
1008 "expected, got %s\n", mmsys_error(rc));
1009 if (rc==MMSYSERR_NOTSUPPORTED)
1010 return;
1011
1012 for (d=0;d<ndev;d++)
1014}
1015
1016static void test_mixerOpen(void)
1017{
1018 HMIXER mix;
1019 HANDLE event;
1020 MMRESULT rc;
1021 UINT ndev, d;
1022
1023 ndev = mixerGetNumDevs();
1024
1025 /* Test mixerOpen with invalid device ID values. */
1026 rc = mixerOpen(&mix, ndev + 1, 0, 0, 0);
1028 "mixerOpen: MMSYSERR_BADDEVICEID expected, got %s\n",
1029 mmsys_error(rc));
1030
1031 rc = mixerOpen(&mix, -1, 0, 0, 0);
1032 ok(rc == MMSYSERR_BADDEVICEID ||
1033 rc == MMSYSERR_INVALHANDLE, /* NT4/W2K */
1034 "mixerOpen: MMSYSERR_BADDEVICEID or MMSYSERR_INVALHANDLE expected, got %s\n",
1035 mmsys_error(rc));
1036
1037 for (d = 0; d < ndev; d++) {
1038 /* Test mixerOpen with valid device ID values and invalid parameters. */
1039 rc = mixerOpen(&mix, d, 0, 0, CALLBACK_FUNCTION);
1041 || rc == MMSYSERR_NOTSUPPORTED, /* 98/ME */
1042 "mixerOpen: MMSYSERR_INVALFLAG expected, got %s\n",
1043 mmsys_error(rc));
1044
1045 rc = mixerOpen(&mix, d, 0xdeadbeef, 0, CALLBACK_WINDOW);
1046 ok(rc == MMSYSERR_INVALPARAM ||
1047 broken(rc == MMSYSERR_NOERROR /* 98 */),
1048 "mixerOpen: MMSYSERR_INVALPARAM expected, got %s\n",
1049 mmsys_error(rc));
1050 if (rc == MMSYSERR_NOERROR)
1052
1053 /* Test mixerOpen with a NULL dwCallback and CALLBACK_WINDOW flag. */
1054 rc = mixerOpen(&mix, d, 0, 0, CALLBACK_WINDOW);
1055 ok(rc == MMSYSERR_NOERROR,
1056 "mixerOpen: MMSYSERR_NOERROR expected, got %s\n",
1057 mmsys_error(rc));
1058 if (rc == MMSYSERR_NOERROR)
1060
1061 rc = mixerOpen(&mix, d, 0, 0, CALLBACK_THREAD);
1062 ok(rc == MMSYSERR_NOERROR /* since w2k */ ||
1063 rc == MMSYSERR_NOTSUPPORTED, /* 98 */
1064 "mixerOpen: MMSYSERR_NOERROR expected, got %s\n",
1065 mmsys_error(rc));
1066 if (rc == MMSYSERR_NOERROR)
1068
1069 rc = mixerOpen(&mix, d, 0, 0, CALLBACK_EVENT);
1070 ok(rc == MMSYSERR_NOERROR /* since w2k */ ||
1071 rc == MMSYSERR_NOTSUPPORTED, /* 98 */
1072 "mixerOpen: MMSYSERR_NOERROR expected, got %s\n",
1073 mmsys_error(rc));
1074 if (rc == MMSYSERR_NOERROR)
1076
1077 event = CreateEventW(NULL, FALSE, FALSE, NULL);
1078
1079 /* NOTSUPPORTED is not broken, but it enables the todo_wine marker. */
1081 todo_wine
1082 ok(rc == MMSYSERR_NOERROR /* since w2k */ ||
1083 broken(rc == MMSYSERR_NOTSUPPORTED), /* 98 */
1084 "mixerOpen: MMSYSERR_NOERROR expected, got %s\n",
1085 mmsys_error(rc));
1086 if (rc == MMSYSERR_NOERROR)
1088
1089 /* Test mixerOpen with normal parameters. */
1090 rc = mixerOpen(&mix, d, 0, 0, 0);
1091 ok(rc == MMSYSERR_NOERROR,
1092 "mixerOpen: MMSYSERR_NOERROR expected, got %s\n",
1093 mmsys_error(rc));
1094
1095 if (rc == MMSYSERR_NOERROR)
1097
1098 rc = WaitForSingleObject(event, 0);
1099 ok(rc == WAIT_TIMEOUT, "WaitEvent %d\n", rc);
1101 }
1102}
1103
1105{
1107 mixer_testsA();
1108 mixer_testsW();
1109}
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define trace
Definition: atltest.h:70
#define ok(value,...)
Definition: atltest.h:57
#define broken(x)
Definition: atltest.h:178
#define START_TEST(x)
Definition: atltest.h:75
#define U(x)
Definition: wordpad.c:45
#define WAIT_TIMEOUT
Definition: dderror.h:14
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define CloseHandle
Definition: compat.h:739
#define GetProcessHeap()
Definition: compat.h:736
#define CP_ACP
Definition: compat.h:109
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define WideCharToMultiByte
Definition: compat.h:111
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4242
#define ULONG_PTR
Definition: config.h:101
#define abs(i)
Definition: fconv.c:206
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLdouble s
Definition: gl.h:2039
struct _cl_event * event
Definition: glext.h:7739
GLbitfield flags
Definition: glext.h:7161
const GLint * first
Definition: glext.h:5794
#define d
Definition: ke_i.h:81
#define CALLBACK_WINDOW
Definition: mmsystem.h:148
#define MIXERCONTROL_CONTROLF_DISABLED
Definition: mmsystem.h:352
#define MIXERCONTROL_CONTROLTYPE_EQUALIZER
Definition: mmsystem.h:401
#define MIXERLINE_COMPONENTTYPE_DST_TELEPHONE
Definition: mmsystem.h:321
#define MIXERLINE_COMPONENTTYPE_SRC_UNDEFINED
Definition: mmsystem.h:326
#define MIXERLINE_LINEF_DISCONNECTED
Definition: mmsystem.h:312
struct tagMIXERLINECONTROLSW MIXERLINECONTROLSW
#define MIXERLINE_COMPONENTTYPE_DST_LINE
Definition: mmsystem.h:317
#define MIXERLINE_COMPONENTTYPE_DST_SPEAKERS
Definition: mmsystem.h:319
#define MIXERLINE_COMPONENTTYPE_SRC_DIGITAL
Definition: mmsystem.h:327
#define MIXERCONTROL_CONTROLTYPE_BOOLEAN
Definition: mmsystem.h:382
UINT MMRESULT
Definition: mmsystem.h:962
#define MIXERCONTROL_CONTROLTYPE_DECIBELS
Definition: mmsystem.h:390
#define MIXERLINE_TARGETTYPE_WAVEOUT
Definition: mmsystem.h:339
#define MIXERCONTROL_CONTROLF_UNIFORM
Definition: mmsystem.h:350
#define MMSYSERR_NOTSUPPORTED
Definition: mmsystem.h:104
#define MIXERLINE_COMPONENTTYPE_DST_DIGITAL
Definition: mmsystem.h:316
#define MIXERCONTROL_CONTROLTYPE_MULTIPLESELECT
Definition: mmsystem.h:404
#define MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE
Definition: mmsystem.h:329
#define MIXERCONTROL_CONTROLTYPE_ONOFF
Definition: mmsystem.h:383
#define MIXERCONTROL_CONTROLTYPE_STEREOENH
Definition: mmsystem.h:387
#define CALLBACK_THREAD
Definition: mmsystem.h:151
#define MIXERLINE_TARGETTYPE_MIDIOUT
Definition: mmsystem.h:341
#define MIXER_SETCONTROLDETAILSF_VALUE
Definition: mmsystem.h:415
#define MIXERLINE_COMPONENTTYPE_DST_HEADPHONES
Definition: mmsystem.h:320
#define MIXERLINE_COMPONENTTYPE_DST_UNDEFINED
Definition: mmsystem.h:315
#define MIXERLINE_COMPONENTTYPE_SRC_ANALOG
Definition: mmsystem.h:336
DWORD dwMaximum
Definition: mmsystem.h:1
#define MIXER_GETCONTROLDETAILSF_VALUE
Definition: mmsystem.h:412
#define MIXERCONTROL_CONTROLTYPE_MUX
Definition: mmsystem.h:403
#define MIXERLINE_COMPONENTTYPE_SRC_SYNTHESIZER
Definition: mmsystem.h:330
#define MIXERLINE_COMPONENTTYPE_DST_MONITOR
Definition: mmsystem.h:318
#define MMSYSERR_NODRIVER
Definition: mmsystem.h:102
#define MIXERCONTROL_CONTROLTYPE_LOUDNESS
Definition: mmsystem.h:386
#define MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT
Definition: mmsystem.h:334
#define MIXERLINE_TARGETTYPE_WAVEIN
Definition: mmsystem.h:340
#define MIXER_GETLINEINFOF_DESTINATION
Definition: mmsystem.h:344
#define MIXERCONTROL_CONTROLTYPE_BUTTON
Definition: mmsystem.h:389
#define MIXERLINE_COMPONENTTYPE_SRC_AUXILIARY
Definition: mmsystem.h:335
#define MIXERLINE_TARGETTYPE_MIDIIN
Definition: mmsystem.h:342
struct tagMIXERCONTROLW MIXERCONTROLW
#define MIXERCONTROL_CONTROLF_MULTIPLE
Definition: mmsystem.h:351
#define MIXERLINE_COMPONENTTYPE_SRC_LINE
Definition: mmsystem.h:328
#define MIXERCONTROL_CONTROLTYPE_FADER
Definition: mmsystem.h:397
#define MIXERCONTROL_CONTROLTYPE_VOLUME
Definition: mmsystem.h:398
#define MIXERCONTROL_CONTROLTYPE_TREBLE
Definition: mmsystem.h:400
#define MIXERCONTROL_CONTROLTYPE_MILLITIME
Definition: mmsystem.h:407
#define MIXER_LONG_NAME_CHARS
Definition: mmsystem.h:294
#define MIXERCONTROL_CONTROLTYPE_MICROTIME
Definition: mmsystem.h:406
#define CALLBACK_EVENT
Definition: mmsystem.h:152
#define MIXERCONTROL_CONTROLTYPE_UNSIGNED
Definition: mmsystem.h:392
#define MIXERCONTROL_CONTROLTYPE_QSOUNDPAN
Definition: mmsystem.h:396
#define MMSYSERR_INVALHANDLE
Definition: mmsystem.h:101
#define MIXERLINE_COMPONENTTYPE_DST_WAVEIN
Definition: mmsystem.h:322
#define MIXERCONTROL_CONTROLTYPE_BASS_BOOST
Definition: mmsystem.h:388
#define MIXERCONTROL_CONTROLTYPE_SINGLESELECT
Definition: mmsystem.h:402
#define MIXERLINE_TARGETTYPE_AUX
Definition: mmsystem.h:343
#define MIXER_GETLINEINFOF_SOURCE
Definition: mmsystem.h:345
#define MIXER_GETLINECONTROLSF_ALL
Definition: mmsystem.h:408
#define MIXERCONTROL_CONTROLTYPE_SIGNEDMETER
Definition: mmsystem.h:379
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
#define MIXERCONTROL_CONTROLTYPE_PERCENT
Definition: mmsystem.h:393
#define MIXERR_INVALLINE
Definition: mmsystem.h:295
#define MIXERCONTROL_CONTROLTYPE_MIXER
Definition: mmsystem.h:405
#define MAXPNAMELEN
Definition: mmsystem.h:24
#define MIXERCONTROL_CONTROLTYPE_PEAKMETER
Definition: mmsystem.h:380
struct tMIXERCONTROLDETAILS MIXERCONTROLDETAILS
#define MIXERLINE_LINEF_ACTIVE
Definition: mmsystem.h:311
#define MMSYSERR_INVALFLAG
Definition: mmsystem.h:106
#define MIXERCONTROL_CONTROLTYPE_UNSIGNEDMETER
Definition: mmsystem.h:381
#define MIXERCONTROL_CONTROLTYPE_SLIDER
Definition: mmsystem.h:394
#define CALLBACK_FUNCTION
Definition: mmsystem.h:150
#define MIXERLINE_COMPONENTTYPE_SRC_TELEPHONE
Definition: mmsystem.h:332
#define MIXER_SHORT_NAME_CHARS
Definition: mmsystem.h:293
#define MIXERCONTROL_CONTROLTYPE_PAN
Definition: mmsystem.h:395
#define MIXERCONTROL_CONTROLTYPE_MONO
Definition: mmsystem.h:385
#define MIXERLINE_COMPONENTTYPE_DST_VOICEIN
Definition: mmsystem.h:323
DWORD dwMinimum
Definition: mmsystem.h:0
#define MMSYSERR_BADDEVICEID
Definition: mmsystem.h:98
struct tagMIXERLINECONTROLSA MIXERLINECONTROLSA
#define MIXERCONTROL_CONTROLTYPE_SIGNED
Definition: mmsystem.h:391
#define MIXERLINE_TARGETTYPE_UNDEFINED
Definition: mmsystem.h:338
struct tagMIXERCONTROLA MIXERCONTROLA
#define MIXERCONTROL_CONTROLTYPE_BOOLEANMETER
Definition: mmsystem.h:378
#define MIXERCONTROL_CONTROLTYPE_MUTE
Definition: mmsystem.h:384
#define MIXERLINE_COMPONENTTYPE_SRC_COMPACTDISC
Definition: mmsystem.h:331
#define MIXERCONTROL_CONTROLTYPE_CUSTOM
Definition: mmsystem.h:377
#define MIXERCONTROL_CONTROLTYPE_BASS
Definition: mmsystem.h:399
#define MIXERLINE_COMPONENTTYPE_SRC_PCSPEAKER
Definition: mmsystem.h:333
#define MIXERLINE_LINEF_SOURCE
Definition: mmsystem.h:313
#define todo_wine
Definition: custom.c:89
const char * mmsys_error(MMRESULT error)
Definition: wave.c:220
static void test_mixerClose(HMIXER mix)
Definition: mixer.c:177
static void mixer_testsW(void)
Definition: mixer.c:994
static void mixer_test_controlW(HMIXEROBJ mix, MIXERCONTROLW *control)
Definition: mixer.c:573
static const char * control_flags(DWORD fdwControl)
Definition: mixer.c:150
static void mixer_testsA(void)
Definition: mixer.c:974
static void mixer_test_deviceA(int device)
Definition: mixer.c:361
static const char * component_type(DWORD dwComponentType)
Definition: mixer.c:66
static const char * target_type(DWORD dwType)
Definition: mixer.c:95
static void mixer_test_controlA(HMIXEROBJ mix, MIXERCONTROLA *control)
Definition: mixer.c:187
static void mixer_test_deviceW(int device)
Definition: mixer.c:740
static const char * control_type(DWORD dwControlType)
Definition: mixer.c:110
static const char * line_flags(DWORD fdwLine)
Definition: mixer.c:39
static void test_mixerOpen(void)
Definition: mixer.c:1016
#define TYPE_TO_STR(x)
int details
Definition: msacm.c:1366
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
unsigned int UINT
Definition: ndis.h:50
static const WCHAR szName[]
Definition: powrprof.c:45
#define S1(x)
Definition: test.h:221
int winetest_interactive
#define memset(x, y, z)
Definition: compat.h:39
Definition: dialog.c:52
Definition: devices.h:37
Definition: mxnamespace.c:45
DWORD cDestinations
Definition: mmsystem.h:1219
MMVERSION vDriverVersion
Definition: mmsystem.h:1216
CHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1217
DWORD cDestinations
Definition: mmsystem.h:1228
MMVERSION vDriverVersion
Definition: mmsystem.h:1225
WCHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1226
DWORD dwDestination
Definition: mmsystem.h:1233
CHAR szShortName[MIXER_SHORT_NAME_CHARS]
Definition: mmsystem.h:1242
DWORD dwComponentType
Definition: mmsystem.h:1238
DWORD cControls
Definition: mmsystem.h:1241
DWORD fdwLine
Definition: mmsystem.h:1236
struct tagMIXERLINEA::@3035 Target
DWORD dwLineID
Definition: mmsystem.h:1235
CHAR szName[MIXER_LONG_NAME_CHARS]
Definition: mmsystem.h:1243
DWORD dwSource
Definition: mmsystem.h:1234
DWORD_PTR dwUser
Definition: mmsystem.h:1237
DWORD cConnections
Definition: mmsystem.h:1240
DWORD cbStruct
Definition: mmsystem.h:1232
DWORD cChannels
Definition: mmsystem.h:1239
LPMIXERCONTROLA pamxctrl
Definition: mmsystem.h:1338
LPMIXERCONTROLW pamxctrl
Definition: mmsystem.h:1350
struct tagMIXERLINEW::@3036 Target
DWORD fdwLine
Definition: mmsystem.h:1259
DWORD dwDestination
Definition: mmsystem.h:1256
DWORD cControls
Definition: mmsystem.h:1264
DWORD dwSource
Definition: mmsystem.h:1257
DWORD dwLineID
Definition: mmsystem.h:1258
WCHAR szName[MIXER_LONG_NAME_CHARS]
Definition: mmsystem.h:1266
DWORD cChannels
Definition: mmsystem.h:1262
DWORD cConnections
Definition: mmsystem.h:1263
DWORD_PTR dwUser
Definition: mmsystem.h:1260
DWORD cbStruct
Definition: mmsystem.h:1255
DWORD dwComponentType
Definition: mmsystem.h:1261
WCHAR szShortName[MIXER_SHORT_NAME_CHARS]
Definition: mmsystem.h:1265
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:651
uint32_t DWORD_PTR
Definition: typedefs.h:65
Definition: pdh_main.c:94
_In_ PATHOBJ _In_ CLIPOBJ _In_ BRUSHOBJ _In_ POINTL _In_ MIX mix
Definition: winddi.h:3595
UINT WINAPI mixerGetLineControlsW(HMIXEROBJ hmix, LPMIXERLINECONTROLSW lpmlcW, DWORD fdwControls)
Definition: winmm.c:571
UINT WINAPI mixerClose(HMIXER hMix)
Definition: winmm.c:386
UINT WINAPI mixerGetLineControlsA(HMIXEROBJ hmix, LPMIXERLINECONTROLSA lpmlcA, DWORD fdwControls)
Definition: winmm.c:503
UINT WINAPI mixerGetDevCapsW(UINT_PTR uDeviceID, LPMIXERCAPSW lpCaps, UINT uSize)
Definition: winmm.c:314
UINT WINAPI mixerGetControlDetailsW(HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcdW, DWORD fdwDetails)
Definition: winmm.c:423
UINT WINAPI mixerGetLineInfoW(HMIXEROBJ hmix, LPMIXERLINEW lpmliW, DWORD fdwInfo)
Definition: winmm.c:592
UINT WINAPI mixerGetNumDevs(void)
Definition: winmm.c:280
UINT WINAPI mixerGetDevCapsA(UINT_PTR uDeviceID, LPMIXERCAPSA lpCaps, UINT uSize)
Definition: winmm.c:288
UINT WINAPI mixerOpen(LPHMIXER lphMix, UINT uDeviceID, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen)
Definition: winmm.c:339
UINT WINAPI mixerGetControlDetailsA(HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcdA, DWORD fdwDetails)
Definition: winmm.c:444
UINT WINAPI mixerGetLineInfoA(HMIXEROBJ hmix, LPMIXERLINEA lpmliA, DWORD fdwInfo)
Definition: winmm.c:612
UINT WINAPI mixerSetControlDetails(HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcd, DWORD fdwDetails)
Definition: winmm.c:681