summary refs log tree commit diff stats
path: root/lib/windows/mmsystem.nim
blob: b18ae2be4c529b95844449411c8b97ef23adcab1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
#
#
#            Nimrod's Runtime Library
#        (c) Copyright 2006 Andreas Rumpf
#
#    See the file "copying.txt", included in this
#    distribution, for details about the copyright.
#

#*********************************
#*******************************
# Generated by c2pas32  v0.9b
#     Fixed by P.V.Ozerski
# (c) 2001 Oleg Bulychov
#     Original C header file
# Gladiators Software
#     (created at Dec-03-1998)
# http://www.astonshell.com/
#   from LCC-win32 is used
#*********************************
#   LCC-win32 (c) Jacob Navia
#*******************************

import
  windows

type
  MMRESULT* = UINT
  MMVERSION* = UINT
  HWAVEOUT* = THandle
  LPHWAVEOUT* = ptr HWAVEOUT
  HWAVEIN* = THandle
  LPHWAVEIN* = ptr HWAVEOUT
  HWAVE* = THandle
  LPHWAVE* = ptr THandle
  LPUINT* = ptr UINT

const
  MAXPNAMELEN* = 32
  MAXERRORLENGTH* = 256
  MAX_JOYSTICKOEMVXDNAME* = 260
  MM_MIDI_MAPPER* = 1
  MM_WAVE_MAPPER* = 2
  MM_SNDBLST_MIDIOUT* = 3
  MM_SNDBLST_MIDIIN* = 4
  MM_SNDBLST_SYNTH* = 5
  MM_SNDBLST_WAVEOUT* = 6
  MM_SNDBLST_WAVEIN* = 7
  MM_ADLIB* = 9
  MM_MPU401_MIDIOUT* = 10
  MM_MPU401_MIDIIN* = 11
  MM_PC_JOYSTICK* = 12
  TIME_MS* = 1
  TIME_SAMPLES* = 2
  TIME_BYTES* = 4
  TIME_SMPTE* = 8
  TIME_MIDI* = 16
  TIME_TICKS* = 32
  MM_MCINOTIFY* = 0x000003B9
  MM_WOM_OPEN* = 0x000003BB
  MM_WOM_CLOSE* = 0x000003BC
  MM_WOM_DONE* = 0x000003BD
  MM_WIM_OPEN* = 0x000003BE
  MM_WIM_CLOSE* = 0x000003BF
  MM_WIM_DATA* = 0x000003C0
  MM_MIM_OPEN* = 0x000003C1
  MM_MIM_CLOSE* = 0x000003C2
  MM_MIM_DATA* = 0x000003C3
  MM_MIM_LONGDATA* = 0x000003C4
  MM_MIM_ERROR* = 0x000003C5
  MM_MIM_LONGERROR* = 0x000003C6
  MM_MOM_OPEN* = 0x000003C7
  MM_MOM_CLOSE* = 0x000003C8
  MM_MOM_DONE* = 0x000003C9
  MM_DRVM_OPEN* = 0x000003D0
  MM_DRVM_CLOSE* = 0x000003D1
  MM_DRVM_DATA* = 0x000003D2
  MM_DRVM_ERROR* = 0x000003D3
  MM_STREAM_OPEN* = 0x000003D4
  MM_STREAM_CLOSE* = 0x000003D5
  MM_STREAM_DONE* = 0x000003D6
  MM_STREAM_ERROR* = 0x000003D7
  MM_MOM_POSITIONCB* = 0x000003CA
  MM_MCISIGNAL* = 0x000003CB
  WAVE_INVALIDFORMAT* = 0
  WAVE_FORMAT_1M08* = 1
  WAVE_FORMAT_1S08* = 2
  WAVE_FORMAT_1M16* = 4
  WAVE_FORMAT_1S16* = 8
  WAVE_FORMAT_2M08* = 16
  WAVE_FORMAT_2S08* = 32
  WAVE_FORMAT_2M16* = 64
  WAVE_FORMAT_2S16* = 128
  WAVE_FORMAT_4M08* = 256
  WAVE_FORMAT_4S08* = 512
  WAVE_FORMAT_4M16* = 0x00000400
  WAVE_FORMAT_4S16* = 0x00000800
  MM_MIM_MOREDATA* = 0x000003CC
  MM_MIXM_LINE_CHANGE* = 0x000003D0
  MM_MIXM_CONTROL_CHANGE* = 0x000003D1
  MMSYSERR_BASE* = 0
  WAVERR_BASE* = 32
  MIDIERR_BASE* = 64
  TIMERR_BASE* = 96
  JOYERR_BASE* = 160
  MCIERR_BASE* = 256
  MIXERR_BASE* = 1024
  MCI_STRING_OFFSET* = 512
  MCI_VD_OFFSET* = 1024
  MCI_CD_OFFSET* = 1088
  MCI_WAVE_OFFSET* = 1152
  MCI_SEQ_OFFSET* = 1216
  MMSYSERR_NOERROR* = 0
  MMSYSERR_ERROR* = (MMSYSERR_BASE + 1)
  MMSYSERR_BADDEVICEID* = (MMSYSERR_BASE + 2)
  MMSYSERR_NOTENABLED* = (MMSYSERR_BASE + 3)
  MMSYSERR_ALLOCATED* = (MMSYSERR_BASE + 4)
  MMSYSERR_INVALHANDLE* = (MMSYSERR_BASE + 5)
  MMSYSERR_NODRIVER* = (MMSYSERR_BASE + 6)
  MMSYSERR_NOMEM* = (MMSYSERR_BASE + 7)
  MMSYSERR_NOTSUPPORTED* = (MMSYSERR_BASE + 8)
  MMSYSERR_BADERRNUM* = (MMSYSERR_BASE + 9)
  MMSYSERR_INVALFLAG* = (MMSYSERR_BASE + 10)
  MMSYSERR_INVALPARAM* = (MMSYSERR_BASE + 11)
  MMSYSERR_HANDLEBUSY* = (MMSYSERR_BASE + 12)
  MMSYSERR_INVALIDALIAS* = (MMSYSERR_BASE + 13)
  MMSYSERR_BADDB* = (MMSYSERR_BASE + 14)
  MMSYSERR_KEYNOTFOUND* = (MMSYSERR_BASE + 15)
  MMSYSERR_READERROR* = (MMSYSERR_BASE + 16)
  MMSYSERR_WRITEERROR* = (MMSYSERR_BASE + 17)
  MMSYSERR_DELETEERROR* = (MMSYSERR_BASE + 18)
  MMSYSERR_VALNOTFOUND* = (MMSYSERR_BASE + 19)
  MMSYSERR_NODRIVERCB* = (MMSYSERR_BASE + 20)
  MMSYSERR_LASTERROR* = (MMSYSERR_BASE + 20)
  MM_JOY1MOVE* = 0x000003A0
  MM_JOY2MOVE* = 0x000003A1
  MM_JOY1ZMOVE* = 0x000003A2
  MM_JOY2ZMOVE* = 0x000003A3
  MM_JOY1BUTTONDOWN* = 0x000003B5
  MM_JOY2BUTTONDOWN* = 0x000003B6
  MM_JOY1BUTTONUP* = 0x000003B7
  MM_JOY2BUTTONUP* = 0x000003B8
  CALLBACK_TYPEMASK* = 0x00070000
  CALLBACK_NULL* = 0
  CALLBACK_EVENT* = 0x00050000
  CALLBACK_WINDOW* = 0x00010000
  CALLBACK_TASK* = 0x00020000
  CALLBACK_THREAD* = CALLBACK_TASK
  CALLBACK_FUNCTION* = 0x00030000

type
  HDRVR* = THandle

const
  DRV_LOAD* = 1
  DRV_ENABLE* = 2
  DRV_OPEN* = 0x00000003
  DRV_CLOSE* = 4
  DRV_DISABLE* = 0x00000005
  DRV_FREE* = 0x00000006
  DRV_CONFIGURE* = 0x00000007
  DRV_QUERYCONFIGURE* = 8
  DRV_INSTALL* = 0x00000009
  DRV_REMOVE* = 0x0000000A
  DRV_EXITSESSION* = 0x0000000B
  DRV_POWER* = 0x0000000F
  DRV_RESERVED* = 0x00000800
  DRV_USER* = 0x00004000
  DRVCNF_CANCEL* = 0
  DRVCNF_OK* = 1
  DRVCNF_RESTART* = 2
  DRV_CANCEL* = DRVCNF_CANCEL
  DRV_OK* = DRVCNF_OK
  DRV_RESTART* = DRVCNF_RESTART
  DRV_MCI_FIRST* = DRV_RESERVED
  DRV_MCI_LAST* = (DRV_RESERVED + 0x00000FFF)

type
  PDRVCALLBACK* = proc (hdrvr: tHandle, uMsg: UINT, dwUser, dw1, dw2: DWORD){.
      stdcall.}

proc sndPlaySoundA*(Name: LPCSTR, flags: UINT): BOOL{.stdcall,
    dynlib: "winmm.dll", importc: "sndPlaySoundA".}
proc sndPlaySoundW*(Name: LPCWSTR, flags: UINT): BOOL{.stdcall,
    dynlib: "winmm.dll", importc: "sndPlaySoundW".}
when defined(winUNICODE):
  proc sndPlaySound*(Name: cstring, flags: UINT): BOOL{.stdcall,
      dynlib: "winmm.dll", importc: "sndPlaySoundW".}
else:
  proc sndPlaySound*(Name: cstring, flags: UINT): BOOL{.stdcall,
      dynlib: "winmm.dll", importc: "sndPlaySoundA".}
const
  SND_NODEFAULT* = 2
  SND_MEMORY* = 4
  SND_LOOP* = 8
  SND_NOSTOP* = 16
  SND_SYNC* = 0
  SND_ASYNC* = 1
  SND_PURGE* = 64
  SND_APPLICATION* = 128
  SND_ALIAS_START* = 0
  SND_ALIAS_SYSTEMHAND* = 18515
  SND_ALIAS_SYSTEMEXCLAMATION* = 8531
  SND_ALIAS_SYSTEMASTERISK* = 10835
  SND_ALIAS_SYSTEMQUESTION* = 16211
  SND_ALIAS_SYSTEMDEFAULT* = 17491
  SND_ALIAS_SYSTEMEXIT* = 17747
  SND_ALIAS_SYSTEMSTART* = 21331
  SND_ALIAS_SYSTEMWELCOME* = 22355
  SND_NOWAIT* = 0x00002000
  SND_ALIAS* = 0x00010000
  SND_ALIAS_ID* = 0x00110000
  SND_FILENAME* = 0x00020000
  SND_RESOURCE* = 0x00040004
  WAVERR_BADFORMAT* = (WAVERR_BASE + 0)
  WAVERR_STILLPLAYING* = (WAVERR_BASE + 1)
  WAVERR_UNPREPARED* = (WAVERR_BASE + 2)
  WAVERR_SYNC* = (WAVERR_BASE + 3)
  WAVERR_LASTERROR* = (WAVERR_BASE + 3)
  WOM_OPEN* = MM_WOM_OPEN
  WOM_CLOSE* = MM_WOM_CLOSE
  WOM_DONE* = MM_WOM_DONE
  WIM_OPEN* = MM_WIM_OPEN
  WIM_CLOSE* = MM_WIM_CLOSE
  WIM_DATA* = MM_WIM_DATA
  WAVE_MAPPER* = UINT(- 1)
  WAVE_FORMAT_QUERY* = 1
  WAVE_ALLOWSYNC* = 2
  WAVE_MAPPED* = 4
  WAVE_FORMAT_DIRECT* = 8
  WAVE_FORMAT_DIRECT_QUERY* = (WAVE_FORMAT_QUERY Or WAVE_FORMAT_DIRECT)
  MIM_OPEN* = MM_MIM_OPEN
  MIM_CLOSE* = MM_MIM_CLOSE
  MIM_DATA* = MM_MIM_DATA
  MIM_LONGDATA* = MM_MIM_LONGDATA
  MIM_ERROR* = MM_MIM_ERROR
  MIM_LONGERROR* = MM_MIM_LONGERROR
  MOM_OPEN* = MM_MOM_OPEN
  MOM_CLOSE* = MM_MOM_CLOSE
  MOM_DONE* = MM_MOM_DONE
  MIM_MOREDATA* = MM_MIM_MOREDATA
  MOM_POSITIONCB* = MM_MOM_POSITIONCB
  MIDIMAPPER* = UINT(- 1)
  MIDI_IO_STATUS* = 32
  MIDI_CACHE_ALL* = 1
  MIDI_CACHE_BESTFIT* = 2
  MIDI_CACHE_QUERY* = 3
  MIDI_UNCACHE* = 4
  WHDR_DONE* = 1
  WHDR_PREPARED* = 2
  WHDR_BEGINLOOP* = 0x00000004
  WHDR_ENDLOOP* = 0x00000008
  WHDR_INQUEUE* = 0x00000010
  MOD_MIDIPORT* = 1
  MOD_SYNTH* = 2
  MOD_SQSYNTH* = 3
  MOD_FMSYNTH* = 4
  MOD_MAPPER* = 5
  MIDICAPS_VOLUME* = 1
  MIDICAPS_LRVOLUME* = 2
  MIDICAPS_CACHE* = 4
  MIDICAPS_STREAM* = 8
  MHDR_DONE* = 1
  MHDR_PREPARED* = 2
  MHDR_INQUEUE* = 0x00000004
  MHDR_ISSTRM* = 0x00000008
  MEVT_F_SHORT* = 0
  MEVT_F_LONG* = 0x80000000
  MEVT_F_CALLBACK* = 0x40000000

