1*c2c66affSColin Finck #include <windows.h>
2*c2c66affSColin Finck #include <stdio.h>
3*c2c66affSColin Finck #include <mmsystem.h>
4*c2c66affSColin Finck
5*c2c66affSColin Finck // WINE's mmsystem.h doesn't seem to define these properly:
6*c2c66affSColin Finck
7*c2c66affSColin Finck #define MIDIOUTCAPS MIDIOUTCAPSA
8*c2c66affSColin Finck #define MIDIINCAPS MIDIINCAPSA
9*c2c66affSColin Finck #undef midiOutGetDevCaps
10*c2c66affSColin Finck #define midiOutGetDevCaps midiOutGetDevCapsA
11*c2c66affSColin Finck #undef midiInGetDevCaps
12*c2c66affSColin Finck #define midiInGetDevCaps midiInGetDevCapsA
13*c2c66affSColin Finck
14*c2c66affSColin Finck
main()15*c2c66affSColin Finck int main()
16*c2c66affSColin Finck {
17*c2c66affSColin Finck UINT outs = midiOutGetNumDevs();
18*c2c66affSColin Finck // UINT ins = midiInGetNumDevs();
19*c2c66affSColin Finck
20*c2c66affSColin Finck MIDIOUTCAPS outcaps;
21*c2c66affSColin Finck // MIDIINCAPS incaps;
22*c2c66affSColin Finck
23*c2c66affSColin Finck int c;
24*c2c66affSColin Finck
25*c2c66affSColin Finck HMIDIOUT Handle = NULL;
26*c2c66affSColin Finck UINT Result;
27*c2c66affSColin Finck
28*c2c66affSColin Finck printf("MIDI output devices: %d\n", outs);
29*c2c66affSColin Finck
30*c2c66affSColin Finck for (c = 0; c < outs; c ++)
31*c2c66affSColin Finck {
32*c2c66affSColin Finck if (midiOutGetDevCaps(c, &outcaps, sizeof(MIDIOUTCAPS)) == MMSYSERR_NOERROR)
33*c2c66affSColin Finck printf("Device #%d: %s\n", c, outcaps.szPname);
34*c2c66affSColin Finck }
35*c2c66affSColin Finck
36*c2c66affSColin Finck printf("Opening MIDI output #0\n");
37*c2c66affSColin Finck
38*c2c66affSColin Finck Result = midiOutOpen(&Handle, 0, 0, 0, CALLBACK_NULL);
39*c2c66affSColin Finck printf("Result == %d Handle == %p\n", Result, Handle);
40*c2c66affSColin Finck
41*c2c66affSColin Finck // play something:
42*c2c66affSColin Finck midiOutShortMsg(Handle, 0x007f3090);
43*c2c66affSColin Finck
44*c2c66affSColin Finck /*
45*c2c66affSColin Finck printf("\nMIDI input devices: %d\n", ins);
46*c2c66affSColin Finck
47*c2c66affSColin Finck for (c = 0; c < ins; c ++)
48*c2c66affSColin Finck {
49*c2c66affSColin Finck midiInGetDevCaps(c, &incaps, sizeof(incaps));
50*c2c66affSColin Finck printf("Device #%d: %s\n", c, incaps.szPname);
51*c2c66affSColin Finck }
52*c2c66affSColin Finck */
53*c2c66affSColin Finck return 0;
54*c2c66affSColin Finck }
55