1 /***********************************************************************\
2 *                                msacm.d                                *
3 *                                                                       *
4 *                       Windows API header module                       *
5 *                                                                       *
6 *                 Translated from MinGW Windows headers                 *
7 *                           by Stewart Gordon                           *
8 *                                                                       *
9 *                       Placed into public domain                       *
10 \***********************************************************************/
11 module win32.msacm;
12 
13 private import win32.basetsd, win32.mmsystem, win32.windef;
14 
15 alias HANDLE HACMDRIVERID, HACMDRIVER;
16 alias HANDLE* LPHACMDRIVER;
17 
18 /* Comment from MinGW
19 	found through experimentation
20  */
21 const size_t
22 	ACMDRIVERDETAILS_SHORTNAME_CHARS =  32,
23 	ACMDRIVERDETAILS_LONGNAME_CHARS  = 128,
24 	ACMDRIVERDETAILS_COPYRIGHT_CHARS =  80,
25 	ACMDRIVERDETAILS_LICENSING_CHARS = 128;
26 
27 /* Comment from MinGW
28 	I don't know the right values for these macros
29  */
30 const size_t
31 	ACMFORMATDETAILS_FORMAT_CHARS       = 256,
32 	ACMFORMATTAGDETAILS_FORMATTAG_CHARS = 256,
33 	ACMDRIVERDETAILS_FEATURES_CHARS     = 256;
34 
35 struct ACMFORMATDETAILSA {
36 	DWORD          cbStruct = ACMFORMATDETAILSA.sizeof;  // are they?
37 	DWORD          dwFormatIndex;
38 	DWORD          dwFormatTag;
39 	DWORD          fdwSupport;
40 	LPWAVEFORMATEX pwfx;
41 	DWORD          cbwfx;
42 	char[ACMFORMATDETAILS_FORMAT_CHARS] szFormat;
43 }
44 alias ACMFORMATDETAILSA* LPACMFORMATDETAILSA;
45 
46 struct ACMFORMATDETAILSW {
47 	DWORD          cbStruct = ACMFORMATDETAILSW.sizeof;
48 	DWORD          dwFormatIndex;
49 	DWORD          dwFormatTag;
50 	DWORD          fdwSupport;
51 	LPWAVEFORMATEX pwfx;
52 	DWORD          cbwfx;
53 	WCHAR[ACMFORMATDETAILS_FORMAT_CHARS] szFormat;
54 }
55 alias ACMFORMATDETAILSW* LPACMFORMATDETAILSW;
56 
57 struct ACMFORMATTAGDETAILSA {
58 	DWORD cbStruct = ACMFORMATTAGDETAILSA.sizeof;
59 	DWORD dwFormatTagIndex;
60 	DWORD dwFormatTag;
61 	DWORD cbFormatSize;
62 	DWORD fdwSupport;
63 	DWORD cStandardFormats;
64 	char[ACMFORMATTAGDETAILS_FORMATTAG_CHARS] szFormatTag;
65 }
66 alias ACMFORMATTAGDETAILSA* LPACMFORMATTAGDETAILSA;
67 
68 struct ACMFORMATTAGDETAILSW {
69 	DWORD cbStruct = ACMFORMATTAGDETAILSW.sizeof;
70 	DWORD dwFormatTagIndex;
71 	DWORD dwFormatTag;
72 	DWORD cbFormatSize;
73 	DWORD fdwSupport;
74 	DWORD cStandardFormats;
75 	WCHAR[ACMFORMATTAGDETAILS_FORMATTAG_CHARS] szFormatTag;
76 }
77 alias ACMFORMATTAGDETAILSW* LPACMFORMATTAGDETAILSW;
78 
79 struct ACMDRIVERDETAILSA {
80 	DWORD  cbStruct = ACMDRIVERDETAILSA.sizeof;
81 	FOURCC fccType;
82 	FOURCC fccComp;
83 	WORD   wMid;
84 	WORD   wPid;
85 	DWORD  vdwACM;
86 	DWORD  vdwDriver;
87 	DWORD  fdwSupport;
88 	DWORD  cFormatTags;
89 	DWORD  cFilterTags;
90 	HICON  hicon;
91 	char[ACMDRIVERDETAILS_SHORTNAME_CHARS] szShortName;
92 	char[ACMDRIVERDETAILS_LONGNAME_CHARS]  szLongName;
93 	char[ACMDRIVERDETAILS_COPYRIGHT_CHARS] szCopyright;
94 	char[ACMDRIVERDETAILS_LICENSING_CHARS] szLicensing;
95 	char[ACMDRIVERDETAILS_FEATURES_CHARS]  szFeatures;
96 }
97 alias ACMDRIVERDETAILSA* LPACMDRIVERDETAILSA;
98 
99 struct ACMDRIVERDETAILSW {
100 	DWORD  cbStruct = ACMDRIVERDETAILSW.sizeof;
101 	FOURCC fccType;
102 	FOURCC fccComp;
103 	WORD   wMid;
104 	WORD   wPid;
105 	DWORD  vdwACM;
106 	DWORD  vdwDriver;
107 	DWORD  fdwSupport;
108 	DWORD  cFormatTags;
109 	DWORD  cFilterTags;
110 	HICON  hicon;
111 	WCHAR[ACMDRIVERDETAILS_SHORTNAME_CHARS] szShortName;
112 	WCHAR[ACMDRIVERDETAILS_LONGNAME_CHARS]  szLongName;
113 	WCHAR[ACMDRIVERDETAILS_COPYRIGHT_CHARS] szCopyright;
114 	WCHAR[ACMDRIVERDETAILS_LICENSING_CHARS] szLicensing;
115 	WCHAR[ACMDRIVERDETAILS_FEATURES_CHARS]  szFeatures;
116 }
117 alias ACMDRIVERDETAILSW* LPACMDRIVERDETAILSW;
118 
119 extern (Windows) {
120 	alias BOOL function(HACMDRIVERID hadid, LPACMFORMATDETAILSA pafd,
121 	  DWORD_PTR dwInstance, DWORD fdwSupport) ACMFORMATENUMCBA;
122 	alias BOOL function(HACMDRIVERID hadid, LPACMFORMATDETAILSW pafd,
123 	  DWORD_PTR dwInstance, DWORD fdwSupport) ACMFORMATENUMCBW;
124 	alias BOOL function(HACMDRIVERID hadid, LPACMFORMATTAGDETAILSA paftd,
125 	  DWORD_PTR dwInstance, DWORD fdwSupport) ACMFORMATTAGENUMCBA;
126 	alias BOOL function(HACMDRIVERID hadid, LPACMFORMATTAGDETAILSW paftd,
127 	  DWORD_PTR dwInstance, DWORD fdwSupport) ACMFORMATTAGENUMCBW;
128 	alias BOOL function(HACMDRIVERID hadid, DWORD_PTR dwInstance,
129 	  DWORD fdwSupport) ACMDRIVERENUMCB;
130 
131 	MMRESULT acmDriverOpen(LPHACMDRIVER phad, HACMDRIVERID hadid,
132 	  DWORD fdwOpen);
133 	MMRESULT acmDriverEnum(ACMDRIVERENUMCB fnCallback, DWORD_PTR dwInstance,
134 	  DWORD fdwEnum);
135 	MMRESULT acmFormatEnumA(HACMDRIVER had, LPACMFORMATDETAILSA pafd,
136 	  ACMFORMATENUMCBA fnCallback, DWORD_PTR dwInstance, DWORD fdwEnum);
137 	MMRESULT acmFormatEnumW(HACMDRIVER had, LPACMFORMATDETAILSW pafd,
138 	  ACMFORMATENUMCBW fnCallback, DWORD_PTR dwInstance, DWORD fdwEnum);
139 	MMRESULT acmDriverClose(HACMDRIVER had, DWORD fdwClose);
140 	MMRESULT acmDriverDetailsA(HACMDRIVERID hadid, LPACMDRIVERDETAILSA padd,
141 	  DWORD fdwDetails);
142 	MMRESULT acmDriverDetailsW(HACMDRIVERID hadid, LPACMDRIVERDETAILSW padd,
143 	  DWORD fdwDetails);
144 	MMRESULT acmFormatTagEnumA(HACMDRIVER had, LPACMFORMATTAGDETAILSA paftd,
145 	  ACMFORMATTAGENUMCBA fnCallback, DWORD_PTR dwInstance, DWORD fdwEnum);
146 	MMRESULT acmFormatTagEnumW(HACMDRIVER had, LPACMFORMATTAGDETAILSW paftd,
147 	  ACMFORMATTAGENUMCBW fnCallback, DWORD_PTR dwInstance, DWORD fdwEnum);
148 }
149 
150 version (Unicode) {
151 	alias ACMFORMATDETAILSW ACMFORMATDETAILS;
152 	alias ACMFORMATTAGDETAILSW ACMFORMATTAGDETAILS;
153 	alias ACMDRIVERDETAILSW ACMDRIVERDETAILS;
154 	alias ACMFORMATENUMCBW ACMFORMATENUMCB;
155 	alias ACMFORMATTAGENUMCBW ACMFORMATTAGENUMCB;
156 	alias acmFormatEnumW acmFormatEnum;
157 	alias acmDriverDetailsW acmDriverDetails;
158 	alias acmFormatTagEnumW acmFormatTagEnum;
159 } else {
160 	alias ACMFORMATDETAILSA ACMFORMATDETAILS;
161 	alias ACMFORMATTAGDETAILSA ACMFORMATTAGDETAILS;
162 	alias ACMDRIVERDETAILSA ACMDRIVERDETAILS;
163 	alias ACMFORMATENUMCBA ACMFORMATENUMCB;
164 	alias ACMFORMATTAGENUMCBA ACMFORMATTAGENUMCB;
165 	alias acmFormatEnumA acmFormatEnum;
166 	alias acmDriverDetailsA acmDriverDetails;
167 	alias acmFormatTagEnumA acmFormatTagEnum;
168 }
169 
170 alias ACMFORMATDETAILS* LPACMFORMATDETAILS;
171 alias ACMFORMATTAGDETAILS* LPACMFORMATTAGDETAILS;
172 alias ACMDRIVERDETAILS* LPACMDRIVERDETAILS;