proc MEVT_EVENTTYPE*(x: int8): int8
proc MEVT_EVENTPARM*(x: DWORD): DWORD
const
  MEVT_SHORTMSG* = 0
  MEVT_TEMPO* = 0x00000001
  MEVT_NOP* = 0x00000002
  MEVT_LONGMSG* = 0x00000080
  MEVT_COMMENT* = 0x00000082
  MEVT_VERSION* = 0x00000084
  MIDISTRM_ERROR* = - 2
  MIDIPROP_SET* = 0x80000000
  MIDIPROP_GET* = 0x40000000
  MIDIPROP_TIMEDIV* = 1
  MIDIPROP_TEMPO* = 2
  MIXERLINE_LINEF_ACTIVE* = 1
  MIXERLINE_LINEF_DISCONNECTED* = 0x00008000
  MIXERLINE_LINEF_SOURCE* = 0x80000000
  MIXERLINE_COMPONENTTYPE_DST_FIRST* = 0
  MIXERLINE_COMPONENTTYPE_DST_UNDEFINED* = (MIXERLINE_COMPONENTTYPE_DST_FIRST)
  MIXERLINE_COMPONENTTYPE_DST_DIGITAL* = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 1)
  MIXERLINE_COMPONENTTYPE_DST_LINE* = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 2)
  MIXERLINE_COMPONENTTYPE_DST_MONITOR* = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 3)
  MIXERLINE_COMPONENTTYPE_DST_SPEAKERS* = (MIXERLINE_COMPONENTTYPE_DST_FIRST +
      4)
  MIXERLINE_COMPONENTTYPE_DST_HEADPHONES* = (
    MIXERLINE_COMPONENTTYPE_DST_FIRST + 5)
  MIXERLINE_COMPONENTTYPE_DST_TELEPHONE* = (
    MIXERLINE_COMPONENTTYPE_DST_FIRST + 6)
  MIXERLINE_COMPONENTTYPE_DST_WAVEIN* = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 7)
  MIXERLINE_COMPONENTTYPE_DST_VOICEIN* = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 8)
  MIXERLINE_COMPONENTTYPE_DST_LAST* = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 8)
  MIXERLINE_COMPONENTTYPE_SRC_FIRST* = 0x00001000
  MIXERLINE_COMPONENTTYPE_SRC_UNDEFINED* = (
    MIXERLINE_COMPONENTTYPE_SRC_FIRST + 0)
  MIXERLINE_COMPONENTTYPE_SRC_DIGITAL* = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 1)
  MIXERLINE_COMPONENTTYPE_SRC_LINE* = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 2)
  MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE* = (
    MIXERLINE_COMPONENTTYPE_SRC_FIRST + 3)
  MIXERLINE_COMPONENTTYPE_SRC_SYNTHESIZER* = (
    MIXERLINE_COMPONENTTYPE_SRC_FIRST + 4)
  MIXERLINE_COMPONENTTYPE_SRC_COMPACTDISC* = (
    MIXERLINE_COMPONENTTYPE_SRC_FIRST + 5)
  MIXERLINE_COMPONENTTYPE_SRC_TELEPHONE* = (
    MIXERLINE_COMPONENTTYPE_SRC_FIRST + 6)
  MIXERLINE_COMPONENTTYPE_SRC_PCSPEAKER* = (
    MIXERLINE_COMPONENTTYPE_SRC_FIRST + 7)
  MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT* = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 8)
  MIXERLINE_COMPONENTTYPE_SRC_AUXILIARY* = (
    MIXERLINE_COMPONENTTYPE_SRC_FIRST + 9)
  MIXERLINE_COMPONENTTYPE_SRC_ANALOG* = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 10)
  MIXERLINE_COMPONENTTYPE_SRC_LAST* = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 10)
  MIXERLINE_TARGETTYPE_UNDEFINED* = 0
  MIXERLINE_TARGETTYPE_WAVEOUT* = 1
  MIXERLINE_TARGETTYPE_WAVEIN* = 2
  MIXERLINE_TARGETTYPE_MIDIOUT* = 3
  MIXERLINE_TARGETTYPE_MIDIIN* = 4
  MIXERLINE_TARGETTYPE_AUX* = 5
  MIDIERR_UNPREPARED* = (MIDIERR_BASE + 0)
  MIDIERR_STILLPLAYING* = (MIDIERR_BASE + 1)
  MIDIERR_NOMAP* = (MIDIERR_BASE + 2)
  MIDIERR_NOTREADY* = (MIDIERR_BASE + 3)
  MIDIERR_NODEVICE* = (MIDIERR_BASE + 4)
  MIDIERR_INVALIDSETUP* = (MIDIERR_BASE + 5)
  MIDIERR_BADOPENMODE* = (MIDIERR_BASE + 6)
  MIDIERR_DONT_CONTINUE* = (MIDIERR_BASE + 7)
  MIDIERR_LASTERROR* = (MIDIERR_BASE + 7)
  MIXERCONTROL_CONTROLF_UNIFORM* = 1
  MIXERCONTROL_CONTROLF_MULTIPLE* = 2
  MIXERCONTROL_CONTROLF_DISABLED* = 0x80000000
  MIXERCONTROL_CT_CLASS_MASK* = 0xF0000000
  MIXERCONTROL_CT_CLASS_CUSTOM* = 0
  MIXERCONTROL_CT_CLASS_METER* = 0x10000000
  MIXERCONTROL_CT_CLASS_SWITCH* = 0x20000000
  MIXERCONTROL_CT_CLASS_NUMBER* = 0x30000000
  MIXERCONTROL_CT_CLASS_SLIDER* = 0x40000000
  MIXERCONTROL_CT_CLASS_FADER* = 0x50000000
  MIXERCONTROL_CT_CLASS_TIME* = 0x60000000
  MIXERCONTROL_CT_CLASS_LIST* = 0x70000000
  MIXERCONTROL_CT_SUBCLASS_MASK* = 0x0F000000
  MIXERCONTROL_CT_SC_SWITCH_BOOLEAN* = 0
  MIXERCONTROL_CT_SC_SWITCH_BUTTON* = 0x01000000
  MIXERCONTROL_CT_SC_METER_POLLED* = 0
  MIXERCONTROL_CT_SC_TIME_MICROSECS* = 0
  MIXERCONTROL_CT_SC_TIME_MILLISECS* = 0x01000000
  MIXERCONTROL_CT_SC_LIST_SINGLE* = 0
  MIXERCONTROL_CT_SC_LIST_MULTIPLE* = 0x01000000
  MIXERCONTROL_CT_UNITS_MASK* = 0x00FF0000
  MIXERCONTROL_CT_UNITS_CUSTOM* = 0
  MIXERCONTROL_CT_UNITS_BOOLEAN* = 0x00010000
  MIXERCONTROL_CT_UNITS_SIGNED* = 0x00020000
  MIXERCONTROL_CT_UNITS_UNSIGNED* = 0x00030000
  MIXERCONTROL_CT_UNITS_DECIBELS* = 0x00040000
  MIXERCONTROL_CT_UNITS_PERCENT* = 0x00050000
  MIXERCONTROL_CONTROLTYPE_CUSTOM* = (
    MIXERCONTROL_CT_CLASS_CUSTOM Or MIXERCONTROL_CT_UNITS_CUSTOM)
  MIXERCONTROL_CONTROLTYPE_BOOLEANMETER* = (MIXERCONTROL_CT_CLASS_METER Or
      MIXERCONTROL_CT_SC_METER_POLLED Or MIXERCONTROL_CT_UNITS_BOOLEAN)
  MIXERCONTROL_CONTROLTYPE_SIGNEDMETER* = (MIXERCONTROL_CT_CLASS_METER Or
      MIXERCONTROL_CT_SC_METER_POLLED Or MIXERCONTROL_CT_UNITS_SIGNED)
  MIXERCONTROL_CONTROLTYPE_PEAKMETER* = (
    MIXERCONTROL_CONTROLTYPE_SIGNEDMETER + 1)
  MIXERCONTROL_CONTROLTYPE_UNSIGNEDMETER* = (MIXERCONTROL_CT_CLASS_METER Or
      MIXERCONTROL_CT_SC_METER_POLLED Or MIXERCONTROL_CT_UNITS_UNSIGNED)
  MIXERCONTROL_CONTROLTYPE_BOOLEAN* = (MIXERCONTROL_CT_CLASS_SWITCH Or
      MIXERCONTROL_CT_SC_SWITCH_BOOLEAN Or MIXERCONTROL_CT_UNITS_BOOLEAN)
  MIXERCONTROL_CONTROLTYPE_ONOFF* = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 1)
  MIXERCONTROL_CONTROLTYPE_MUTE* = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 2)
  MIXERCONTROL_CONTROLTYPE_MONO* = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 3)
  MIXERCONTROL_CONTROLTYPE_LOUDNESS* = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 4)
  MIXERCONTROL_CONTROLTYPE_STEREOENH* = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 5)
  MIXERCONTROL_CONTROLTYPE_BUTTON* = (MIXERCONTROL_CT_CLASS_SWITCH Or
      MIXERCONTROL_CT_SC_SWITCH_BUTTON Or MIXERCONTROL_CT_UNITS_BOOLEAN)
  MIXERCONTROL_CONTROLTYPE_DECIBELS* = (
    MIXERCONTROL_CT_CLASS_NUMBER Or MIXERCONTROL_CT_UNITS_DECIBELS)
  MIXERCONTROL_CONTROLTYPE_SIGNED* = (
    MIXERCONTROL_CT_CLASS_NUMBER Or MIXERCONTROL_CT_UNITS_SIGNED)
  MIXERCONTROL_CONTROLTYPE_UNSIGNED* = (
    MIXERCONTROL_CT_CLASS_NUMBER Or MIXERCONTROL_CT_UNITS_UNSIGNED)
  MIXERCONTROL_CONTROLTYPE_PERCENT* = (
    MIXERCONTROL_CT_CLASS_NUMBER Or MIXERCONTROL_CT_UNITS_PERCENT)
  MIXERCONTROL_CONTROLTYPE_SLIDER* = (
    MIXERCONTROL_CT_CLASS_SLIDER Or MIXERCONTROL_CT_UNITS_SIGNED)
  MIXERCONTROL_CONTROLTYPE_PAN* = (MIXERCONTROL_CONTROLTYPE_SLIDER + 1)
  MIXERCONTROL_CONTROLTYPE_QSOUNDPAN* = (MIXERCONTROL_CONTROLTYPE_SLIDER + 2)
  MIXERCONTROL_CONTROLTYPE_FADER* = (
    MIXERCONTROL_CT_CLASS_FADER Or MIXERCONTROL_CT_UNITS_UNSIGNED)
  MIXERCONTROL_CONTROLTYPE_VOLUME* = (MIXERCONTROL_CONTROLTYPE_FADER + 1)
  MIXERCONTROL_CONTROLTYPE_BASS* = (MIXERCONTROL_CONTROLTYPE_FADER + 2)
  MIXERCONTROL_CONTROLTYPE_TREBLE* = (MIXERCONTROL_CONTROLTYPE_FADER + 3)
  MIXERCONTROL_CONTROLTYPE_EQUALIZER* = (MIXERCONTROL_CONTROLTYPE_FADER + 4)
  MIXERCONTROL_CONTROLTYPE_SINGLESELECT* = (MIXERCONTROL_CT_CLASS_LIST Or
      MIXERCONTROL_CT_SC_LIST_SINGLE Or MIXERCONTROL_CT_UNITS_BOOLEAN)
  MIXERCONTROL_CONTROLTYPE_MUX* = (MIXERCONTROL_CONTROLTYPE_SINGLESELECT + 1)
  MIXERCONTROL_CONTROLTYPE_MULTIPLESELECT* = (MIXERCONTROL_CT_CLASS_LIST Or
      MIXERCONTROL_CT_SC_LIST_MULTIPLE Or MIXERCONTROL_CT_UNITS_BOOLEAN)
  MIXERCONTROL_CONTROLTYPE_MIXER* = (MIXERCONTROL_CONTROLTYPE_MULTIPLESELECT +
      1)
  MIXERCONTROL_CONTROLTYPE_MICROTIME* = (MIXERCONTROL_CT_CLASS_TIME Or
      MIXERCONTROL_CT_SC_TIME_MICROSECS Or MIXERCONTROL_CT_UNITS_UNSIGNED)
  MIXERCONTROL_CONTROLTYPE_MILLITIME* = (MIXERCONTROL_CT_CLASS_TIME Or
      MIXERCONTROL_CT_SC_TIME_MILLISECS Or MIXERCONTROL_CT_UNITS_UNSIGNED)
  MIXER_SHORT_NAME_CHARS* = 16
  MIXER_LONG_NAME_CHARS* = 64
  MIXERR_INVALLINE* = (MIXERR_BASE + 0)
  MIXERR_INVALCONTROL* = (MIXERR_BASE + 1)
  MIXERR_INVALVALUE* = (MIXERR_BASE + 2)
  MIXERR_LASTERROR* = (MIXERR_BASE + 2)
  MIXER_OBJECTF_HANDLE* = 0x80000000
  MIXER_OBJECTF_MIXER* = 0
  MIXER_OBJECTF_HMIXER* = (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_MIXER)
  MIXER_OBJECTF_WAVEOUT* = 0x10000000
  MIXER_OBJECTF_HWAVEOUT* = (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_WAVEOUT)
  MIXER_OBJECTF_WAVEIN* = 0x20000000
  MIXER_OBJECTF_HWAVEIN* = (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_WAVEIN)
  MIXER_OBJECTF_MIDIOUT* = 0x30000000
  MIXER_OBJECTF_HMIDIOUT* = (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_MIDIOUT)
  MIXER_OBJECTF_MIDIIN* = 0x40000000
  MIXER_OBJECTF_HMIDIIN* = (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_MIDIIN)
  MIXER_OBJECTF_AUX* = 0x50000000
  MIXER_GETCONTROLDETAILSF_VALUE* = 0
  MIXER_GETCONTROLDETAILSF_LISTTEXT* = 1
  MIXER_GETCONTROLDETAILSF_QUERYMASK* = 0x0000000F
  MIXER_SETCONTROLDETAILSF_VALUE* = 0
  MIXER_SETCONTROLDETAILSF_CUSTOM* = 1
  MIXER_SETCONTROLDETAILSF_QUERYMASK* = 0x0000000F
  JOYERR_NOERROR* = (0)
  JOYERR_PARMS* = (JOYERR_BASE + 5)
  JOYERR_NOCANDO* = (JOYERR_BASE + 6)
  JOYERR_UNPLUGGED* = (JOYERR_BASE + 7)
  JOY_BUTTON1* = 1
  JOY_BUTTON2* = 2
  JOY_BUTTON3* = 4
  JOY_BUTTON4* = 8
  JOY_BUTTON1CHG* = 256
  JOY_BUTTON2CHG* = 512
  JOY_BUTTON3CHG* = 0x00000400
  JOY_BUTTON4CHG* = 0x00000800
  JOY_BUTTON5* = 16
  JOY_BUTTON6* = 32
  JOY_BUTTON7* = 64
  JOY_BUTTON8* = 128
  JOY_BUTTON9* = 256
  JOY_BUTTON10* = 512
  JOY_BUTTON11* = 0x00000400
  JOY_BUTTON12* = 0x00000800
  JOY_BUTTON13* = 0x00001000
  JOY_BUTTON14* = 0x00002000
  JOY_BUTTON15* = 0x00004000
  JOY_BUTTON16* = 0x00008000
  JOY_BUTTON17* = 0x00010000
  JOY_BUTTON18* = 0x00020000
  JOY_BUTTON19* = 0x00040000
  JOY_BUTTON20* = 0x00080000
  JOY_BUTTON21* = 0x00100000
  JOY_BUTTON22* = 0x00200000
  JOY_BUTTON23* = 0x00400000
  JOY_BUTTON24* = 0x00800000
  JOY_BUTTON25* = 0x01000000
  JOY_BUTTON26* = 0x02000000
  JOY_BUTTON27* = 0x04000000
  JOY_BUTTON28* = 0x08000000
  JOY_BUTTON29* = 0x10000000
  JOY_BUTTON30* = 0x20000000
  JOY_BUTTON31* = 0x40000000
  JOY_BUTTON32* = 0x80000000
  JOY_POVCENTERED* = - 1
  JOY_POVFORWARD* = 0
  JOY_POVRIGHT* = 9000
  JOY_POVBACKWARD* = 18000
  JOY_POVLEFT* = 27000
  JOY_RETURNX* = 1
  JOY_RETURNY* = 2
  JOY_RETURNZ* = 4
  JOY_RETURNR* = 8
  JOY_RETURNU* = 16
  JOY_RETURNV* = 32
  JOY_RETURNPOV* = 64
  JOY_RETURNBUTTONS* = 128
  JOY_RETURNRAWDATA* = 256
  JOY_RETURNPOVCTS* = 512
  JOY_RETURNCENTERED* = 0x00000400
  JOY_USEDEADZONE* = 0x00000800
  JOY_RETURNALL* = (JOY_RETURNX Or JOY_RETURNY Or JOY_RETURNZ Or JOY_RETURNR Or
      JOY_RETURNU Or JOY_RETURNV Or JOY_RETURNPOV Or JOY_RETURNBUTTONS)
  JOY_CAL_READALWAYS* = 0x00010000
  JOY_CAL_READXYONLY* = 0x00020000
  JOY_CAL_READ3* = 0x00040000
  JOY_CAL_READ4* = 0x00080000
  JOY_CAL_READXONLY* = 0x00100000
  JOY_CAL_READYONLY* = 0x00200000
  JOY_CAL_READ5* = 0x00400000
  JOY_CAL_READ6* = 0x00800000
  JOY_CAL_READZONLY* = 0x01000000
  JOY_CAL_READRONLY* = 0x02000000
  JOY_CAL_READUONLY* = 0x04000000
  JOY_CAL_READVONLY* = 0x08000000
  JOYSTICKID1* = 0
  JOYSTICKID2* = 1
  JOYCAPS_HASZ* = 1
  JOYCAPS_HASR* = 2
  JOYCAPS_HASU* = 4
  JOYCAPS_HASV* = 8
  JOYCAPS_HASPOV* = 16
  JOYCAPS_POV4DIR* = 32
  JOYCAPS_POVCTS* = 64
  MMIOERR_BASE* = 256
  MMIOERR_FILENOTFOUND* = (MMIOERR_BASE + 1)
  MMIOERR_OUTOFMEMORY* = (MMIOERR_BASE + 2)
  MMIOERR_CANNOTOPEN* = (MMIOERR_BASE + 3)
  MMIOERR_CANNOTCLOSE* = (MMIOERR_BASE + 4)
  MMIOERR_CANNOTREAD* = (MMIOERR_BASE + 5)
  MMIOERR_CANNOTWRITE* = (MMIOERR_BASE + 6)
  MMIOERR_CANNOTSEEK* = (MMIOERR_BASE + 7)
  MMIOERR_CANNOTEXPAND* = (MMIOERR_BASE + 8)
  MMIOERR_CHUNKNOTFOUND* = (MMIOERR_BASE + 9)
  MMIOERR_UNBUFFERED* = (MMIOERR_BASE + 10)
  MMIOERR_PATHNOTFOUND* = (MMIOERR_BASE + 11)
  MMIOERR_ACCESSDENIED* = (MMIOERR_BASE + 12)
  MMIOERR_SHARINGVIOLATION* = (MMIOERR_BASE + 13)
  MMIOERR_NETWORKERROR* = (MMIOERR_BASE + 14)
  MMIOERR_TOOMANYOPENFILES* = (MMIOERR_BASE + 15)
  MMIOERR_INVALIDFILE* = (MMIOERR_BASE + 16)
  CFSEPCHAR* = '+'
  WAVECAPS_PITCH* = 1
  WAVECAPS_PLAYBACKRATE* = 2
  WAVECAPS_VOLUME* = 4
  WAVECAPS_LRVOLUME* = 8
  WAVECAPS_SYNC* = 16
  WAVECAPS_SAMPLEACCURATE* = 32
  WAVECAPS_DIRECTSOUND* = 64
  MIXER_GETLINEINFOF_DESTINATION* = 0
  MIXER_GETLINEINFOF_SOURCE* = 1
  MIXER_GETLINEINFOF_LINEID* = 2
  MIXER_GETLINEINFOF_COMPONENTTYPE* = 3
  MIXER_GETLINEINFOF_TARGETTYPE* = 4
  MIXER_GETLINEINFOF_QUERYMASK* = 0x0000000F
  MMIO_RWMODE* = 3
  MMIO_SHAREMODE* = 0x00000070
  MMIO_CREATE* = 0x00001000
  MMIO_PARSE* = 256
  MMIO_DELETE* = 512
  MMIO_EXIST* = 0x00004000
  MMIO_ALLOCBUF* = 0x00010000
  MMIO_GETTEMP* = 0x00020000
  MMIO_DIRTY* = 0x10000000
  cMMIO_READ* = 0
  cMMIO_WRITE* = 1
  MMIO_READWRITE* = 2
  MMIO_COMPAT* = 0
  MMIO_EXCLUSIVE* = 16
  MMIO_DENYWRITE* = 32
  MMIO_DENYREAD* = 0x00000030
  MMIO_DENYNONE* = 64
  MMIO_FHOPEN* = 16
  MMIO_EMPTYBUF* = 16
  MMIO_TOUPPER* = 16
  MMIO_INSTALLPROC* = 0x00010000
  MMIO_GLOBALPROC* = 0x10000000
  MMIO_REMOVEPROC* = 0x00020000
  MMIO_UNICODEPROC* = 0x01000000
  MMIO_FINDPROC* = 0x00040000
  MMIO_FINDCHUNK* = 16
  MMIO_FINDRIFF* = 32
  MMIO_FINDLIST* = 64
  MMIO_CREATERIFF* = 32
  MMIO_CREATELIST* = 64
  MMIOM_READ* = cMMIO_READ
  MMIOM_WRITE* = cMMIO_WRITE
  MMIOM_SEEK* = 2
  MMIOM_OPEN* = 3
  MMIOM_CLOSE* = 4
  MMIOM_WRITEFLUSH* = 5
  MMIOM_RENAME* = 6
  MMIOM_USER* = 0x00008000
  FOURCC_RIFF* = 0x46464952   #'R','I','F','F'
  FOURCC_LIST* = 0x5453494C   #'L','I','S','T'
  FOURCC_DOS* = 0x20532F44    #'D','O','S',' '
  FOURCC_MEM* = 0x204D454D    #'M','E','M',' '
  SEEK_SET* = 0
  SEEK_CUR* = 1
  SEEK_END* = 2
  MMIO_DEFAULTBUFFER* = 8192
  MCIERR_INVALID_DEVICE_ID* = (MCIERR_BASE + 1)
  MCIERR_UNRECOGNIZED_KEYWORD* = (MCIERR_BASE + 3)
  MCIERR_UNRECOGNIZED_COMMAND* = (MCIERR_BASE + 5)
  MCIERR_HARDWARE* = (MCIERR_BASE + 6)
  MCIERR_INVALID_DEVICE_NAME* = (MCIERR_BASE + 7)
  MCIERR_OUT_OF_MEMORY* = (MCIERR_BASE + 8)
  MCIERR_DEVICE_OPEN* = (MCIERR_BASE + 9)
  MCIERR_CANNOT_LOAD_DRIVER* = (MCIERR_BASE + 10)
  MCIERR_MISSING_COMMAND_STRING* = (MCIERR_BASE + 11)
  MCIERR_PARAM_OVERFLOW* = (MCIERR_BASE + 12)
  MCIERR_MISSING_STRING_ARGUMENT* = (MCIERR_BASE + 13)
  MCIERR_BAD_INTEGER* = (MCIERR_BASE + 14)
  MCIERR_PARSER_INTERNAL* = (MCIERR_BASE + 15)
  MCIERR_DRIVER_INTERNAL* = (MCIERR_BASE + 16)
  MCIERR_MISSING_PARAMETER* = (MCIERR_BASE + 17)
  MCIERR_UNSUPPORTED_FUNCTION* = (MCIERR_BASE + 18)
  MCIERR_FILE_NOT_FOUND* = (MCIERR_BASE + 19)
  MCIERR_DEVICE_NOT_READY* = (MCIERR_BASE + 20)
  MCIERR_INTERNAL* = (MCIERR_BASE + 21)
  MCIERR_DRIVER* = (MCIERR_BASE + 22)
  MCIERR_CANNOT_USE_ALL* = (MCIERR_BASE + 23)
  MCIERR_MULTIPLE* = (MCIERR_BASE + 24)
  MCIERR_EXTENSION_NOT_FOUND* = (MCIERR_BASE + 25)
  MCIERR_OUTOFRANGE* = (MCIERR_BASE + 26)
  MCIERR_FLAGS_NOT_COMPATIBLE* = (MCIERR_BASE + 28)
  MCIERR_FILE_NOT_SAVED* = (MCIERR_BASE + 30)
  MCIERR_DEVICE_TYPE_REQUIRED* = (MCIERR_BASE + 31)
  MCIERR_DEVICE_LOCKED* = (MCIERR_BASE + 32)
  MCIERR_DUPLICATE_ALIAS* = (MCIERR_BASE + 33)
  MCIERR_BAD_CONSTANT* = (MCIERR_BASE + 34)
  MCIERR_MUST_USE_SHAREABLE* = (MCIERR_BASE + 35)
  MCIERR_MISSING_DEVICE_NAME* = (MCIERR_BASE + 36)
  MCIERR_BAD_TIME_FORMAT* = (MCIERR_BASE + 37)
  MCIERR_NO_CLOSING_QUOTE* = (MCIERR_BASE + 38)
  MCIERR_DUPLICATE_FLAGS* = (MCIERR_BASE + 39)
  MCIERR_INVALID_FILE* = (MCIERR_BASE + 40)
  MCIERR_NULL_PARAMETER_BLOCK* = (MCIERR_BASE + 41)
  MCIERR_UNNAMED_RESOURCE* = (MCIERR_BASE + 42)
  MCIERR_NEW_REQUIRES_ALIAS* = (MCIERR_BASE + 43)
  MCIERR_NOTIFY_ON_AUTO_OPEN* = (MCIERR_BASE + 44)
  MCIERR_NO_ELEMENT_ALLOWED* = (MCIERR_BASE + 45)
  MCIERR_NONAPPLICABLE_FUNCTION* = (MCIERR_BASE + 46)
  MCIERR_ILLEGAL_FOR_AUTO_OPEN* = (MCIERR_BASE + 47)
  MCIERR_FILENAME_REQUIRED* = (MCIERR_BASE + 48)
  MCIERR_EXTRA_CHARACTERS* = (MCIERR_BASE + 49)
  MCIERR_DEVICE_NOT_INSTALLED* = (MCIERR_BASE + 50)
  MCIERR_GET_CD* = (MCIERR_BASE + 51)
  MCIERR_SET_CD* = (MCIERR_BASE + 52)
  MCIERR_SET_DRIVE* = (MCIERR_BASE + 53)
  MCIERR_DEVICE_LENGTH* = (MCIERR_BASE + 54)
  MCIERR_DEVICE_ORD_LENGTH* = (MCIERR_BASE + 55)
  MCIERR_NO_INTEGER* = (MCIERR_BASE + 56)
  MCIERR_WAVE_OUTPUTSINUSE* = (MCIERR_BASE + 64)
  MCIERR_WAVE_SETOUTPUTINUSE* = (MCIERR_BASE + 65)
  MCIERR_WAVE_INPUTSINUSE* = (MCIERR_BASE + 66)
  MCIERR_WAVE_SETINPUTINUSE* = (MCIERR_BASE + 67)
  MCIERR_WAVE_OUTPUTUNSPECIFIED* = (MCIERR_BASE + 68)
  MCIERR_WAVE_INPUTUNSPECIFIED* = (MCIERR_BASE + 69)
  MCIERR_WAVE_OUTPUTSUNSUITABLE* = (MCIERR_BASE + 70)
  MCIERR_WAVE_SETOUTPUTUNSUITABLE* = (MCIERR_BASE + 71)
  MCIERR_WAVE_INPUTSUNSUITABLE* = (MCIERR_BASE + 72)
  MCIERR_WAVE_SETINPUTUNSUITABLE* = (MCIERR_BASE + 73)
  MCIERR_SEQ_DIV_INCOMPATIBLE* = (MCIERR_BASE + 80)
  MCIERR_SEQ_PORT_INUSE* = (MCIERR_BASE + 81)
  MCIERR_SEQ_PORT_NONEXISTENT* = (MCIERR_BASE + 82)
  MCIERR_SEQ_PORT_MAPNODEVICE* = (MCIERR_BASE + 83)
  MCIERR_SEQ_PORT_MISCERROR* = (MCIERR_BASE + 84)
  MCIERR_SEQ_TIMER* = (MCIERR_BASE + 85)
  MCIERR_SEQ_PORTUNSPECIFIED* = (MCIERR_BASE + 86)
  MCIERR_SEQ_NOMIDIPRESENT* = (MCIERR_BASE + 87)
  MCIERR_NO_WINDOW* = (MCIERR_BASE + 90)
  MCIERR_CREATEWINDOW* = (MCIERR_BASE + 91)
  MCIERR_FILE_READ* = (MCIERR_BASE + 92)
  MCIERR_FILE_WRITE* = (MCIERR_BASE + 93)
  MCIERR_NO_IDENTITY* = (MCIERR_BASE + 94)
  MCIERR_CUSTOM_DRIVER_BASE* = (MCIERR_BASE + 256)
  MCI_FIRST* = DRV_MCI_FIRST
  MCI_ESCAPE* = 0x00000805
  MCI_PLAY* = 0x00000806
  MCI_SEEK* = 0x00000807
  MCI_STOP* = 0x00000808
  MCI_PAUSE* = 0x00000809
  MCI_INFO* = 0x0000080A
  MCI_GETDEVCAPS* = 0x0000080B
  MCI_BREAK* = 0x00000811
  MCI_WHERE* = 0x00000843
  MCI_FREEZE* = 0x00000844
  MCI_UNFREEZE* = 0x00000845
  MCI_LOAD* = 0x00000850
  MCI_CUT* = 0x00000851
  MCI_COPY* = 0x00000852
  MCI_PASTE* = 0x00000853
  MCI_UPDATE* = 0x00000854
  MCI_RESUME* = 0x00000855
  MCI_DELETE* = 0x00000856
  MCI_SET* = 0x0000080D
  MCI_STEP* = 0x0000080E
  MCI_SAVE* = 0x00000813
  MCI_SPIN* = 0x0000080C
  MCI_STATUS* = 0x00000814
  MCI_CUE* = 0x00000830
  MCI_REALIZE* = 0x00000840
  MCI_WINDOW* = 0x00000841
  MCI_PUT* = 0x00000842
  MCI_RECORD* = 0x0000080F
  MCI_SYSINFO* = 0x00000810
  MCI_OPEN* = 0x00000803
  MCI_CLOSE* = 0x00000804
  MCI_USER_MESSAGES* = (DRV_MCI_FIRST + 0x00000400)
  MCI_LAST* = 0x00000FFF
  MCI_ALL_DEVICE_ID* = - 1
  MCI_DEVTYPE_VCR* = 513
  MCI_DEVTYPE_VIDEODISC* = 514
  MCI_DEVTYPE_OVERLAY* = 515
  MCI_DEVTYPE_CD_AUDIO* = 516
  MCI_DEVTYPE_DAT* = 517
  MCI_DEVTYPE_SCANNER* = 518
  MCI_DEVTYPE_ANIMATION* = 519
  MCI_DEVTYPE_DIGITAL_VIDEO* = 520
  MCI_DEVTYPE_OTHER* = 521
  MCI_DEVTYPE_WAVEFORM_AUDIO* = 522
  MCI_DEVTYPE_SEQUENCER* = 523
  MCI_DEVTYPE_FIRST* = MCI_DEVTYPE_VCR
  MCI_DEVTYPE_LAST* = MCI_DEVTYPE_SEQUENCER
  MCI_DEVTYPE_FIRST_USER* = 0x00001000
  MCI_MODE_NOT_READY* = (MCI_STRING_OFFSET + 12)
  MCI_MODE_STOP* = (MCI_STRING_OFFSET + 13)
  MCI_MODE_PLAY* = (MCI_STRING_OFFSET + 14)
  MCI_MODE_RECORD* = (MCI_STRING_OFFSET + 15)
  MCI_MODE_SEEK* = (MCI_STRING_OFFSET + 16)
  MCI_MODE_PAUSE* = (MCI_STRING_OFFSET + 17)
  MCI_MODE_OPEN* = (MCI_STRING_OFFSET + 18)
  MCI_FORMAT_MILLISECONDS* = 0
  MCI_FORMAT_HMS* = 1
  MCI_FORMAT_MSF* = 2
  MCI_FORMAT_FRAMES* = 3
  MCI_FORMAT_SMPTE_24* = 4
  MCI_FORMAT_SMPTE_25* = 5
  MCI_FORMAT_SMPTE_30* = 6
  MCI_FORMAT_SMPTE_30DROP* = 7
  MCI_FORMAT_BYTES* = 8
  MCI_FORMAT_SAMPLES* = 9
  MCI_FORMAT_TMSF* = 10

proc MCI_MSF_MINUTE*(msf: int32): int8
proc MCI_MSF_SECOND*(msf: int32): int8
proc MCI_MSF_FRAME*(msf: int32): int8
proc MCI_MAKE_MSF*(m, s, f: int8): int32
const
  MCI_SET_DOOR_OPEN* = 256
  MCI_SET_DOOR_CLOSED* = 512
  MCI_SET_TIME_FORMAT* = 0x00000400
  MCI_SET_AUDIO* = 0x00000800
  MCI_SET_VIDEO* = 0x00001000
  MCI_SET_ON* = 0x00002000
  MCI_SET_OFF* = 0x00004000
  MCI_SET_AUDIO_ALL* = 0
  MCI_SET_AUDIO_LEFT* = 1
  MCI_SET_AUDIO_RIGHT* = 2

proc MCI_TMSF_TRACK*(tmsf: int32): int8
proc MCI_TMSF_MINUTE*(tmsf: int32): int8
proc MCI_TMSF_SECOND*(tmsf: int32): int8
proc MCI_TMSF_FRAME*(tmsf: int32): int8
proc MCI_HMS_HOUR*(h: int32): int8
proc MCI_HMS_MINUTE*(h: int32): int8
proc MCI_HMS_SECOND*(h: int32): int8
proc MCI_MAKE_HMS*(h, m, s: int8): int32
const
  MCI_INFO_PRODUCT* = 256
  MCI_INFO_FILE* = 512
  MCI_INFO_MEDIA_UPC* = 0x00000400
  MCI_INFO_MEDIA_IDENTITY* = 0x00000800
  MCI_INFO_NAME* = 0x00001000
  MCI_INFO_COPYRIGHT* = 0x00002000

proc MCI_MAKE_TMSF*(t, m, s, f: int8): int32
const
  MCI_WAIT* = 2
  MCI_FROM* = 4
  MCI_TO* = 8
  MCI_TRACK* = 16
  MCI_SEEK_TO_START* = 256
  MCI_SEEK_TO_END* = 512
  MCI_STATUS_ITEM* = 256
  MCI_STATUS_START* = 512
  MCI_STATUS_LENGTH* = 1
  MCI_STATUS_POSITION* = 2
  MCI_STATUS_NUMBER_OF_TRACKS* = 3
  MCI_STATUS_MODE* = 4
  MCI_STATUS_MEDIA_PRESENT* = 5
  MCI_STATUS_TIME_FORMAT* = 6
  MCI_STATUS_READY* = 7
  MCI_STATUS_CURRENT_TRACK* = 8
  MCI_OPEN_SHAREABLE* = 256
  MCI_OPEN_ELEMENT* = 512
  MCI_OPEN_ALIAS* = 0x00000400
  MCI_OPEN_ELEMENT_ID* = 0x00000800
  MCI_OPEN_TYPE_ID* = 0x00001000
  MCI_OPEN_TYPE* = 0x00002000
  MCI_GETDEVCAPS_ITEM* = 256
  MCI_GETDEVCAPS_CAN_RECORD* = 1
  MCI_GETDEVCAPS_HAS_AUDIO* = 2
  MCI_GETDEVCAPS_HAS_VIDEO* = 3
  MCI_GETDEVCAPS_DEVICE_TYPE* = 4
  MCI_GETDEVCAPS_USES_FILES* = 5
  MCI_GETDEVCAPS_COMPOUND_DEVICE* = 6
  MCI_GETDEVCAPS_CAN_EJECT* = 7
  MCI_GETDEVCAPS_CAN_PLAY* = 8
  MCI_GETDEVCAPS_CAN_SAVE* = 9
  MCI_SYSINFO_QUANTITY* = 256
  MCI_SYSINFO_OPEN* = 512
  MCI_SYSINFO_NAME* = 0x00000400
  MCI_SYSINFO_INSTALLNAME* = 0x00000800
  MCI_NOTIFY_SUCCESSFUL* = 1
  MCI_NOTIFY_SUPERSEDED* = 2
  MCI_NOTIFY_ABORTED* = 4
  MCI_NOTIFY_FAILURE* = 8
  MCI_NOTIFY* = 1
  MCI_BREAK_KEY* = 256
  MCI_BREAK_HWND* = 512
  MCI_BREAK_OFF* = 0x00000400
  MCI_RECORD_INSERT* = 256
  MCI_RECORD_OVERWRITE* = 512
  MCI_SAVE_FILE* = 256
  MCI_LOAD_FILE* = 256
  MCI_VD_GETDEVCAPS_FAST_RATE* = 0x00004003
  MCI_VD_GETDEVCAPS_SLOW_RATE* = 0x00004004
  MCI_VD_GETDEVCAPS_NORMAL_RATE* = 0x00004005
  MCI_VD_STEP_FRAMES* = 0x00010000
  MCI_VD_STEP_REVERSE* = 0x00020000
  MCI_VD_ESCAPE_STRING* = 256
  MCI_VD_FORMAT_TRACK* = 0x00004001
  MCI_VD_PLAY_REVERSE* = 0x00010000
  MCI_VD_PLAY_FAST* = 0x00020000
  MCI_VD_MODE_PARK* = (MCI_VD_OFFSET + 1)
  MCI_VD_GETDEVCAPS_CAV* = 0x00020000
  MCI_VD_SPIN_UP* = 0x00010000
  MCI_VD_SPIN_DOWN* = 0x00020000
  MCI_VD_SEEK_REVERSE* = 0x00010000
  MCI_VD_STATUS_SPEED* = 0x00004002
  MCI_VD_STATUS_FORWARD* = 0x00004003
  MCI_VD_STATUS_MEDIA_TYPE* = 0x00004004
  MCI_VD_STATUS_SIDE* = 0x00004005
  MCI_VD_GETDEVCAPS_CAN_REVERSE* = 0x00004002
  MCI_VD_MEDIA_CLV* = (MCI_VD_OFFSET + 2)
  MCI_VD_MEDIA_CAV* = (MCI_VD_OFFSET + 3)
  MCI_VD_MEDIA_OTHER* = (MCI_VD_OFFSET + 4)
  MCI_VD_STATUS_DISC_SIZE* = 0x00004006
  MCI_VD_GETDEVCAPS_CLV* = 0x00010000
  MCI_VD_PLAY_SPEED* = 0x00040000
  MCI_VD_PLAY_SCAN* = 0x00080000
  MCI_VD_PLAY_SLOW* = 0x00100000
  MCI_WAVE_STATUS_CHANNELS* = 0x00004002
  MCI_WAVE_STATUS_SAMPLESPERSEC* = 0x00004003
  MCI_WAVE_PCM* = MCI_WAVE_OFFSET
  MCI_WAVE_MAPPER* = (MCI_WAVE_OFFSET + 1)
  MCI_WAVE_OPEN_BUFFER* = 0x00010000
  MCI_WAVE_STATUS_BITSPERSAMPLE* = 0x00004006
  MCI_WAVE_STATUS_LEVEL* = 0x00004007
  MCI_WAVE_SET_FORMATTAG* = 0x00010000
  MCI_WAVE_SET_CHANNELS* = 0x00020000
  MCI_WAVE_SET_SAMPLESPERSEC* = 0x00040000
  MCI_WAVE_SET_AVGBYTESPERSEC* = 0x00080000
  MCI_WAVE_SET_BLOCKALIGN* = 0x00100000
  MCI_WAVE_SET_BITSPERSAMPLE* = 0x00200000
  MCI_WAVE_INPUT* = 0x00400000
  MCI_WAVE_OUTPUT* = 0x00800000
  MCI_WAVE_STATUS_FORMATTAG* = 0x00004001
  MCI_WAVE_SET_ANYINPUT* = 0x04000000
  MCI_WAVE_SET_ANYOUTPUT* = 0x08000000
  MCI_WAVE_GETDEVCAPS_INPUTS* = 0x00004001
  MCI_WAVE_GETDEVCAPS_OUTPUTS* = 0x00004002
  MCI_WAVE_STATUS_AVGBYTESPERSEC* = 0x00004004
  MCI_WAVE_STATUS_BLOCKALIGN* = 0x00004005
  MCI_CDA_STATUS_TYPE_TRACK* = 0x00004001
  MCI_CDA_TRACK_AUDIO* = (MCI_CD_OFFSET)
  MCI_CDA_TRACK_OTHER* = (MCI_CD_OFFSET + 1)
  MCI_SEQ_DIV_PPQN* = (MCI_SEQ_OFFSET)
  MCI_SEQ_DIV_SMPTE_24* = (MCI_SEQ_OFFSET + 1)
  MCI_SEQ_DIV_SMPTE_25* = (MCI_SEQ_OFFSET + 2)
  MCI_SEQ_DIV_SMPTE_30DROP* = (MCI_SEQ_OFFSET + 3)
  MCI_SEQ_DIV_SMPTE_30* = (MCI_SEQ_OFFSET + 4)
  MCI_SEQ_FORMAT_SONGPTR* = 0x00004001
  MCI_SEQ_FILE* = 0x00004002
  MCI_SEQ_MIDI* = 0x00004003
  MCI_SEQ_SMPTE* = 0x00004004
  MCI_SEQ_NONE* = 65533
  MCI_SEQ_MAPPER* = 65535
  MCI_SEQ_STATUS_TEMPO* = 0x00004002
  MCI_SEQ_STATUS_PORT* = 0x00004003
  MCI_SEQ_STATUS_SLAVE* = 0x00004007
  MCI_SEQ_STATUS_MASTER* = 0x00004008
  MCI_SEQ_STATUS_OFFSET* = 0x00004009
  MCI_SEQ_STATUS_DIVTYPE* = 0x0000400A
  MCI_SEQ_STATUS_NAME* = 0x0000400B
  MCI_SEQ_STATUS_COPYRIGHT* = 0x0000400C
  MCI_SEQ_SET_TEMPO* = 0x00010000
  MCI_SEQ_SET_PORT* = 0x00020000
  MCI_SEQ_SET_SLAVE* = 0x00040000
  MCI_SEQ_SET_MASTER* = 0x00080000
  MCI_SEQ_SET_OFFSET* = 0x01000000
  MCI_ANIM_PLAY_SLOW* = 0x00080000
  MCI_ANIM_PLAY_SCAN* = 0x00100000
  MCI_ANIM_GETDEVCAPS_SLOW_RATE* = 0x00004003
  MCI_ANIM_GETDEVCAPS_NORMAL_RATE* = 0x00004004
  MCI_ANIM_STEP_REVERSE* = 0x00010000
  MCI_ANIM_STEP_FRAMES* = 0x00020000
  MCI_ANIM_STATUS_SPEED* = 0x00004001
  MCI_ANIM_GETDEVCAPS_PALETTES* = 0x00004006
  MCI_ANIM_OPEN_WS* = 0x00010000
  MCI_ANIM_OPEN_PARENT* = 0x00020000
  MCI_ANIM_OPEN_NOSTATIC* = 0x00040000
  MCI_ANIM_GETDEVCAPS_FAST_RATE* = 0x00004002
  MCI_ANIM_PLAY_SPEED* = 0x00010000
  MCI_ANIM_PLAY_REVERSE* = 0x00020000
  MCI_ANIM_PLAY_FAST* = 0x00040000
  MCI_ANIM_STATUS_FORWARD* = 0x00004002
  MCI_ANIM_STATUS_HWND* = 0x00004003
  MCI_ANIM_STATUS_HPAL* = 0x00004004
  MCI_ANIM_STATUS_STRETCH* = 0x00004005
  MCI_ANIM_INFO_TEXT* = 0x00010000
  MCI_ANIM_GETDEVCAPS_CAN_REVERSE* = 0x00004001
  MCI_ANIM_WINDOW_TEXT* = 0x00080000
  MCI_ANIM_WINDOW_ENABLE_STRETCH* = 0x00100000
  MCI_ANIM_WINDOW_DISABLE_STRETCH* = 0x00200000
  MCI_ANIM_WINDOW_DEFAULT* = 0
  MCI_ANIM_RECT* = 0x00010000
  MCI_ANIM_PUT_SOURCE* = 0x00020000
  MCI_ANIM_PUT_DESTINATION* = 0x00040000
  MCI_ANIM_WHERE_SOURCE* = 0x00020000
  MCI_ANIM_WHERE_DESTINATION* = 0x00040000
  MCI_ANIM_UPDATE_HDC* = 0x00020000
  MCI_ANIM_GETDEVCAPS_CAN_STRETCH* = 0x00004007
  MCI_ANIM_GETDEVCAPS_MAX_WINDOWS* = 0x00004008
  MCI_ANIM_REALIZE_NORM* = 0x00010000
  MCI_ANIM_REALIZE_BKGD* = 0x00020000
  MCI_ANIM_WINDOW_HWND* = 0x00010000
  MCI_ANIM_WINDOW_STATE* = 0x00040000
  TIMERR_NOERROR* = 0
  TIMERR_NOCANDO* = (TIMERR_BASE + 1)
  TIMERR_STRUCT* = (TIMERR_BASE + 33)
  TIME_ONESHOT* = 0
  TIME_PERIODIC* = 1
  TIME_CALLBACK_FUNCTION* = 0
  TIME_CALLBACK_EVENT_SET* = 16
  TIME_CALLBACK_EVENT_PULSE* = 32
  MCI_OVLY_OPEN_WS* = 0x00010000
  MCI_OVLY_OPEN_PARENT* = 0x00020000
  MCI_OVLY_STATUS_HWND* = 0x00004001
  MCI_OVLY_STATUS_STRETCH* = 0x00004002
  MCI_OVLY_INFO_TEXT* = 0x00010000
  MCI_OVLY_GETDEVCAPS_CAN_STRETCH* = 0x00004001
  MCI_OVLY_GETDEVCAPS_CAN_FREEZE* = 0x00004002
  MCI_OVLY_GETDEVCAPS_MAX_WINDOWS* = 0x00004003
  MCI_OVLY_WINDOW_HWND* = 0x00010000
  MCI_OVLY_WINDOW_STATE* = 0x00040000
  MCI_OVLY_WINDOW_TEXT* = 0x00080000
  MCI_OVLY_WINDOW_ENABLE_STRETCH* = 0x00100000
  MCI_OVLY_WINDOW_DISABLE_STRETCH* = 0x00200000
  MCI_OVLY_WINDOW_DEFAULT* = 0
  MCI_OVLY_RECT* = 0x00010000
  MCI_OVLY_PUT_SOURCE* = 0x00020000
  MCI_OVLY_PUT_DESTINATION* = 0x00040000
  MCI_OVLY_PUT_FRAME* = 0x00080000
  MCI_OVLY_PUT_VIDEO* = 0x00100000
  MCI_OVLY_WHERE_SOURCE* = 0x00020000
  MCI_OVLY_WHERE_DESTINATION* = 0x00040000
  MCI_OVLY_WHERE_FRAME* = 0x00080000
  MCI_OVLY_WHERE_VIDEO* = 0x00100000
  AUX_MAPPER* = - 1
  MIXER_GETLINECONTROLSF_ONEBYID* = 1
  MIXER_GETLINECONTROLSF_ONEBYTYPE* = 2
  MIXER_GETLINECONTROLSF_ALL* = 0
  MIXER_GETLINECONTROLSF_QUERYMASK* = 0x0000000F
  NEWTRANSPARENT* = 3
  QUERYROPSUPPORT* = 40
  SELECTDIB* = 41

proc DIBINDEX*(n: int32): int32
const
  SC_SCREENSAVE* = 0x0000F140
  AUXCAPS_CDAUDIO* = 1
  AUXCAPS_AUXIN* = 2
  AUXCAPS_VOLUME* = 1
  AUXCAPS_LRVOLUME* = 2 #/////////////////////////////////////////////////////////
                        # Structures and typedefs
                        #/////////////////////////////////////////////////////////

type
  mmtime* = record
    wType*: UINT
    hour*, min*, sec*, frame*, fps*, dummy*: int8
    pad*: array[0..1, int8]

  PMMTIME* = ptr mmtime
  NPMMTIME* = ptr mmtime
  LPMMTIME* = ptr mmtime
  PWAVEHDR* = ptr wavehdr
  TMMTime* = mmtime
  wavehdr* = record
    lpData*: cstring
    dwBufferLength*: DWORD
    dwBytesRecorded*: DWORD
    dwUser*: DWORD
    dwFlags*: DWORD
    dwLoops*: DWORD
    lpNext*: PWAVEHDR
    reserved*: DWORD

  TWAVEHDR* = WAVEHDR
  NPWAVEHDR* = ptr wavehdr
  LPWAVEHDR* = ptr wavehdr
  WAVEOUTCAPSA* = record
    wMid*: int16
    wPid*: int16
    vDriverVersion*: MMVERSION
    szPname*: array[0..Pred(MAXPNAMELEN), CHAR]
    dwFormats*: DWORD
    wChannels*: int16
    wReserved1*: int16
    dwSupport*: DWORD

  TWAVEOUTCAPSA* = WAVEOUTCAPSA
  PWAVEOUTCAPSA* = ptr WAVEOUTCAPSA
  NPWAVEOUTCAPSA* = ptr WAVEOUTCAPSA
  LPWAVEOUTCAPSA* = ptr WAVEOUTCAPSA
  WAVEOUTCAPSW* = record
    wMid*: int16
    wPid*: int16
    vDriverVersion*: MMVERSION
    szPname*: array[0..Pred(MAXPNAMELEN), WCHAR]
    dwFormats*: DWORD
    wChannels*: int16
    wReserved1*: int16
    dwSupport*: DWORD

  PWAVEOUTCAPSW* = ptr WAVEOUTCAPSW
  NPWAVEOUTCAPSW* = ptr WAVEOUTCAPSW
  LPWAVEOUTCAPSW* = ptr WAVEOUTCAPSW
  TWAVEOUTCAPSW* = WAVEOUTCAPSW

when defined(UNICODE):
  type
    WAVEOUTCAPS* = WAVEOUTCAPSW
    PWAVEOUTCAPS* = PWAVEOUTCAPSW
    NPWAVEOUTCAPS* = NPWAVEOUTCAPSW
    LPWAVEOUTCAPS* = LPWAVEOUTCAPSW
else:
  type
    WAVEOUTCAPS* = WAVEOUTCAPSA
    PWAVEOUTCAPS* = PWAVEOUTCAPSA
    NPWAVEOUTCAPS* = NPWAVEOUTCAPSA
    LPWAVEOUTCAPS* = LPWAVEOUTCAPSA
type
  TWAVEOUTCAPS* = WAVEOUTCAPS
  WAVEINCAPSA* = record
    wMid*: int16
    wPid*: int16
    vDriverVersion*: MMVERSION
    szPname*: array[0..Pred(MAXPNAMELEN), CHAR]
    dwFormats*: DWORD
    wChannels*: int16
    wReserved1*: int16

  PWAVEINCAPSA* = ptr WAVEINCAPSA
  NPWAVEINCAPSA* = ptr WAVEINCAPSA
  LPWAVEINCAPSA* = ptr WAVEINCAPSA
  TWAVEINCAPSA* = WAVEINCAPSA
  WAVEINCAPSW* = record
    wMid*: int16
    wPid*: int16
    vDriverVersion*: MMVERSION
    szPname*: array[0..Pred(MAXPNAMELEN), WCHAR]
    dwFormats*: DWORD
    wChannels*: int16
    wReserved1*: int16

  PWAVEINCAPSW* = ptr WAVEINCAPSW
  NPWAVEINCAPSW* = ptr WAVEINCAPSW
  LPWAVEINCAPSW* = ptr WAVEINCAPSW
  TWAVEINCAPSW* = WAVEINCAPSW

when defined(UNICODE):
  type
    WAVEINCAPS* = WAVEINCAPSW
    PWAVEINCAPS* = PWAVEINCAPSW
    NPWAVEINCAPS* = NPWAVEINCAPSW
    LPWAVEINCAPS* = LPWAVEINCAPSW
else:
  type
    WAVEINCAPS* = WAVEINCAPSA
    PWAVEINCAPS* = PWAVEINCAPSA
    NPWAVEINCAPS* = NPWAVEINCAPSA
    LPWAVEINCAPS* = LPWAVEINCAPSA
type
  TWAVEINCAPS* = WAVEINCAPS
  waveformat* = record
    wFormatTag*: int16
    nChannels*: int16
    nSamplesPerSec*: DWORD
    nAvgBytesPerSec*: DWORD
    nBlockAlign*: int16

  PWAVEFORMAT* = ptr waveformat
  NPWAVEFORMAT* = ptr waveformat
  LPWAVEFORMAT* = ptr waveformat
  TWAVEFORMAT* = waveformat

const
  WAVE_FORMAT_PCM* = 1

type
  pcmwaveformat* = record
    wf*: WAVEFORMAT
    wBitsPerSample*: int16

  PPCMWAVEFORMAT* = ptr pcmwaveformat
  NPPCMWAVEFORMAT* = ptr pcmwaveformat
  LPPCMWAVEFORMAT* = ptr pcmwaveformat
  TPCMWAVEFORMAT* = PCMWAVEFORMAT
  WAVEFORMATEX* = record
    wFormatTag*: int16
    nChannels*: int16
    nSamplesPerSec*: DWORD
    nAvgBytesPerSec*: DWORD
    nBlockAlign*: int16
    wBitsPerSample*: int16
    cbSize*: int16

  PWAVEFORMATEX* = ptr WAVEFORMATEX
  NPWAVEFORMATEX* = ptr WAVEFORMATEX
  LPWAVEFORMATEX* = ptr WAVEFORMATEX
  LPCWAVEFORMATEX* = ptr WAVEFORMATEX
  TWAVEFORMATEX* = WAVEFORMATEX
  HMIDI* = THandle
  HMIDIIN* = THandle
  HMIDIOUT* = THandle
  HMIDISTRM* = THandle
  LPHMIDI* = ptr HMIDI
  LPHMIDIIN* = ptr HMIDIIN
  LPHMIDIOUT* = ptr HMIDIOUT
  LPHMIDISTRM* = ptr HMIDISTRM
  LPMIDICALLBACK* = PDRVCALLBACK

const
  MIDIPATCHSIZE* = 128

type
  PATCHARRAY* = array[0..Pred(MIDIPATCHSIZE), int16]
  LPPATCHARRAY* = ptr int16
  KEYARRAY* = array[0..Pred(MIDIPATCHSIZE), int16]
  LPKEYARRAY* = ptr int16
  MIDIOUTCAPSA* = record
    wMid*: int16
    wPid*: int16
    vDriverVersion*: MMVERSION
    szPname*: array[0..Pred(MAXPNAMELEN), CHAR]
    wTechnology*: int16
    wVoices*: int16
    wNotes*: int16
    wChannelMask*: int16
    dwSupport*: DWORD

  PMIDIOUTCAPSA* = ptr MIDIOUTCAPSA
  NPMIDIOUTCAPSA* = ptr MIDIOUTCAPSA
  LPMIDIOUTCAPSA* = ptr MIDIOUTCAPSA
  TMIDIOUTCAPSA* = MIDIOUTCAPSA
  MIDIOUTCAPSW* = record
    wMid*: int16
    wPid*: int16
    vDriverVersion*: MMVERSION
    szPname*: array[0..Pred(MAXPNAMELEN), WCHAR]
    wTechnology*: int16
    wVoices*: int16
    wNotes*: int16
    wChannelMask*: int16
    dwSupport*: DWORD

  PMIDIOUTCAPSW* = ptr MIDIOUTCAPSW
  NPMIDIOUTCAPSW* = ptr MIDIOUTCAPSW
  LPMIDIOUTCAPSW* = ptr MIDIOUTCAPSW
  TMIDIOUTCAPSW* = MIDIOUTCAPSW
  MIDIINCAPSA* = record
    wMid*: int16
    wPid*: int16
    vDriverVersion*: MMVERSION
    szPname*: array[0..Pred(MAXPNAMELEN), CHAR]
    dwSupport*: DWORD

  PMIDIINCAPSA* = ptr MIDIINCAPSA
  NPMIDIINCAPSA* = ptr MIDIINCAPSA
  LPMIDIINCAPSA* = ptr MIDIINCAPSA
  TMIDIINCAPSA* = MIDIINCAPSA
  MIDIINCAPSW* = record
    wMid*: int16
    wPid*: int16
    vDriverVersion*: MMVERSION
    szPname*: array[0..Pred(MAXPNAMELEN), WCHAR]
    dwSupport*: DWORD

  PMIDIINCAPSW* = ptr MIDIINCAPSW
  NPMIDIINCAPSW* = ptr MIDIINCAPSW
  LPMIDIINCAPSW* = ptr MIDIINCAPSW
  TMIDIINCAPSW* = MIDIINCAPSW

when defined(UNICODE):
  type
    MIDIINCAPS* = MIDIINCAPSW
    PMIDIINCAPS* = PMIDIINCAPSW
    NPMIDIINCAPS* = NPMIDIINCAPSW
    LPMIDIINCAPS* = LPMIDIINCAPSW
    MIDIOUTCAPS* = MIDIOUTCAPSW
    PMIDIOUTCAPS* = PMIDIOUTCAPSW
    NPMIDIOUTCAPS* = NPMIDIOUTCAPSW
    LPMIDIOUTCAPS* = LPMIDIOUTCAPSW
else:
  type
    MIDIOUTCAPS* = MIDIOUTCAPSA
    PMIDIOUTCAPS* = PMIDIOUTCAPSA
    NPMIDIOUTCAPS* = NPMIDIOUTCAPSA
    LPMIDIOUTCAPS* = LPMIDIOUTCAPSA
    MIDIINCAPS* = MIDIINCAPSA
    PMIDIINCAPS* = PMIDIINCAPSA
    NPMIDIINCAPS* = NPMIDIINCAPSA
    LPMIDIINCAPS* = LPMIDIINCAPSA
type
  TMIDIINCAPS* = MIDIINCAPS
  PMIDIHDR* = ptr midihdr
  midihdr* = record
    lpData*: cstring
    dwBufferLength*: DWORD
    dwBytesRecorded*: DWORD
    dwUser*: DWORD
    dwFlags*: DWORD
    lpNext*: PMIDIHDR
    reserved*: DWORD
    dwOffset*: DWORD
    dwReserved*: array[0..Pred(8), DWORD]

  NPMIDIHDR* = ptr midihdr
  LPMIDIHDR* = ptr midihdr
  TMIDIHDR* = MIDIHDR
  midievent* = record
    dwDeltaTime*: DWORD
    dwStreamID*: DWORD
    dwEvent*: DWORD
    dwParms*: array[0..Pred(1), DWORD]

  TMIDIEVENT* = MIDIEVENT
  midistrmbuffver* = record
    dwVersion*: DWORD
    dwMid*: DWORD
    dwOEMVersion*: DWORD

  TMIDISTRMBUFFVER* = MIDISTRMBUFFVER
  Tmidiproptimediv* = record
    cbStruct*: DWORD
    dwTimeDiv*: DWORD

  LPMIDIPROPTIMEDIV* = ptr Tmidiproptimediv
  Tmidiproptempo* = record
    cbStruct*: DWORD
    dwTempo*: DWORD

  LPMIDIPROPTEMPO* = ptr Tmidiproptempo
  AUXCAPSA* = record
    wMid*: int16
    wPid*: int16
    vDriverVersion*: MMVERSION
    szPname*: array[0..Pred(MAXPNAMELEN), CHAR]
    wTechnology*: int16
    wReserved1*: int16
    dwSupport*: DWORD

  PAUXCAPSA* = ptr AUXCAPSA
  NPAUXCAPSA* = ptr AUXCAPSA
  LPAUXCAPSA* = ptr AUXCAPSA
  TAUXCAPSA* = AUXCAPSA
  AUXCAPSW* = record
    wMid*: int16
    wPid*: int16
    vDriverVersion*: MMVERSION
    szPname*: array[0..Pred(MAXPNAMELEN), WCHAR]
    wTechnology*: int16
    wReserved1*: int16
    dwSupport*: DWORD

  PAUXCAPSW* = ptr AUXCAPSW
  NPAUXCAPSW* = ptr AUXCAPSW
  LPAUXCAPSW* = ptr AUXCAPSW
  TAUXCAPSW* = AUXCAPSW

when defined(UNICODE):
  type
    AUXCAPS* = AUXCAPSW
    PAUXCAPS* = PAUXCAPSW
    NPAUXCAPS* = NPAUXCAPSW
    LPAUXCAPS* = LPAUXCAPSW
else:
  type
    AUXCAPS* = AUXCAPSA
    PAUXCAPS* = PAUXCAPSA
    NPAUXCAPS* = NPAUXCAPSA
    LPAUXCAPS* = LPAUXCAPSA
type
  TAUXCAPS* = AUXCAPS
  HMIXEROBJ* = THandle
  LPHMIXEROBJ* = ptr HMIXEROBJ
  HMIXER* = THandle
  LPHMIXER* = ptr HMIXER

proc mixerGetNumDevs*(): UINT{.stdcall, dynlib: "winmm.dll",
                               importc: "mixerGetNumDevs".}
type
  MIXERCAPSA* = record
    wMid*: int16
    wPid*: int16
    vDriverVersion*: MMVERSION
    szPname*: array[0..Pred(MAXPNAMELEN), CHAR]
    fdwSupport*: DWORD
    cDestinations*: DWORD

  PMIXERCAPSA* = ptr MIXERCAPSA
  LPMIXERCAPSA* = ptr MIXERCAPSA
  TMIXERCAPSA* = MIXERCAPSA
  MIXERCAPSW* = record
    wMid*: int16
    wPid*: int16
    vDriverVersion*: MMVERSION
    szPname*: array[0..Pred(MAXPNAMELEN), WCHAR]
    fdwSupport*: DWORD
    cDestinations*: DWORD

  PMIXERCAPSW* = ptr MIXERCAPSW
  LPMIXERCAPSW* = ptr MIXERCAPSW
  TMIXERCAPSW* = MIXERCAPSW

when defined(UNICODE):
  type
    MIXERCAPS* = MIXERCAPSW
    PMIXERCAPS* = PMIXERCAPSW
    LPMIXERCAPS* = LPMIXERCAPSW
else:
  type
    MIXERCAPS* = MIXERCAPSA
    PMIXERCAPS* = PMIXERCAPSA
    LPMIXERCAPS* = LPMIXERCAPSA
type
  TMIXERCAPS* = MIXERCAPS
  MIXERLINEA* = record
    cbStruct*: DWORD
    dwDestination*: DWORD
    dwSource*: DWORD
    dwLineID*: DWORD
    fdwLine*: DWORD
    dwUser*: DWORD
    dwComponentType*: DWORD
    cChannels*: DWORD
    cConnections*: DWORD
    cControls*: DWORD
    szShortName*: array[0..Pred(MIXER_SHORT_NAME_CHARS), CHAR]
    szName*: array[0..Pred(MIXER_LONG_NAME_CHARS), CHAR]
    dwType*, dwDeviceID*: DWORD
    wMid*, wPid*: int16
    vDriverVersion*: MMVERSION
    szPname*: array[0..pred(MAXPNAMELEN), Char]

  PMIXERLINEA* = ptr MIXERLINEA
  LPMIXERLINEA* = ptr MIXERLINEA
  TMIXERLINEA* = MIXERLINEA
  MIXERLINEW* = record
    cbStruct*: DWORD
    dwDestination*: DWORD
    dwSource*: DWORD
    dwLineID*: DWORD
    fdwLine*: DWORD
    dwUser*: DWORD
    dwComponentType*: DWORD
    cChannels*: DWORD
    cConnections*: DWORD
    cControls*: DWORD
    szShortName*: array[0..Pred(MIXER_SHORT_NAME_CHARS), WCHAR]
    szName*: array[0..Pred(MIXER_LONG_NAME_CHARS), WCHAR]
    dwType*, dwDeviceID*: DWORD
    wMid*, wPid*: int16
    vDriverVersion*: MMVERSION
    szPname*: array[0..pred(MAXPNAMELEN), WChar]

  TMIXERLINEW* = MIXERLINEW
  PMIXERLINEW* = ptr MIXERLINEW
  LPMIXERLINEW* = ptr MIXERLINEW

when defined(UNICODE):
  type
    MIXERLINE* = MIXERLINEW
    PMIXERLINE* = PMIXERLINEW
    LPMIXERLINE* = LPMIXERLINEW
else:
  type
    MIXERLINE* = MIXERLINEA
    PMIXERLINE* = PMIXERLINEA
    LPMIXERLINE* = LPMIXERLINEA
type
  TMIXERLINE* = MIXERLINE
  MIXERCONTROLA* = record
    cbStruct*: DWORD
    dwControlID*: DWORD
    dwControlType*: DWORD
    fdwControl*: DWORD
    cMultipleItems*: DWORD
    szShortName*: array[0..Pred(MIXER_SHORT_NAME_CHARS), CHAR]
    szName*: array[0..Pred(MIXER_LONG_NAME_CHARS), CHAR]
    dwMinimum*, dwMaximum*: DWORD
    dwReserved*: array[0..3, DWORD]
    cSteps*: DWORD
    dwReserved2*: array[0..4, DWORD]

  PMIXERCONTROLA* = ptr MIXERCONTROLA
  LPMIXERCONTROLA* = ptr MIXERCONTROLA
  TMIXERCONTROLA* = MIXERCONTROLA
  MIXERCONTROLW* = record
    cbStruct*: DWORD
    dwControlID*: DWORD
    dwControlType*: DWORD
    fdwControl*: DWORD
    cMultipleItems*: DWORD
    szShortName*: array[0..Pred(MIXER_SHORT_NAME_CHARS), WCHAR]
    szName*: array[0..Pred(MIXER_LONG_NAME_CHARS), WCHAR]
    dwMinimum*, dwMaximum*: DWORD
    dwReserved*: array[0..3, DWORD]
    cSteps*: DWORD
    dwReserved2*: array[0..4, DWORD]

  PMIXERCONTROLW* = ptr MIXERCONTROLW
  LPMIXERCONTROLW* = ptr MIXERCONTROLW
  TMIXERCONTROLW* = MIXERCONTROLW

when defined(UNICODE):
  type
    MIXERCONTROL* = MIXERCONTROLW
    PMIXERCONTROL* = PMIXERCONTROLW
    LPMIXERCONTROL* = LPMIXERCONTROLW
else:
  type
    MIXERCONTROL* = MIXERCONTROLA
    PMIXERCONTROL* = PMIXERCONTROLA
    LPMIXERCONTROL* = LPMIXERCONTROLA
type
  TMIXERCONTROL* = MIXERCONTROL
  MIXERLINECONTROLSA* = record
    cbStruct*: DWORD
    dwLineID*: DWORD
    dwControlType*, cControls*, cbmxctrl*: DWORD
    pamxctrl*: PMIXERCONTROLA

  PMIXERLINECONTROLSA* = ptr MIXERLINECONTROLSA
  LPMIXERLINECONTROLSA* = ptr MIXERLINECONTROLSA
  TMIXERLINECONTROLSA* = MIXERLINECONTROLSA
  MIXERLINECONTROLSW* = record
    cbStruct*: DWORD
    dwLineID*: DWORD
    dwControlType*, cControls*, cbmxctrl*: DWORD
    pamxctrl*: PMIXERCONTROLW

  PMIXERLINECONTROLSW* = ptr MIXERLINECONTROLSW
  LPMIXERLINECONTROLSW* = ptr MIXERLINECONTROLSW
  TMIXERLINECONTROLSW* = MIXERLINECONTROLSW

when defined(UNICODE):
  type
    MIXERLINECONTROLS* = MIXERLINECONTROLSW
    PMIXERLINECONTROLS* = PMIXERLINECONTROLSW
    LPMIXERLINECONTROLS* = LPMIXERLINECONTROLSW
else:
  type
    MIXERLINECONTROLS* = MIXERLINECONTROLSA
    PMIXERLINECONTROLS* = PMIXERLINECONTROLSA
    LPMIXERLINECONTROLS* = LPMIXERLINECONTROLSA
type
  TMIXERLINECONTROLS* = MIXERLINECONTROLS
  TMIXERCONTROLDETAILS* = record
    cbStruct*: DWORD
    dwControlID*: DWORD
    cChannels*: DWORD
    cMultipleItems*, cbDetails*: DWORD
    paDetails*: Pointer

  MIXERCONTROLDETAILS* = tMIXERCONTROLDETAILS
  PMIXERCONTROLDETAILS* = ptr tMIXERCONTROLDETAILS
  LPMIXERCONTROLDETAILS* = ptr tMIXERCONTROLDETAILS
  MIXERCONTROLDETAILS_LISTTEXTA* = record
    dwParam1*: DWORD
    dwParam2*: DWORD
    szName*: array[0..Pred(MIXER_LONG_NAME_CHARS), CHAR]

  PMIXERCONTROLDETAILS_LISTTEXTA* = ptr MIXERCONTROLDETAILS_LISTTEXTA
  LPMIXERCONTROLDETAILS_LISTTEXTA* = ptr MIXERCONTROLDETAILS_LISTTEXTA
  TMIXERCONTROLDETAILS_LISTTEXTA* = MIXERCONTROLDETAILS_LISTTEXTA
  MIXERCONTROLDETAILS_LISTTEXTW* = record
    dwParam1*: DWORD
    dwParam2*: DWORD
    szName*: array[0..Pred(MIXER_LONG_NAME_CHARS), WCHAR]

  PMIXERCONTROLDETAILS_LISTTEXTW* = ptr MIXERCONTROLDETAILS_LISTTEXTW
  LPMIXERCONTROLDETAILS_LISTTEXTW* = ptr MIXERCONTROLDETAILS_LISTTEXTW
  TMIXERCONTROLDETAILS_LISTTEXTW* = MIXERCONTROLDETAILS_LISTTEXTW

when defined(UNICODE):
  type
    MIXERCONTROLDETAILS_LISTTEXT* = MIXERCONTROLDETAILS_LISTTEXTW
    PMIXERCONTROLDETAILS_LISTTEXT* = PMIXERCONTROLDETAILS_LISTTEXTW
    LPMIXERCONTROLDETAILS_LISTTEXT* = LPMIXERCONTROLDETAILS_LISTTEXTW
else:
  type
    MIXERCONTROLDETAILS_LISTTEXT* = MIXERCONTROLDETAILS_LISTTEXTA
    PMIXERCONTROLDETAILS_LISTTEXT* = PMIXERCONTROLDETAILS_LISTTEXTA
    LPMIXERCONTROLDETAILS_LISTTEXT* = LPMIXERCONTROLDETAILS_LISTTEXTA
type
  TMIXERCONTROLDETAILS_LISTTEXT* = MIXERCONTROLDETAILS_LISTTEXT
  MIXERCONTROLDETAILS_BOOLEAN* = record
    fValue*: int32

  PMIXERCONTROLDETAILS_BOOLEAN* = ptr MIXERCONTROLDETAILS_BOOLEAN
  LPMIXERCONTROLDETAILS_BOOLEAN* = ptr MIXERCONTROLDETAILS_BOOLEAN
  TMIXERCONTROLDETAILS_BOOLEAN* = MIXERCONTROLDETAILS_BOOLEAN
  MIXERCONTROLDETAILS_SIGNED* = record
    lValue*: int32

  PMIXERCONTROLDETAILS_SIGNED* = ptr MIXERCONTROLDETAILS_SIGNED
  LPMIXERCONTROLDETAILS_SIGNED* = ptr MIXERCONTROLDETAILS_SIGNED
  TMIXERCONTROLDETAILS_SIGNED* = MIXERCONTROLDETAILS_SIGNED
  MIXERCONTROLDETAILS_UNSIGNED* = record
    dwValue*: DWORD

  PMIXERCONTROLDETAILS_UNSIGNED* = ptr MIXERCONTROLDETAILS_UNSIGNED
  LPMIXERCONTROLDETAILS_UNSIGNED* = ptr MIXERCONTROLDETAILS_UNSIGNED
  TMIXERCONTROLDETAILS_UNSIGNED* = MIXERCONTROLDETAILS_UNSIGNED
  LPTIMECALLBACK* = proc (uTimerID, uMsg: UINT, dwUser, dw1, dw2: DWORD){.
      stdcall.}
  TTIMECALLBACK* = LPTIMECALLBACK
  timecaps* = record
    wPeriodMin*: UINT
    wPeriodMax*: UINT

  PTIMECAPS* = ptr timecaps
  NPTIMECAPS* = ptr timecaps
  LPTIMECAPS* = ptr timecaps
  TTIMECAS* = TIMECAPS
  JOYCAPSA* = record
    wMid*: int16
    wPid*: int16
    szPname*: array[0..Pred(MAXPNAMELEN), CHAR]
    wXmin*: UINT
    wXmax*: UINT
    wYmin*: UINT
    wYmax*: UINT
    wZmin*: UINT
    wZmax*: UINT
    wNumButtons*: UINT
    wPeriodMin*: UINT
    wPeriodMax*: UINT
    wRmin*: UINT
    wRmax*: UINT
    wUmin*: UINT
    wUmax*: UINT
    wVmin*: UINT
    wVmax*: UINT
    wCaps*: UINT
    wMaxAxes*: UINT
    wNumAxes*: UINT
    wMaxButtons*: UINT
    szRegKey*: array[0..Pred(MAXPNAMELEN), CHAR]
    szOEMVxD*: array[0..Pred(MAX_JOYSTICKOEMVXDNAME), CHAR]

  PJOYCAPSA* = ptr JOYCAPSA
  NPJOYCAPSA* = ptr JOYCAPSA
  LPJOYCAPSA* = ptr JOYCAPSA
  TJOYCAPSA* = JOYCAPSA
  JOYCAPSW* = record
    wMid*: int16
    wPid*: int16
    szPname*: array[0..Pred(MAXPNAMELEN), WCHAR]
    wXmin*: UINT
    wXmax*: UINT
    wYmin*: UINT
    wYmax*: UINT
    wZmin*: UINT
    wZmax*: UINT
    wNumButtons*: UINT
    wPeriodMin*: UINT
    wPeriodMax*: UINT
    wRmin*: UINT
    wRmax*: UINT
    wUmin*: UINT
    wUmax*: UINT
    wVmin*: UINT
    wVmax*: UINT
    wCaps*: UINT
    wMaxAxes*: UINT
    wNumAxes*: UINT
    wMaxButtons*: UINT
    szRegKey*: array[0..Pred(MAXPNAMELEN), WCHAR]
    szOEMVxD*: array[0..Pred(MAX_JOYSTICKOEMVXDNAME), WCHAR]

  PJOYCAPSW* = ptr JOYCAPSW
  NPJOYCAPSW* = ptr JOYCAPSW
  LPJOYCAPSW* = ptr JOYCAPSW
  TJOYCAPSW* = JOYCAPSW

when defined(UNICODE):
  type
    JOYCAPS* = JOYCAPSW
    PJOYCAPS* = PJOYCAPSW
    NPJOYCAPS* = NPJOYCAPSW
    LPJOYCAPS* = LPJOYCAPSW
else:
  type
    JOYCAPS* = JOYCAPSA
    PJOYCAPS* = PJOYCAPSA
    NPJOYCAPS* = NPJOYCAPSA
    LPJOYCAPS* = LPJOYCAPSA
type
  TJOYCAPS* = JOYCAPS
  joyinfo* = record
    wXpos*: UINT
    wYpos*: UINT
    wZpos*: UINT
    wButtons*: UINT

  PJOYINFO* = ptr joyinfo
  NPJOYINFO* = ptr joyinfo
  LPJOYINFO* = ptr joyinfo
  TJOYINFO* = JOYINFO
  joyinfoex* = record
    dwSize*: DWORD
    dwFlags*: DWORD
    wXpos*: UINT
    wYpos*: UINT
    wZpos*: UINT
    dwRpos*: DWORD
    dwUpos*: DWORD
    dwVpos*: DWORD
    wButtons*: UINT
    dwButtonNumber*: DWORD
    dwPOV*: DWORD
    dwReserved1*: DWORD
    dwReserved2*: DWORD

  PJOYINFOEX* = ptr joyinfoex
  NPJOYINFOEX* = ptr joyinfoex
  LPJOYINFOEX* = ptr joyinfoex
  TJOYINFOEX* = JOYINFOEX
  FOURCC* = DWORD
  HPSTR* = cstring
  HMMIO* = THandle
  LPMMIOPROC* = proc (x1: LPSTR, x2: UINT, x3, x4: LPARAM): LRESULT{.stdcall.}
  TMMIOPROC* = LPMMIOPROC
  MMIOINFO* = record
    dwFlags*: DWORD
    fccIOProc*: FOURCC
    pIOProc*: LPMMIOPROC
    wErrorRet*: UINT
    htask*: HTASK
    cchBuffer*: int32
    pchBuffer*: HPSTR
    pchNext*: HPSTR
    pchEndRead*: HPSTR
    pchEndWrite*: HPSTR
    lBufOffset*: int32
    lDiskOffset*: int32
    adwInfo*: array[0..Pred(3), DWORD]
    dwReserved1*: DWORD
    dwReserved2*: DWORD
    hmmio*: HMMIO

  PMMIOINFO* = ptr MMIOINFO
  NPMMIOINFO* = ptr MMIOINFO
  LPMMIOINFO* = ptr MMIOINFO
  LPCMMIOINFO* = ptr MMIOINFO
  TMMIOINFO* = MMIOINFO
  MMCKINFO* = record
    ckid*: FOURCC
    cksize*: DWORD
    fccType*: FOURCC
    dwDataOffset*: DWORD
    dwFlags*: DWORD

  PMMCKINFO* = ptr MMCKINFO
  NPMMCKINFO* = ptr MMCKINFO
  LPMMCKINFO* = ptr MMCKINFO
  LPCMMCKINFO* = ptr MMCKINFO
  TMMCKINFO* = MMCKINFO
  MCIERROR* = DWORD
  MCIDEVICEID* = UINT
  YIELDPROC* = proc (mciId: MCIDEVICEID, dwYieldData: DWORD): UINT{.stdcall.}
  TYIELDPROC* = YIELDPROC
  MCI_GENERIC_PARMS* = record
    dwCallback*: DWORD

  PMCI_GENERIC_PARMS* = ptr MCI_GENERIC_PARMS
  LPMCI_GENERIC_PARMS* = ptr MCI_GENERIC_PARMS
  TMCI_GENERIC_PARMS* = MCI_GENERIC_PARMS
  MCI_OPEN_PARMSA* = record
    dwCallback*: DWORD
    wDeviceID*: MCIDEVICEID
    lpstrDeviceType*: LPCSTR
    lpstrElementName*: LPCSTR
    lpstrAlias*: LPCSTR

  PMCI_OPEN_PARMSA* = ptr MCI_OPEN_PARMSA
  LPMCI_OPEN_PARMSA* = ptr MCI_OPEN_PARMSA
  TMCI_OPEN_PARMSA* = MCI_OPEN_PARMSA
  MCI_OPEN_PARMSW* = record
    dwCallback*: DWORD
    wDeviceID*: MCIDEVICEID
    lpstrDeviceType*: LPCWSTR
    lpstrElementName*: LPCWSTR
    lpstrAlias*: LPCWSTR

  PMCI_OPEN_PARMSW* = ptr MCI_OPEN_PARMSW
  LPMCI_OPEN_PARMSW* = ptr MCI_OPEN_PARMSW
  TMCI_OPEN_PARMSW* = MCI_OPEN_PARMSW

when defined(UNICODE):
  type
    MCI_OPEN_PARMS* = MCI_OPEN_PARMSW
    PMCI_OPEN_PARMS* = PMCI_OPEN_PARMSW
    LPMCI_OPEN_PARMS* = LPMCI_OPEN_PARMSW
else:
  type
    MCI_OPEN_PARMS* = MCI_OPEN_PARMSA
    PMCI_OPEN_PARMS* = PMCI_OPEN_PARMSA
    LPMCI_OPEN_PARMS* = LPMCI_OPEN_PARMSA
type
  TMCI_OPEN_PARMS* = MCI_OPEN_PARMS
  MCI_PLAY_PARMS* = record
    dwCallback*: DWORD
    dwFrom*: DWORD
    dwTo*: DWORD

  PMCI_PLAY_PARMS* = ptr MCI_PLAY_PARMS
  LPMCI_PLAY_PARMS* = ptr MCI_PLAY_PARMS
  TMCI_PLAY_PARMS* = MCI_PLAY_PARMS
  MCI_SEEK_PARMS* = record
    dwCallback*: DWORD
    dwTo*: DWORD

  PMCI_SEEK_PARMS* = ptr MCI_SEEK_PARMS
  LPMCI_SEEK_PARMS* = ptr MCI_SEEK_PARMS
  TMCI_SEEK_PARMS* = MCI_SEEK_PARMS
  MCI_STATUS_PARMS* = record
    dwCallback*: DWORD
    dwReturn*: DWORD
    dwItem*: DWORD
    dwTrack*: DWORD

  PMCI_STATUS_PARMS* = ptr MCI_STATUS_PARMS
  LPMCI_STATUS_PARMS* = ptr MCI_STATUS_PARMS
  TMCI_STATUS_PARMS* = MCI_STATUS_PARMS
  MCI_INFO_PARMSA* = record
    dwCallback*: DWORD
    lpstrReturn*: cstring
    dwRetSize*: DWORD

  LPMCI_INFO_PARMSA* = ptr MCI_INFO_PARMSA
  TMCI_INFO_PARMSA* = MCI_INFO_PARMSA
  MCI_INFO_PARMSW* = record
    dwCallback*: DWORD
    lpstrReturn*: LPWSTR
    dwRetSize*: DWORD

  LPMCI_INFO_PARMSW* = ptr MCI_INFO_PARMSW
  TMCI_INFO_PARMSW* = MCI_INFO_PARMSW

when defined(UNICODE):
  type
    MCI_INFO_PARMS* = MCI_INFO_PARMSW
    LPMCI_INFO_PARMS* = LPMCI_INFO_PARMSW
else:
  type
    MCI_INFO_PARMS* = MCI_INFO_PARMSA
    LPMCI_INFO_PARMS* = LPMCI_INFO_PARMSA
type
  TMCI_INFO_PARMS* = MCI_INFO_PARMS
  MCI_GETDEVCAPS_PARMS* = record
    dwCallback*: DWORD
    dwReturn*: DWORD
    dwItem*: DWORD

  PMCI_GETDEVCAPS_PARMS* = ptr MCI_GETDEVCAPS_PARMS
  LPMCI_GETDEVCAPS_PARMS* = ptr MCI_GETDEVCAPS_PARMS
  TMCI_GETDEVCAPS_PARMS* = MCI_GETDEVCAPS_PARMS
  MCI_SYSINFO_PARMSA* = record
    dwCallback*: DWORD
    lpstrReturn*: cstring
    dwRetSize*: DWORD
    dwNumber*: DWORD
    wDeviceType*: UINT

  PMCI_SYSINFO_PARMSA* = ptr MCI_SYSINFO_PARMSA
  LPMCI_SYSINFO_PARMSA* = ptr MCI_SYSINFO_PARMSA
  TMCI_SYSINFO_PARMSA* = MCI_SYSINFO_PARMSA
  MCI_SYSINFO_PARMSW* = record
    dwCallback*: DWORD
    lpstrReturn*: LPWSTR
    dwRetSize*: DWORD
    dwNumber*: DWORD
    wDeviceType*: UINT

  PMCI_SYSINFO_PARMSW* = ptr MCI_SYSINFO_PARMSW
  LPMCI_SYSINFO_PARMSW* = ptr MCI_SYSINFO_PARMSW
  TMCI_SYSINFO_PARMSW* = MCI_SYSINFO_PARMSW

when defined(UNICODE):
  type
    MCI_SYSINFO_PARMS* = MCI_SYSINFO_PARMSW
    PMCI_SYSINFO_PARMS* = PMCI_SYSINFO_PARMSW
    LPMCI_SYSINFO_PARMS* = LPMCI_SYSINFO_PARMSW
else:
  type
    MCI_SYSINFO_PARMS* = MCI_SYSINFO_PARMSA
    PMCI_SYSINFO_PARMS* = PMCI_SYSINFO_PARMSA
    LPMCI_SYSINFO_PARMS* = LPMCI_SYSINFO_PARMSA
type
  TMCI_SYSINFO_PARMS* = MCI_SYSINFO_PARMS
  MCI_SET_PARMS* = record
    dwCallback*: DWORD
    dwTimeFormat*: DWORD
    dwAudio*: DWORD

  PMCI_SET_PARMS* = ptr MCI_SET_PARMS
  LPMCI_SET_PARMS* = ptr MCI_SET_PARMS
  TMCI_SET_PARMS* = MCI_SET_PARMS
  MCI_BREAK_PARMS* = record
    dwCallback*: DWORD
    nVirtKey*: int32
    hwndBreak*: HWND

  PMCI_BREAK_PARMS* = ptr MCI_BREAK_PARMS
  LPMCI_BREAK_PARMS* = ptr MCI_BREAK_PARMS
  TMCI_BREAK_PARMS* = MCI_BREAK_PARMS
  MCI_SAVE_PARMSA* = record
    dwCallback*: DWORD
    lpfilename*: LPCSTR

  PMCI_SAVE_PARMSA* = ptr MCI_SAVE_PARMSA
  LPMCI_SAVE_PARMSA* = ptr MCI_SAVE_PARMSA
  TMCI_SAVE_PARMSA* = MCI_SAVE_PARMSA
  MCI_SAVE_PARMSW* = record
    dwCallback*: DWORD
    lpfilename*: LPCWSTR

  PMCI_SAVE_PARMSW* = ptr MCI_SAVE_PARMSW
  LPMCI_SAVE_PARMSW* = ptr MCI_SAVE_PARMSW
  TMCI_SAVE_PARMSW* = MCI_SAVE_PARMSW

when defined(UNICODE):
  type
    MCI_SAVE_PARMS* = MCI_SAVE_PARMSW
    PMCI_SAVE_PARMS* = PMCI_SAVE_PARMSW
    LPMCI_SAVE_PARMS* = LPMCI_SAVE_PARMSW
else:
  type
    MCI_SAVE_PARMS* = MCI_SAVE_PARMSA
    PMCI_SAVE_PARMS* = PMCI_SAVE_PARMSA
    LPMCI_SAVE_PARMS* = LPMCI_SAVE_PARMSA
type
  TMCI_SAVE_PARMS* = MCI_SAVE_PARMS
  MCI_LOAD_PARMSA* = record
    dwCallback*: DWORD
    lpfilename*: LPCSTR

  PMCI_LOAD_PARMSA* = ptr MCI_LOAD_PARMSA
  LPMCI_LOAD_PARMSA* = ptr MCI_LOAD_PARMSA
  TMCI_LOAD_PARMSA* = MCI_LOAD_PARMSA
  MCI_LOAD_PARMSW* = record
    dwCallback*: DWORD
    lpfilename*: LPCWSTR

  PMCI_LOAD_PARMSW* = ptr MCI_LOAD_PARMSW
  LPMCI_LOAD_PARMSW* = ptr MCI_LOAD_PARMSW
  TMCI_LOAD_PARMSW* = MCI_LOAD_PARMSW

when defined(UNICODE):
  type
    MCI_LOAD_PARMS* = MCI_LOAD_PARMSW
    PMCI_LOAD_PARMS* = PMCI_LOAD_PARMSW
    LPMCI_LOAD_PARMS* = LPMCI_LOAD_PARMSW
else:
  type
    MCI_LOAD_PARMS* = MCI_LOAD_PARMSA
    PMCI_LOAD_PARMS* = PMCI_LOAD_PARMSA
    LPMCI_LOAD_PARMS* = LPMCI_LOAD_PARMSA
type
  TMCI_LOAD_PARMS* = MCI_LOAD_PARMS
  MCI_RECORD_PARMS* = record
    dwCallback*: DWORD
    dwFrom*: DWORD
    dwTo*: DWORD

  LPMCI_RECORD_PARMS* = ptr MCI_RECORD_PARMS
  TMCI_RECORD_PARMS* = MCI_RECORD_PARMS
  MCI_VD_PLAY_PARMS* = record
    dwCallback*: DWORD
    dwFrom*: DWORD
    dwTo*: DWORD
    dwSpeed*: DWORD

  PMCI_VD_PLAY_PARMS* = ptr MCI_VD_PLAY_PARMS
  LPMCI_VD_PLAY_PARMS* = ptr MCI_VD_PLAY_PARMS
  TMCI_VD_PLAY_PARMS* = MCI_VD_PLAY_PARMS
  MCI_VD_STEP_PARMS* = record
    dwCallback*: DWORD
    dwFrames*: DWORD

  PMCI_VD_STEP_PARMS* = ptr MCI_VD_STEP_PARMS
  LPMCI_VD_STEP_PARMS* = ptr MCI_VD_STEP_PARMS
  MCI_VD_ESCAPE_PARMSA* = record
    dwCallback*: DWORD
    lpstrCommand*: LPCSTR

  PMCI_VD_ESCAPE_PARMSA* = ptr MCI_VD_ESCAPE_PARMSA
  LPMCI_VD_ESCAPE_PARMSA* = ptr MCI_VD_ESCAPE_PARMSA
  TMCI_VD_ESCAPE_PARMSA* = MCI_VD_ESCAPE_PARMSA
  MCI_VD_ESCAPE_PARMSW* = record
    dwCallback*: DWORD
    lpstrCommand*: LPCWSTR

  PMCI_VD_ESCAPE_PARMSW* = ptr MCI_VD_ESCAPE_PARMSW
  LPMCI_VD_ESCAPE_PARMSW* = ptr MCI_VD_ESCAPE_PARMSW
  TMCI_VD_ESCAPE_PARMSW* = MCI_VD_ESCAPE_PARMSW

when defined(UNICODE):
  type
    MCI_VD_ESCAPE_PARMS* = MCI_VD_ESCAPE_PARMSW
    PMCI_VD_ESCAPE_PARMS* = PMCI_VD_ESCAPE_PARMSW
    LPMCI_VD_ESCAPE_PARMS* = LPMCI_VD_ESCAPE_PARMSW
else:
  type
    MCI_VD_ESCAPE_PARMS* = MCI_VD_ESCAPE_PARMSA
    PMCI_VD_ESCAPE_PARMS* = PMCI_VD_ESCAPE_PARMSA
    LPMCI_VD_ESCAPE_PARMS* = LPMCI_VD_ESCAPE_PARMSA
type
  TMCI_VD_ESCAPE_PARMS* = MCI_VD_ESCAPE_PARMS
  MCI_WAVE_OPEN_PARMSA* = record
    dwCallback*: DWORD
    wDeviceID*: MCIDEVICEID
    lpstrDeviceType*: LPCSTR
    lpstrElementName*: LPCSTR
    lpstrAlias*: LPCSTR
    dwBufferSeconds*: DWORD

  PMCI_WAVE_OPEN_PARMSA* = ptr MCI_WAVE_OPEN_PARMSA
  LPMCI_WAVE_OPEN_PARMSA* = ptr MCI_WAVE_OPEN_PARMSA
  TMCI_WAVE_OPEN_PARMSA* = MCI_WAVE_OPEN_PARMSA
  MCI_WAVE_OPEN_PARMSW* = record
    dwCallback*: DWORD
    wDeviceID*: MCIDEVICEID
    lpstrDeviceType*: LPCWSTR
    lpstrElementName*: LPCWSTR
    lpstrAlias*: LPCWSTR
    dwBufferSeconds*: DWORD

  PMCI_WAVE_OPEN_PARMSW* = ptr MCI_WAVE_OPEN_PARMSW
  LPMCI_WAVE_OPEN_PARMSW* = ptr MCI_WAVE_OPEN_PARMSW
  TMCI_WAVE_OPEN_PARMSW* = MCI_WAVE_OPEN_PARMSW

when defined(UNICODE):
  type
    MCI_WAVE_OPEN_PARMS* = MCI_WAVE_OPEN_PARMSW
    PMCI_WAVE_OPEN_PARMS* = PMCI_WAVE_OPEN_PARMSW
    LPMCI_WAVE_OPEN_PARMS* = LPMCI_WAVE_OPEN_PARMSW
else:
  type
    MCI_WAVE_OPEN_PARMS* = MCI_WAVE_OPEN_PARMSA
    PMCI_WAVE_OPEN_PARMS* = PMCI_WAVE_OPEN_PARMSA
    LPMCI_WAVE_OPEN_PARMS* = LPMCI_WAVE_OPEN_PARMSA
type
  TMCI_WAVE_OPEN_PARMS* = MCI_WAVE_OPEN_PARMS
  MCI_WAVE_DELETE_PARMS* = record
    dwCallback*: DWORD
    dwFrom*: DWORD
    dwTo*: DWORD

  PMCI_WAVE_DELETE_PARMS* = ptr MCI_WAVE_DELETE_PARMS
  LPMCI_WAVE_DELETE_PARMS* = ptr MCI_WAVE_DELETE_PARMS
  TMCI_WAVE_DELETE_PARMS* = MCI_WAVE_DELETE_PARMS
  MCI_WAVE_SET_PARMS* = record
    dwCallback*: DWORD
    dwTimeFormat*: DWORD
    dwAudio*: DWORD
    wInput*: UINT
    wOutput*: UINT
    wFormatTag*: int16
    wReserved2*: int16
    nChannels*: int16
    wReserved3*: int16
    nSamplesPerSec*: DWORD
    nAvgBytesPerSec*: DWORD
    nBlockAlign*: int16
    wReserved4*: int16
    wBitsPerSample*: int16
    wReserved5*: int16

  PMCI_WAVE_SET_PARMS* = ptr MCI_WAVE_SET_PARMS
  LPMCI_WAVE_SET_PARMS* = ptr MCI_WAVE_SET_PARMS
  TMCI_WAVE_SET_PARMS* = MCI_WAVE_SET_PARMS
  MCI_SEQ_SET_PARMS* = record
    dwCallback*: DWORD
    dwTimeFormat*: DWORD
    dwAudio*: DWORD
    dwTempo*: DWORD
    dwPort*: DWORD
    dwSlave*: DWORD
    dwMaster*: DWORD
    dwOffset*: DWORD

  PMCI_SEQ_SET_PARMS* = ptr MCI_SEQ_SET_PARMS
  LPMCI_SEQ_SET_PARMS* = ptr MCI_SEQ_SET_PARMS
  TMCI_SEQ_SET_PARMS* = MCI_SEQ_SET_PARMS
  MCI_ANIM_OPEN_PARMSA* = record
    dwCallback*: DWORD
    wDeviceID*: MCIDEVICEID
    lpstrDeviceType*: LPCSTR
    lpstrElementName*: LPCSTR
    lpstrAlias*: LPCSTR
    dwStyle*: DWORD
    hWndParent*: HWND

  PMCI_ANIM_OPEN_PARMSA* = ptr MCI_ANIM_OPEN_PARMSA
  LPMCI_ANIM_OPEN_PARMSA* = ptr MCI_ANIM_OPEN_PARMSA
  TMCI_ANIM_OPEN_PARMSA* = MCI_ANIM_OPEN_PARMSA
  MCI_ANIM_OPEN_PARMSW* = record
    dwCallback*: DWORD
    wDeviceID*: MCIDEVICEID
    lpstrDeviceType*: LPCWSTR
    lpstrElementName*: LPCWSTR
    lpstrAlias*: LPCWSTR
    dwStyle*: DWORD
    hWndParent*: HWND

  PMCI_ANIM_OPEN_PARMSW* = ptr MCI_ANIM_OPEN_PARMSW
  LPMCI_ANIM_OPEN_PARMSW* = ptr MCI_ANIM_OPEN_PARMSW

when defined(UNICODE):
  type
    MCI_ANIM_OPEN_PARMS* = MCI_ANIM_OPEN_PARMSW
    PMCI_ANIM_OPEN_PARMS* = PMCI_ANIM_OPEN_PARMSW
    LPMCI_ANIM_OPEN_PARMS* = LPMCI_ANIM_OPEN_PARMSW
else:
  type
    MCI_ANIM_OPEN_PARMS* = MCI_ANIM_OPEN_PARMSA
    PMCI_ANIM_OPEN_PARMS* = PMCI_ANIM_OPEN_PARMSA
    LPMCI_ANIM_OPEN_PARMS* = LPMCI_ANIM_OPEN_PARMSA
type
  TMCI_ANIM_OPEN_PARMS* = MCI_ANIM_OPEN_PARMS
  MCI_ANIM_WINDOW_PARMSW* = record
    dwCallback*: DWORD
    hWnd*: HWND
    nCmdShow*: UINT
    lpstrText*: LPCWSTR

  PMCI_ANIM_WINDOW_PARMSW* = ptr MCI_ANIM_WINDOW_PARMSW
  LPMCI_ANIM_WINDOW_PARMSW* = ptr MCI_ANIM_WINDOW_PARMSW
  TMCI_ANIM_WINDOW_PARMSW* = MCI_ANIM_WINDOW_PARMSW
  MCI_ANIM_STEP_PARMS* = record
    dwCallback*: DWORD
    dwFrames*: DWORD

  PMCI_ANIM_STEP_PARMS* = ptr MCI_ANIM_STEP_PARMS
  LPMCI_ANIM_STEP_PARMS* = ptr MCI_ANIM_STEP_PARMS
  TMCI_ANIM_STEP_PARMS* = MCI_ANIM_STEP_PARMS
  MCI_ANIM_WINDOW_PARMSA* = record
    dwCallback*: DWORD
    hWnd*: HWND
    nCmdShow*: UINT
    lpstrText*: LPCSTR

  PMCI_ANIM_WINDOW_PARMSA* = ptr MCI_ANIM_WINDOW_PARMSA
  LPMCI_ANIM_WINDOW_PARMSA* = ptr MCI_ANIM_WINDOW_PARMSA
  TMCI_ANIM_WINDOW_PARMSA* = MCI_ANIM_WINDOW_PARMSA
  MCI_ANIM_PLAY_PARMS* = record
    dwCallback*: DWORD
    dwFrom*: DWORD
    dwTo*: DWORD
    dwSpeed*: DWORD

  PMCI_ANIM_PLAY_PARMS* = ptr MCI_ANIM_PLAY_PARMS
  LPMCI_ANIM_PLAY_PARMS* = ptr MCI_ANIM_PLAY_PARMS

when defined(UNICODE):
  type
    MCI_ANIM_WINDOW_PARMS* = MCI_ANIM_WINDOW_PARMSW
    PMCI_ANIM_WINDOW_PARMS* = PMCI_ANIM_WINDOW_PARMSW
    LPMCI_ANIM_WINDOW_PARMS* = LPMCI_ANIM_WINDOW_PARMSW
else:
  type
    MCI_ANIM_WINDOW_PARMS* = MCI_ANIM_WINDOW_PARMSA
    PMCI_ANIM_WINDOW_PARMS* = PMCI_ANIM_WINDOW_PARMSA
    LPMCI_ANIM_WINDOW_PARMS* = LPMCI_ANIM_WINDOW_PARMSA
type
  MCI_ANIM_RECT_PARMS* = record
    dwCallback*: DWORD
    rc*: TRECT

  PMCI_ANIM_RECT_PARMS* = ptr MCI_ANIM_RECT_PARMS
  LPMCI_ANIM_RECT_PARMS* = ptr MCI_ANIM_RECT_PARMS
  TMCI_ANIM_RECT_PARMS* = MCI_ANIM_RECT_PARMS
  MCI_ANIM_UPDATE_PARMS* = record
    dwCallback*: DWORD
    rc*: TRECT
    hDC*: HDC

  PMCI_ANIM_UPDATE_PARMS* = ptr MCI_ANIM_UPDATE_PARMS
  LPMCI_ANIM_UPDATE_PARMS* = ptr MCI_ANIM_UPDATE_PARMS
  TMCI_ANIM_UPDATE_PARMS* = MCI_ANIM_UPDATE_PARMS
  MCI_OVLY_OPEN_PARMSA* = record
    dwCallback*: DWORD
    wDeviceID*: MCIDEVICEID
    lpstrDeviceType*: LPCSTR
    lpstrElementName*: LPCSTR
    lpstrAlias*: LPCSTR
    dwStyle*: DWORD
    hWndParent*: HWND

  PMCI_OVLY_OPEN_PARMSA* = ptr MCI_OVLY_OPEN_PARMSA
  LPMCI_OVLY_OPEN_PARMSA* = ptr MCI_OVLY_OPEN_PARMSA
  TMCI_OVLY_OPEN_PARMSA* = MCI_OVLY_OPEN_PARMSA
  MCI_OVLY_OPEN_PARMSW* = record
    dwCallback*: DWORD
    wDeviceID*: MCIDEVICEID
    lpstrDeviceType*: LPCWSTR
    lpstrElementName*: LPCWSTR
    lpstrAlias*: LPCWSTR
    dwStyle*: DWORD
    hWndParent*: HWND

  PMCI_OVLY_OPEN_PARMSW* = ptr MCI_OVLY_OPEN_PARMSW
  LPMCI_OVLY_OPEN_PARMSW* = ptr MCI_OVLY_OPEN_PARMSW
  TMCI_OVLY_OPEN_PARMSW* = MCI_OVLY_OPEN_PARMSW

when defined(UNICODE):
  type
    MCI_OVLY_OPEN_PARMS* = MCI_OVLY_OPEN_PARMSW
    PMCI_OVLY_OPEN_PARMS* = PMCI_OVLY_OPEN_PARMSW
    LPMCI_OVLY_OPEN_PARMS* = LPMCI_OVLY_OPEN_PARMSW
else:
  type
    MCI_OVLY_OPEN_PARMS* = MCI_OVLY_OPEN_PARMSA
    PMCI_OVLY_OPEN_PARMS* = PMCI_OVLY_OPEN_PARMSA
    LPMCI_OVLY_OPEN_PARMS* = LPMCI_OVLY_OPEN_PARMSA
type
  TMCI_OVLY_OPEN_PARMS* = MCI_OVLY_OPEN_PARMS
  MCI_OVLY_WINDOW_PARMSA* = record
    dwCallback*: DWORD
    hWnd*: HWND
    nCmdShow*: UINT
    lpstrText*: LPCSTR

  PMCI_OVLY_WINDOW_PARMSA* = ptr MCI_OVLY_WINDOW_PARMSA
  LPMCI_OVLY_WINDOW_PARMSA* = ptr MCI_OVLY_WINDOW_PARMSA
  TMCI_OVLY_WINDOW_PARMSA* = MCI_OVLY_WINDOW_PARMSA
  MCI_OVLY_WINDOW_PARMSW* = record
    dwCallback*: DWORD
    hWnd*: HWND
    nCmdShow*: UINT
    lpstrText*: LPCWSTR

  PMCI_OVLY_WINDOW_PARMSW* = ptr MCI_OVLY_WINDOW_PARMSW
  LPMCI_OVLY_WINDOW_PARMSW* = ptr MCI_OVLY_WINDOW_PARMSW
  TMCI_OVLY_WINDOW_PARMSW* = MCI_OVLY_WINDOW_PARMSW

when defined(UNICODE):
  type
    MCI_OVLY_WINDOW_PARMS* = MCI_OVLY_WINDOW_PARMSW
    PMCI_OVLY_WINDOW_PARMS* = PMCI_OVLY_WINDOW_PARMSW
    LPMCI_OVLY_WINDOW_PARMS* = LPMCI_OVLY_WINDOW_PARMSW
else:
  type
    MCI_OVLY_WINDOW_PARMS* = MCI_OVLY_WINDOW_PARMSA
    PMCI_OVLY_WINDOW_PARMS* = PMCI_OVLY_WINDOW_PARMSA
    LPMCI_OVLY_WINDOW_PARMS* = LPMCI_OVLY_WINDOW_PARMSA
type
  TMCI_OVLY_WINDOW_PARMS* = MCI_OVLY_WINDOW_PARMSW
  MCI_OVLY_RECT_PARMS* = record
    dwCallback*: DWORD
    rc*: TRECT

  PMCI_OVLY_RECT_PARMS* = ptr MCI_OVLY_RECT_PARMS
  LPMCI_OVLY_RECT_PARMS* = ptr MCI_OVLY_RECT_PARMS
  TMCI_OVLY_RECT_PARMS* = MCI_OVLY_RECT_PARMS
  MCI_OVLY_SAVE_PARMSA* = record
    dwCallback*: DWORD
    lpfilename*: LPCSTR
    rc*: TRECT

  PMCI_OVLY_SAVE_PARMSA* = ptr MCI_OVLY_SAVE_PARMSA
  LPMCI_OVLY_SAVE_PARMSA* = ptr MCI_OVLY_SAVE_PARMSA
  TMCI_OVLY_SAVE_PARMSA* = MCI_OVLY_SAVE_PARMSA
  MCI_OVLY_SAVE_PARMSW* = record
    dwCallback*: DWORD
    lpfilename*: LPCWSTR
    rc*: TRECT

  PMCI_OVLY_SAVE_PARMSW* = ptr MCI_OVLY_SAVE_PARMSW
  LPMCI_OVLY_SAVE_PARMSW* = ptr MCI_OVLY_SAVE_PARMSW
  TMCI_OVLY_SAVE_PARMSW* = MCI_OVLY_SAVE_PARMSW

when defined(UNICODE):
  type
    MCI_OVLY_SAVE_PARMS* = MCI_OVLY_SAVE_PARMSW
    PMCI_OVLY_SAVE_PARMS* = PMCI_OVLY_SAVE_PARMSW
    LPMCI_OVLY_SAVE_PARMS* = LPMCI_OVLY_SAVE_PARMSW
else:
  type
    MCI_OVLY_SAVE_PARMS* = MCI_OVLY_SAVE_PARMSA
    PMCI_OVLY_SAVE_PARMS* = PMCI_OVLY_SAVE_PARMSA
    LPMCI_OVLY_SAVE_PARMS* = LPMCI_OVLY_SAVE_PARMSA
type
  TMCI_OVLY_SAVE_PARMS* = MCI_OVLY_SAVE_PARMS
  MCI_OVLY_LOAD_PARMSA* = record
    dwCallback*: DWORD
    lpfilename*: LPCSTR
    rc*: TRECT

  PMCI_OVLY_LOAD_PARMSA* = ptr MCI_OVLY_LOAD_PARMSA
  LPMCI_OVLY_LOAD_PARMSA* = ptr MCI_OVLY_LOAD_PARMSA
  TMCI_OVLY_LOAD_PARMSA* = MCI_OVLY_LOAD_PARMSA
  MCI_OVLY_LOAD_PARMSW* = record
    dwCallback*: DWORD
    lpfilename*: LPCWSTR
    rc*: TRECT

  PMCI_OVLY_LOAD_PARMSW* = ptr MCI_OVLY_LOAD_PARMSW
  LPMCI_OVLY_LOAD_PARMSW* = ptr MCI_OVLY_LOAD_PARMSW
  TMCI_OVLY_LOAD_PARMSW* = MCI_OVLY_LOAD_PARMSW

when defined(UNICODE):
  type
    MCI_OVLY_LOAD_PARMS* = MCI_OVLY_LOAD_PARMSW
    PMCI_OVLY_LOAD_PARMS* = PMCI_OVLY_LOAD_PARMSW
    LPMCI_OVLY_LOAD_PARMS* = LPMCI_OVLY_LOAD_PARMSW
else:
  type
    MCI_OVLY_LOAD_PARMS* = MCI_OVLY_LOAD_PARMSA
    PMCI_OVLY_LOAD_PARMS* = PMCI_OVLY_LOAD_PARMSA
    LPMCI_OVLY_LOAD_PARMS* = LPMCI_OVLY_LOAD_PARMSA
type
  TMCI_OVLY_LOAD_PARMS* = MCI_OVLY_LOAD_PARMS

type
  pcmwaveformat_tag* = PCMWAVEFORMAT

proc mmioStringToFOURCCA*(x1: LPCSTR, x2: UINT): FOURCC{.stdcall,
    dynlib: "winmm.dll", importc: "mmioStringToFOURCCA".}
proc mmioStringToFOURCCW*(x1: LPCWSTR, x2: UINT): FOURCC{.stdcall,
    dynlib: "winmm.dll", importc: "mmioStringToFOURCCW".}
proc mmioStringToFOURCC*(x1: cstring, x2: UINT): FOURCC{.stdcall,
    dynlib: "winmm.dll", importc: "mmioStringToFOURCCA".}
proc mmioInstallIOProcA*(x1: FOURCC, x2: LPMMIOPROC, x3: DWORD): LPMMIOPROC{.
    stdcall, dynlib: "winmm.dll", importc: "mmioInstallIOProcA".}
proc mmioInstallIOProcW*(x1: FOURCC, x2: LPMMIOPROC, x3: DWORD): LPMMIOPROC{.
    stdcall, dynlib: "winmm.dll", importc: "mmioInstallIOProcW".}
proc mmioInstallIOProc*(x1: FOURCC, x2: LPMMIOPROC, x3: DWORD): LPMMIOPROC{.
    stdcall, dynlib: "winmm.dll", importc: "mmioInstallIOProcA".}
proc mmioOpenA*(x1: LPSTR, x2: LPMMIOINFO, x3: DWORD): HMMIO{.stdcall,
    dynlib: "winmm.dll", importc: "mmioOpenA".}
proc mmioOpenW*(x1: LPWSTR, x2: LPMMIOINFO, x3: DWORD): HMMIO{.stdcall,
    dynlib: "winmm.dll", importc: "mmioOpenW".}
proc mmioOpen*(x1: cstring, x2: LPMMIOINFO, x3: DWORD): HMMIO{.stdcall,
    dynlib: "winmm.dll", importc: "mmioOpenA".}
proc mmioRenameA*(x1: LPCSTR, x2: LPCSTR, x3: LPCMMIOINFO, x4: DWORD): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "mmioRenameA".}
proc mmioRenameW*(x1: LPCWSTR, x2: LPCWSTR, x3: LPCMMIOINFO, x4: DWORD): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "mmioRenameW".}
proc mmioRename*(x1: cstring, x2: cstring, x3: LPCMMIOINFO, x4: DWORD): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "mmioRenameA".}
proc mmioClose*(x1: HMMIO, x2: UINT): MMRESULT{.stdcall, dynlib: "winmm.dll",
    importc: "mmioClose".}
proc mmioRead*(x1: HMMIO, x2: HPSTR, x3: LONG): LONG{.stdcall,
    dynlib: "winmm.dll", importc: "mmioRead".}
proc mmioWrite*(x1: HMMIO, x2: cstring, x3: LONG): LONG{.stdcall,
    dynlib: "winmm.dll", importc: "mmioWrite".}
proc mmioSeek*(x1: HMMIO, x2: LONG, x3: WINT): LONG{.stdcall,
    dynlib: "winmm.dll", importc: "mmioSeek".}
proc mmioGetInfo*(x1: HMMIO, x2: LPMMIOINFO, x3: UINT): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "mmioGetInfo".}
proc mmioSetInfo*(x1: HMMIO, x2: LPCMMIOINFO, x3: UINT): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "mmioSetInfo".}
proc mmioSetBuffer*(x1: HMMIO, x2: LPSTR, x3: LONG, x4: UINT): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "mmioSetBuffer".}
proc mmioFlush*(x1: HMMIO, x2: UINT): MMRESULT{.stdcall, dynlib: "winmm.dll",
    importc: "mmioFlush".}
proc mmioAdvance*(x1: HMMIO, x2: LPMMIOINFO, x3: UINT): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "mmioAdvance".}
proc mmioSendMessage*(x1: HMMIO, x2: UINT, x3: LPARAM, x4: LPARAM): LRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "mmioSendMessage".}
proc mmioDescend*(x1: HMMIO, x2: LPMMCKINFO, x3: PMMCKINFO, x4: UINT): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "mmioDescend".}
proc mmioAscend*(x1: HMMIO, x2: LPMMCKINFO, x3: UINT): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "mmioAscend".}
proc mmioCreateChunk*(x1: HMMIO, x2: LPMMCKINFO, x3: UINT): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "mmioCreateChunk".}
proc mciSendCommandA*(x1: MCIDEVICEID, x2: UINT, x3: DWORD, x4: DWORD): MCIERROR{.
    stdcall, dynlib: "winmm.dll", importc: "mciSendCommandA".}
proc mciSendCommandW*(x1: MCIDEVICEID, x2: UINT, x3: DWORD, x4: DWORD): MCIERROR{.
    stdcall, dynlib: "winmm.dll", importc: "mciSendCommandW".}
proc mciSendCommand*(x1: MCIDEVICEID, x2: UINT, x3: DWORD, x4: DWORD): MCIERROR{.
    stdcall, dynlib: "winmm.dll", importc: "mciSendCommandA".}
proc mciSendStringA*(x1: LPCSTR, x2: LPSTR, x3: UINT, x4: HWND): MCIERROR{.
    stdcall, dynlib: "winmm.dll", importc: "mciSendStringA".}
proc mciSendStringW*(x1: LPCWSTR, x2: LPWSTR, x3: UINT, x4: HWND): MCIERROR{.
    stdcall, dynlib: "winmm.dll", importc: "mciSendStringW".}
proc mciSendString*(x1: cstring, x2: cstring, x3: UINT, x4: HWND): MCIERROR{.
    stdcall, dynlib: "winmm.dll", importc: "mciSendStringA".}
proc mciGetDeviceIDA*(x1: LPCSTR): MCIDEVICEID{.stdcall, dynlib: "winmm.dll",
    importc: "mciGetDeviceIDA".}
proc mciGetDeviceIDW*(x1: LPCWSTR): MCIDEVICEID{.stdcall, dynlib: "winmm.dll",
    importc: "mciGetDeviceIDW".}
proc mciGetDeviceID*(x1: cstring): MCIDEVICEID{.stdcall, dynlib: "winmm.dll",
    importc: "mciGetDeviceIDA".}
proc mciGetDeviceIDFromElementIDA*(x1: DWORD, x2: LPCSTR): MCIDEVICEID{.stdcall,
    dynlib: "winmm.dll", importc: "mciGetDeviceIDFromElementIDA".}
proc mciGetDeviceIDFromElementIDW*(x1: DWORD, x2: LPCWSTR): MCIDEVICEID{.
    stdcall, dynlib: "winmm.dll", importc: "mciGetDeviceIDFromElementIDW".}
proc mciGetDeviceIDFromElementID*(x1: DWORD, x2: cstring): MCIDEVICEID{.stdcall,
    dynlib: "winmm.dll", importc: "mciGetDeviceIDFromElementIDA".}
proc mciGetErrorStringA*(x1: MCIERROR, x2: LPSTR, x3: UINT): BOOL{.stdcall,
    dynlib: "winmm.dll", importc: "mciGetErrorStringA".}
proc mciGetErrorStringW*(x1: MCIERROR, x2: LPWSTR, x3: UINT): BOOL{.stdcall,
    dynlib: "winmm.dll", importc: "mciGetErrorStringW".}
proc mciGetErrorString*(x1: MCIERROR, x2: cstring, x3: UINT): BOOL{.stdcall,
    dynlib: "winmm.dll", importc: "mciGetErrorStringA".}
proc mciSetYieldProc*(x1: MCIDEVICEID, x2: YIELDPROC, x3: DWORD): BOOL{.stdcall,
    dynlib: "winmm.dll", importc: "mciSetYieldProc".}
proc mciGetCreatorTask*(x1: MCIDEVICEID): HTASK{.stdcall, dynlib: "winmm.dll",
    importc: "mciGetCreatorTask".}
proc mciGetYieldProc*(x1: MCIDEVICEID, x2: LPDWORD): YIELDPROC{.stdcall,
    dynlib: "winmm.dll", importc: "mciGetYieldProc".}
proc mciExecute*(x1: LPCSTR): BOOL{.stdcall, dynlib: "winmm.dll",
                                    importc: "mciExecute".}
proc joyGetPos*(x1: UINT, x2: LPJOYINFO): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "joyGetPos".}
proc joyGetPosEx*(x1: UINT, x2: LPJOYINFOEX): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "joyGetPosEx".}
proc joyGetThreshold*(x1: UINT, x2: LPUINT): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "joyGetThreshold".}
proc joyReleaseCapture*(x1: UINT): MMRESULT{.stdcall, dynlib: "winmm.dll",
    importc: "joyReleaseCapture".}
proc joySetCapture*(x1: HWND, x2: UINT, x3: UINT, x4: BOOL): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "joySetCapture".}
proc joySetThreshold*(x1: UINT, x2: UINT): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "joySetThreshold".}
proc waveOutGetNumDevs*(): UINT{.stdcall, dynlib: "winmm.dll",
                                 importc: "waveOutGetNumDevs".}
proc waveOutGetDevCapsA*(x1: UINT, x2: LPWAVEOUTCAPSA, x3: UINT): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "waveOutGetDevCapsA".}
proc waveOutGetDevCapsW*(x1: UINT, x2: LPWAVEOUTCAPSW, x3: UINT): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "waveOutGetDevCapsW".}
proc waveOutGetDevCaps*(x1: UINT, x2: LPWAVEOUTCAPS, x3: UINT): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "waveOutGetDevCapsA".}
proc waveOutGetVolume*(x1: HWAVEOUT, x2: LPDWORD): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "waveOutGetVolume".}
proc waveOutSetVolume*(x1: HWAVEOUT, x2: DWORD): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "waveOutSetVolume".}
proc waveOutGetErrorTextA*(x1: MMRESULT, x2: LPSTR, x3: UINT): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "waveOutGetErrorTextA".}
proc waveOutGetErrorTextW*(x1: MMRESULT, x2: LPWSTR, x3: UINT): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "waveOutGetErrorTextW".}
proc waveOutGetErrorText*(x1: MMRESULT, x2: cstring, x3: UINT): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "waveOutGetErrorTextA".}
proc waveOutOpen*(x1: LPHWAVEOUT, x2: UINT, x3: LPCWAVEFORMATEX, x4: DWORD,
                  x5: DWORD, x6: DWORD): MMRESULT{.stdcall, dynlib: "winmm.dll",
    importc: "waveOutOpen".}
proc waveOutClose*(x1: HWAVEOUT): MMRESULT{.stdcall, dynlib: "winmm.dll",
    importc: "waveOutClose".}
proc waveOutPrepareHeader*(x1: HWAVEOUT, x2: LPWAVEHDR, x3: UINT): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "waveOutPrepareHeader".}
proc waveOutUnprepareHeader*(x1: HWAVEOUT, x2: LPWAVEHDR, x3: UINT): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "waveOutUnprepareHeader".}
proc waveOutWrite*(x1: HWAVEOUT, x2: LPWAVEHDR, x3: UINT): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "waveOutWrite".}
proc waveOutPause*(x1: HWAVEOUT): MMRESULT{.stdcall, dynlib: "winmm.dll",
    importc: "waveOutPause".}
proc waveOutRestart*(x1: HWAVEOUT): MMRESULT{.stdcall, dynlib: "winmm.dll",
    importc: "waveOutRestart".}
proc waveOutReset*(x1: HWAVEOUT): MMRESULT{.stdcall, dynlib: "winmm.dll",
    importc: "waveOutReset".}
proc waveOutBreakLoop*(x1: HWAVEOUT): MMRESULT{.stdcall, dynlib: "winmm.dll",
    importc: "waveOutBreakLoop".}
proc waveOutGetPosition*(x1: HWAVEOUT, x2: LPMMTIME, x3: UINT): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "waveOutGetPosition".}
proc waveOutGetPitch*(x1: HWAVEOUT, x2: LPDWORD): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "waveOutGetPitch".}
proc waveOutSetPitch*(x1: HWAVEOUT, x2: DWORD): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "waveOutSetPitch".}
proc waveOutGetPlaybackRate*(x1: HWAVEOUT, x2: LPDWORD): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "waveOutGetPlaybackRate".}
proc waveOutSetPlaybackRate*(x1: HWAVEOUT, x2: DWORD): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "waveOutSetPlaybackRate".}
proc waveOutGetID*(x1: HWAVEOUT, x2: LPUINT): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "waveOutGetID".}
proc waveOutMessage*(x1: HWAVEOUT, x2: UINT, x3: DWORD, x4: DWORD): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "waveOutMessage".}
proc waveInGetNumDevs*(): UINT{.stdcall, dynlib: "winmm.dll",
                                importc: "waveInGetNumDevs".}
proc waveInGetDevCapsA*(x1: UINT, x2: LPWAVEINCAPSA, x3: UINT): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "waveInGetDevCapsA".}
proc waveInGetDevCapsW*(x1: UINT, x2: LPWAVEINCAPSW, x3: UINT): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "waveInGetDevCapsW".}
proc waveInGetDevCaps*(x1: UINT, x2: LPWAVEINCAPS, x3: UINT): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "waveInGetDevCapsA".}
proc waveInGetErrorTextA*(x1: MMRESULT, x2: LPSTR, x3: UINT): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "waveInGetErrorTextA".}
proc waveInGetErrorTextW*(x1: MMRESULT, x2: LPWSTR, x3: UINT): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "waveInGetErrorTextW".}
proc waveInGetErrorText*(x1: MMRESULT, x2: cstring, x3: UINT): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "waveInGetErrorTextA".}
proc waveInOpen*(x1: LPHWAVEIN, x2: UINT, x3: LPCWAVEFORMATEX, x4: DWORD,
                 x5: DWORD, x6: DWORD): MMRESULT{.stdcall, dynlib: "winmm.dll",
    importc: "waveInOpen".}
proc waveInClose*(x1: HWAVEIN): MMRESULT{.stdcall, dynlib: "winmm.dll",
    importc: "waveInClose".}
proc waveInPrepareHeader*(x1: HWAVEIN, x2: LPWAVEHDR, x3: UINT): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "waveInPrepareHeader".}
proc waveInUnprepareHeader*(x1: HWAVEIN, x2: LPWAVEHDR, x3: UINT): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "waveInUnprepareHeader".}
proc waveInAddBuffer*(x1: HWAVEIN, x2: LPWAVEHDR, x3: UINT): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "waveInAddBuffer".}
proc waveInStart*(x1: HWAVEIN): MMRESULT{.stdcall, dynlib: "winmm.dll",
    importc: "waveInStart".}
proc waveInStop*(x1: HWAVEIN): MMRESULT{.stdcall, dynlib: "winmm.dll",
    importc: "waveInStop".}
proc waveInReset*(x1: HWAVEIN): MMRESULT{.stdcall, dynlib: "winmm.dll",
    importc: "waveInReset".}
proc waveInGetPosition*(x1: HWAVEIN, x2: LPMMTIME, x3: UINT): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "waveInGetPosition".}
proc waveInGetID*(x1: HWAVEIN, x2: LPUINT): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "waveInGetID".}
proc waveInMessage*(x1: HWAVEIN, x2: UINT, x3: DWORD, x4: DWORD): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "waveInMessage".}
proc mixerGetLineControlsA*(x1: HMIXEROBJ, x2: LPMIXERLINECONTROLSA, x3: DWORD): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "mixerGetLineControlsA".}
proc mixerGetLineControlsW*(x1: HMIXEROBJ, x2: LPMIXERLINECONTROLSW, x3: DWORD): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "mixerGetLineControlsW".}
proc mixerGetLineControls*(x1: HMIXEROBJ, x2: LPMIXERLINECONTROLS, x3: DWORD): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "mixerGetLineControlsA".}
proc joyGetNumDevs*(): UINT{.stdcall, dynlib: "winmm.dll",
                             importc: "joyGetNumDevs".}
proc joyGetDevCapsA*(x1: UINT, x2: LPJOYCAPSA, x3: UINT): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "joyGetDevCapsA".}
proc joyGetDevCapsW*(x1: UINT, x2: LPJOYCAPSW, x3: UINT): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "joyGetDevCapsW".}
proc joyGetDevCaps*(x1: UINT, x2: LPJOYCAPS, x3: UINT): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "joyGetDevCapsA".}
proc mixerGetControlDetailsA*(x1: HMIXEROBJ, x2: LPMIXERCONTROLDETAILS,
                              x3: DWORD): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "mixerGetControlDetailsA".}
proc mixerGetControlDetailsW*(x1: HMIXEROBJ, x2: LPMIXERCONTROLDETAILS,
                              x3: DWORD): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "mixerGetControlDetailsW".}
proc mixerGetControlDetails*(x1: HMIXEROBJ, x2: LPMIXERCONTROLDETAILS, x3: DWORD): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "mixerGetControlDetailsA".}
proc timeGetSystemTime*(x1: LPMMTIME, x2: UINT): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "timeGetSystemTime".}
proc timeGetTime*(): DWORD{.stdcall, dynlib: "winmm.dll", importc: "timeGetTime".}
proc timeSetEvent*(x1: UINT, x2: UINT, x3: LPTIMECALLBACK, x4: DWORD, x5: UINT): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "timeSetEvent".}
proc timeKillEvent*(x1: UINT): MMRESULT{.stdcall, dynlib: "winmm.dll",
    importc: "timeKillEvent".}
proc timeGetDevCaps*(x1: LPTIMECAPS, x2: UINT): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "timeGetDevCaps".}
proc timeBeginPeriod*(x1: UINT): MMRESULT{.stdcall, dynlib: "winmm.dll",
    importc: "timeBeginPeriod".}
proc timeEndPeriod*(x1: UINT): MMRESULT{.stdcall, dynlib: "winmm.dll",
    importc: "timeEndPeriod".}
proc mixerGetDevCapsA*(x1: UINT, x2: LPMIXERCAPSA, x3: UINT): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "mixerGetDevCapsA".}
proc mixerGetDevCapsW*(x1: UINT, x2: LPMIXERCAPSW, x3: UINT): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "mixerGetDevCapsW".}
proc mixerGetDevCaps*(x1: UINT, x2: LPMIXERCAPS, x3: UINT): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "mixerGetDevCapsA".}
proc mixerOpen*(x1: LPHMIXER, x2: UINT, x3: DWORD, x4: DWORD, x5: DWORD): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "mixerOpen".}
proc mixerClose*(x1: HMIXER): MMRESULT{.stdcall, dynlib: "winmm.dll",
                                        importc: "mixerClose".}
proc mixerMessage*(x1: HMIXER, x2: UINT, x3: DWORD, x4: DWORD): DWORD{.stdcall,
    dynlib: "winmm.dll", importc: "mixerMessage".}
proc auxGetNumDevs*(): UINT{.stdcall, dynlib: "winmm.dll",
                             importc: "auxGetNumDevs".}
proc auxGetDevCapsA*(x1: UINT, x2: LPAUXCAPSA, x3: UINT): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "auxGetDevCapsA".}
proc auxGetDevCapsW*(x1: UINT, x2: LPAUXCAPSW, x3: UINT): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "auxGetDevCapsW".}
proc auxGetDevCaps*(x1: UINT, x2: LPAUXCAPS, x3: UINT): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "auxGetDevCapsA".}
proc auxSetVolume*(x1: UINT, x2: DWORD): MMRESULT{.stdcall, dynlib: "winmm.dll",
    importc: "auxSetVolume".}
proc auxGetVolume*(x1: UINT, x2: LPDWORD): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "auxGetVolume".}
proc auxOutMessage*(x1: UINT, x2: UINT, x3: DWORD, x4: DWORD): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "auxOutMessage".}
proc midiOutGetNumDevs*(): UINT{.stdcall, dynlib: "winmm.dll",
                                 importc: "midiOutGetNumDevs".}
proc midiStreamOpen*(x1: LPHMIDISTRM, x2: LPUINT, x3: DWORD, x4: DWORD,
                     x5: DWORD, x6: DWORD): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "midiStreamOpen".}
proc midiStreamClose*(x1: HMIDISTRM): MMRESULT{.stdcall, dynlib: "winmm.dll",
    importc: "midiStreamClose".}
proc midiStreamProperty*(x1: HMIDISTRM, x2: LPBYTE, x3: DWORD): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "midiStreamProperty".}
proc midiStreamPosition*(x1: HMIDISTRM, x2: LPMMTIME, x3: UINT): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "midiStreamPosition".}
proc midiStreamOut*(x1: HMIDISTRM, x2: LPMIDIHDR, x3: UINT): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "midiStreamOut".}
proc midiStreamPause*(x1: HMIDISTRM): MMRESULT{.stdcall, dynlib: "winmm.dll",
    importc: "midiStreamPause".}
proc midiStreamRestart*(x1: HMIDISTRM): MMRESULT{.stdcall, dynlib: "winmm.dll",
    importc: "midiStreamRestart".}
proc midiStreamStop*(x1: HMIDISTRM): MMRESULT{.stdcall, dynlib: "winmm.dll",
    importc: "midiStreamStop".}
proc midiConnect*(x1: HMIDI, x2: HMIDIOUT, x3: pointer): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "midiConnect".}
proc midiDisconnect*(x1: HMIDI, x2: HMIDIOUT, x3: pointer): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "midiDisconnect".}
proc midiOutGetDevCapsA*(x1: UINT, x2: LPMIDIOUTCAPSA, x3: UINT): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "midiOutGetDevCapsA".}
proc midiOutGetDevCapsW*(x1: UINT, x2: LPMIDIOUTCAPSW, x3: UINT): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "midiOutGetDevCapsW".}
proc midiOutGetDevCaps*(x1: UINT, x2: LPMIDIOUTCAPS, x3: UINT): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "midiOutGetDevCapsA".}
proc midiOutGetVolume*(x1: HMIDIOUT, x2: LPDWORD): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "midiOutGetVolume".}
proc midiOutSetVolume*(x1: HMIDIOUT, x2: DWORD): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "midiOutSetVolume".}
proc midiOutGetErrorTextA*(x1: MMRESULT, x2: LPSTR, x3: UINT): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "midiOutGetErrorTextA".}
proc midiOutGetErrorTextW*(x1: MMRESULT, x2: LPWSTR, x3: UINT): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "midiOutGetErrorTextW".}
proc midiOutGetErrorText*(x1: MMRESULT, x2: cstring, x3: UINT): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "midiOutGetErrorTextA".}
proc midiOutOpen*(x1: LPHMIDIOUT, x2: UINT, x3: DWORD, x4: DWORD, x5: DWORD): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "midiOutOpen".}
proc midiOutClose*(x1: HMIDIOUT): MMRESULT{.stdcall, dynlib: "winmm.dll",
    importc: "midiOutClose".}
proc midiOutPrepareHeader*(x1: HMIDIOUT, x2: LPMIDIHDR, x3: UINT): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "midiOutPrepareHeader".}
proc midiOutUnprepareHeader*(x1: HMIDIOUT, x2: LPMIDIHDR, x3: UINT): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "midiOutUnprepareHeader".}
proc midiOutShortMsg*(x1: HMIDIOUT, x2: DWORD): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "midiOutShortMsg".}
proc midiOutLongMsg*(x1: HMIDIOUT, x2: LPMIDIHDR, x3: UINT): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "midiOutLongMsg".}
proc midiOutReset*(x1: HMIDIOUT): MMRESULT{.stdcall, dynlib: "winmm.dll",
    importc: "midiOutReset".}
proc midiOutCachePatches*(x1: HMIDIOUT, x2: UINT, x3: LPWORD, x4: UINT): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "midiOutCachePatches".}
proc midiOutCacheDrumPatches*(x1: HMIDIOUT, x2: UINT, x3: LPWORD, x4: UINT): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "midiOutCacheDrumPatches".}
proc midiOutGetID*(x1: HMIDIOUT, x2: LPUINT): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "midiOutGetID".}
proc midiOutMessage*(x1: HMIDIOUT, x2: UINT, x3: DWORD, x4: DWORD): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "midiOutMessage".}
proc midiInGetNumDevs*(): UINT{.stdcall, dynlib: "winmm.dll",
                                importc: "midiInGetNumDevs".}
proc midiInGetDevCapsA*(x1: UINT, x2: LPMIDIINCAPSA, x3: UINT): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "midiInGetDevCapsA".}
proc midiInGetDevCapsW*(x1: UINT, x2: LPMIDIINCAPSW, x3: UINT): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "midiInGetDevCapsW".}
proc midiInGetDevCaps*(x1: UINT, x2: LPMIDIINCAPS, x3: UINT): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "midiInGetDevCapsA".}
proc midiInGetErrorTextA*(x1: MMRESULT, x2: LPSTR, x3: UINT): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "midiInGetErrorTextA".}
proc midiInGetErrorTextW*(x1: MMRESULT, x2: LPWSTR, x3: UINT): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "midiInGetErrorTextW".}
proc midiInGetErrorText*(x1: MMRESULT, x2: cstring, x3: UINT): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "midiInGetErrorTextA".}
proc midiInOpen*(x1: LPHMIDIIN, x2: UINT, x3: DWORD, x4: DWORD, x5: DWORD): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "midiInOpen".}
proc midiInClose*(x1: HMIDIIN): MMRESULT{.stdcall, dynlib: "winmm.dll",
    importc: "midiInClose".}
proc midiInPrepareHeader*(x1: HMIDIIN, x2: LPMIDIHDR, x3: UINT): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "midiInPrepareHeader".}
proc midiInUnprepareHeader*(x1: HMIDIIN, x2: LPMIDIHDR, x3: UINT): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "midiInUnprepareHeader".}
proc midiInAddBuffer*(x1: HMIDIIN, x2: LPMIDIHDR, x3: UINT): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "midiInAddBuffer".}
proc midiInStart*(x1: HMIDIIN): MMRESULT{.stdcall, dynlib: "winmm.dll",
    importc: "midiInStart".}
proc midiInStop*(x1: HMIDIIN): MMRESULT{.stdcall, dynlib: "winmm.dll",
    importc: "midiInStop".}
proc midiInReset*(x1: HMIDIIN): MMRESULT{.stdcall, dynlib: "winmm.dll",
    importc: "midiInReset".}
proc midiInGetID*(x1: HMIDIIN, x2: LPUINT): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "midiInGetID".}
proc midiInMessage*(x1: HMIDIIN, x2: UINT, x3: DWORD, x4: DWORD): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "midiInMessage".}
proc mixerGetLineInfoA*(x1: HMIXEROBJ, x2: LPMIXERLINEA, x3: DWORD): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "mixerGetLineInfoA".}
proc mixerGetLineInfoW*(x1: HMIXEROBJ, x2: LPMIXERLINEW, x3: DWORD): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "mixerGetLineInfoW".}
proc mixerGetLineInfo*(x1: HMIXEROBJ, x2: LPMIXERLINE, x3: DWORD): MMRESULT{.
    stdcall, dynlib: "winmm.dll", importc: "mixerGetLineInfoA".}
proc mixerGetID*(x1: HMIXEROBJ, x2: var UINT, x3: DWORD): MMRESULT{.stdcall,
    dynlib: "winmm.dll", importc: "mixerGetID".}
proc PlaySoundA*(x1: LPCSTR, x2: HMODULE, x3: DWORD): BOOL{.stdcall,
    dynlib: "winmm.dll", importc: "PlaySoundA".}
proc PlaySoundW*(x1: LPCWSTR, x2: HMODULE, x3: DWORD): BOOL{.stdcall,
    dynlib: "winmm.dll", importc: "PlaySoundW".}
proc PlaySound*(x1: cstring, x2: HMODULE, x3: DWORD): BOOL{.stdcall,
    dynlib: "winmm.dll", importc: "PlaySoundA".}
# implementation

proc MEVT_EVENTTYPE(x: int8): int8 =
  result = (x shr 24) And 0x000000FF

proc MEVT_EVENTPARM(x: DWORD): DWORD =
  result = x And 0x00FFFFFF

type
  TFourBytes = array[0..3, int8]

proc MCI_MSF_MINUTE(msf: int32): int8 =
  result = msf and 0xff

proc MCI_TMSF_TRACK(tmsf: int32): int8 =
  result = tmsf and 0xff

proc MCI_HMS_HOUR(h: int32): int8 =
  result = h and 0xff

proc MCI_MSF_SECOND(msf: int32): int8 =
  result = msf shr 8 and 0xff

proc MCI_TMSF_MINUTE(tmsf: int32): int8 =
  result = tmsf shr 8 and 0xff

proc MCI_HMS_MINUTE(h: int32): int8 =
  result = h shr 8 and 0xff

proc MCI_MSF_FRAME(msf: int32): int8 =
  result = msf shr 16 and 0xff

proc MCI_TMSF_SECOND(tmsf: int32): int8 =
  result = tmsf shr 16 and 0xff

proc MCI_HMS_SECOND(h: int32): int8 =
  result = h shr 16 and 0xff

proc MCI_MAKE_MSF(m, s, f: int8): int32 =
  result = m or s shl 8 or f shl 16

proc MCI_MAKE_HMS(h, m, s: int8): int32 =
  result = h or m shl 8 or s shl 16

proc MCI_TMSF_FRAME(tmsf: int32): int8 =
  result = tmsf shr 24 and 0xff

proc mci_Make_TMSF(t, m, s, f: int8): int32 =
  result = t or m shl 8 or s shl 16 or f shl 24

proc DIBINDEX(n: int32): int32 =
  result = n Or 0x000010FF shl 16