[1046] | 1 | /*author: Adrian Sandor
|
---|
| 2 | written for MinGW*/
|
---|
| 3 | #ifndef _MSACM_H
|
---|
| 4 | #define _MSACM_H
|
---|
| 5 |
|
---|
| 6 | #if __GNUC__ >= 3
|
---|
| 7 | #pragma GCC system_header
|
---|
| 8 | #endif
|
---|
| 9 |
|
---|
| 10 | #ifdef __cplusplus
|
---|
| 11 | extern "C" {
|
---|
| 12 | #endif
|
---|
| 13 |
|
---|
| 14 | DECLARE_HANDLE(HACMDRIVERID);
|
---|
| 15 | typedef HACMDRIVERID *PHACMDRIVERID;
|
---|
| 16 | typedef HACMDRIVERID *LPHACMDRIVERID;
|
---|
| 17 | DECLARE_HANDLE(HACMDRIVER);
|
---|
| 18 | typedef HACMDRIVER *PHACMDRIVER;
|
---|
| 19 | typedef HACMDRIVER *LPHACMDRIVER;
|
---|
| 20 | DECLARE_HANDLE(HACMSTREAM);
|
---|
| 21 | typedef HACMSTREAM *PHACMSTREAM;
|
---|
| 22 | typedef HACMSTREAM *LPHACMSTREAM;
|
---|
| 23 | DECLARE_HANDLE(HACMOBJ);
|
---|
| 24 | typedef HACMOBJ *PHACMOBJ;
|
---|
| 25 | typedef HACMOBJ *LPHACMOBJ;
|
---|
| 26 |
|
---|
| 27 | /*found through experimentation*/
|
---|
| 28 | #define ACMDRIVERDETAILS_SHORTNAME_CHARS 32
|
---|
| 29 | #define ACMDRIVERDETAILS_LONGNAME_CHARS 128
|
---|
| 30 | #define ACMDRIVERDETAILS_COPYRIGHT_CHARS 80
|
---|
| 31 | #define ACMDRIVERDETAILS_LICENSING_CHARS 128
|
---|
| 32 |
|
---|
| 33 | /*I don't know the right values for these macros*/
|
---|
| 34 | #define ACMFORMATDETAILS_FORMAT_CHARS 256
|
---|
| 35 | #define ACMFORMATTAGDETAILS_FORMATTAG_CHARS 256
|
---|
| 36 | #define ACMDRIVERDETAILS_FEATURES_CHARS 256
|
---|
| 37 |
|
---|
| 38 | /*msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_acmformatdetails_str.asp*/
|
---|
| 39 | typedef struct {
|
---|
| 40 | DWORD cbStruct;
|
---|
| 41 | DWORD dwFormatIndex;
|
---|
| 42 | DWORD dwFormatTag;
|
---|
| 43 | DWORD fdwSupport;
|
---|
| 44 | LPWAVEFORMATEX pwfx;
|
---|
| 45 | DWORD cbwfx;
|
---|
| 46 | char szFormat[ACMFORMATDETAILS_FORMAT_CHARS];
|
---|
| 47 | } ACMFORMATDETAILSA, *LPACMFORMATDETAILSA;
|
---|
| 48 | typedef struct {
|
---|
| 49 | DWORD cbStruct;
|
---|
| 50 | DWORD dwFormatIndex;
|
---|
| 51 | DWORD dwFormatTag;
|
---|
| 52 | DWORD fdwSupport;
|
---|
| 53 | LPWAVEFORMATEX pwfx;
|
---|
| 54 | DWORD cbwfx;
|
---|
| 55 | WCHAR szFormat[ACMFORMATDETAILS_FORMAT_CHARS];
|
---|
| 56 | } ACMFORMATDETAILSW, *LPACMFORMATDETAILSW;
|
---|
| 57 |
|
---|
| 58 | /*msdn.microsoft.com/en-us/library/dd742926%28VS.85%29.aspx*/
|
---|
| 59 | typedef struct {
|
---|
| 60 | DWORD cbStruct;
|
---|
| 61 | DWORD fdwStatus;
|
---|
| 62 | DWORD_PTR dwUser;
|
---|
| 63 | LPBYTE pbSrc;
|
---|
| 64 | DWORD cbSrcLength;
|
---|
| 65 | DWORD cbSrcLengthUsed;
|
---|
| 66 | DWORD_PTR dwSrcUser;
|
---|
| 67 | LPBYTE pbDst;
|
---|
| 68 | DWORD cbDstLength;
|
---|
| 69 | DWORD cbDstLengthUsed;
|
---|
| 70 | DWORD_PTR dwDstUser;
|
---|
| 71 | DWORD dwReservedDriver[10];
|
---|
| 72 | } ACMSTREAMHEADER, *LPACMSTREAMHEADER;
|
---|
| 73 |
|
---|
| 74 | /*msdn.microsoft.com/en-us/library/dd757711%28v=VS.85%29.aspx*/
|
---|
| 75 | typedef struct {
|
---|
| 76 | DWORD cbStruct;
|
---|
| 77 | DWORD dwFilterTag;
|
---|
| 78 | DWORD fdwFilter;
|
---|
| 79 | DWORD dwReserved[5];
|
---|
| 80 | } WAVEFILTER, *LPWAVEFILTER;
|
---|
| 81 |
|
---|
| 82 | /*msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_acmformattagdetails_str.asp*/
|
---|
| 83 | typedef struct {
|
---|
| 84 | DWORD cbStruct;
|
---|
| 85 | DWORD dwFormatTagIndex;
|
---|
| 86 | DWORD dwFormatTag;
|
---|
| 87 | DWORD cbFormatSize;
|
---|
| 88 | DWORD fdwSupport;
|
---|
| 89 | DWORD cStandardFormats;
|
---|
| 90 | char szFormatTag[ACMFORMATTAGDETAILS_FORMATTAG_CHARS];
|
---|
| 91 | } ACMFORMATTAGDETAILSA, *LPACMFORMATTAGDETAILSA;
|
---|
| 92 | typedef struct {
|
---|
| 93 | DWORD cbStruct;
|
---|
| 94 | DWORD dwFormatTagIndex;
|
---|
| 95 | DWORD dwFormatTag;
|
---|
| 96 | DWORD cbFormatSize;
|
---|
| 97 | DWORD fdwSupport;
|
---|
| 98 | DWORD cStandardFormats;
|
---|
| 99 | WCHAR szFormatTag[ACMFORMATTAGDETAILS_FORMATTAG_CHARS];
|
---|
| 100 | } ACMFORMATTAGDETAILSW, *LPACMFORMATTAGDETAILSW;
|
---|
| 101 |
|
---|
| 102 | /*msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_acmdriverdetails_str.asp*/
|
---|
| 103 | typedef struct {
|
---|
| 104 | DWORD cbStruct;
|
---|
| 105 | FOURCC fccType;
|
---|
| 106 | FOURCC fccComp;
|
---|
| 107 | WORD wMid;
|
---|
| 108 | WORD wPid;
|
---|
| 109 | DWORD vdwACM;
|
---|
| 110 | DWORD vdwDriver;
|
---|
| 111 | DWORD fdwSupport;
|
---|
| 112 | DWORD cFormatTags;
|
---|
| 113 | DWORD cFilterTags;
|
---|
| 114 | HICON hicon;
|
---|
| 115 | char szShortName[ACMDRIVERDETAILS_SHORTNAME_CHARS];
|
---|
| 116 | char szLongName[ACMDRIVERDETAILS_LONGNAME_CHARS];
|
---|
| 117 | char szCopyright[ACMDRIVERDETAILS_COPYRIGHT_CHARS];
|
---|
| 118 | char szLicensing[ACMDRIVERDETAILS_LICENSING_CHARS];
|
---|
| 119 | char szFeatures[ACMDRIVERDETAILS_FEATURES_CHARS];
|
---|
| 120 | } ACMDRIVERDETAILSA, *LPACMDRIVERDETAILSA;
|
---|
| 121 | typedef struct {
|
---|
| 122 | DWORD cbStruct;
|
---|
| 123 | FOURCC fccType;
|
---|
| 124 | FOURCC fccComp;
|
---|
| 125 | WORD wMid;
|
---|
| 126 | WORD wPid;
|
---|
| 127 | DWORD vdwACM;
|
---|
| 128 | DWORD vdwDriver;
|
---|
| 129 | DWORD fdwSupport;
|
---|
| 130 | DWORD cFormatTags;
|
---|
| 131 | DWORD cFilterTags;
|
---|
| 132 | HICON hicon;
|
---|
| 133 | WCHAR szShortName[ACMDRIVERDETAILS_SHORTNAME_CHARS];
|
---|
| 134 | WCHAR szLongName[ACMDRIVERDETAILS_LONGNAME_CHARS];
|
---|
| 135 | WCHAR szCopyright[ACMDRIVERDETAILS_COPYRIGHT_CHARS];
|
---|
| 136 | WCHAR szLicensing[ACMDRIVERDETAILS_LICENSING_CHARS];
|
---|
| 137 | WCHAR szFeatures[ACMDRIVERDETAILS_FEATURES_CHARS];
|
---|
| 138 | } ACMDRIVERDETAILSW, *LPACMDRIVERDETAILSW;
|
---|
| 139 |
|
---|
| 140 | /*msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_acmformatenumcallback.asp*/
|
---|
| 141 | typedef BOOL (CALLBACK *ACMFORMATENUMCBA) (
|
---|
| 142 | HACMDRIVERID hadid,
|
---|
| 143 | LPACMFORMATDETAILSA pafd,
|
---|
| 144 | DWORD_PTR dwInstance,
|
---|
| 145 | DWORD fdwSupport
|
---|
| 146 | );
|
---|
| 147 | typedef BOOL (CALLBACK *ACMFORMATENUMCBW) (
|
---|
| 148 | HACMDRIVERID hadid,
|
---|
| 149 | LPACMFORMATDETAILSW pafd,
|
---|
| 150 | DWORD_PTR dwInstance,
|
---|
| 151 | DWORD fdwSupport
|
---|
| 152 | );
|
---|
| 153 |
|
---|
| 154 | /*msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_acmformattagenumcallback.asp*/
|
---|
| 155 | typedef BOOL (CALLBACK *ACMFORMATTAGENUMCBA) (
|
---|
| 156 | HACMDRIVERID hadid,
|
---|
| 157 | LPACMFORMATTAGDETAILSA paftd,
|
---|
| 158 | DWORD_PTR dwInstance,
|
---|
| 159 | DWORD fdwSupport
|
---|
| 160 | );
|
---|
| 161 | typedef BOOL (CALLBACK *ACMFORMATTAGENUMCBW) (
|
---|
| 162 | HACMDRIVERID hadid,
|
---|
| 163 | LPACMFORMATTAGDETAILSW paftd,
|
---|
| 164 | DWORD_PTR dwInstance,
|
---|
| 165 | DWORD fdwSupport
|
---|
| 166 | );
|
---|
| 167 |
|
---|
| 168 | /*msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_acmdriverenumcallback.asp*/
|
---|
| 169 | typedef BOOL (CALLBACK *ACMDRIVERENUMCB) (
|
---|
| 170 | HACMDRIVERID hadid,
|
---|
| 171 | DWORD_PTR dwInstance,
|
---|
| 172 | DWORD fdwSupport
|
---|
| 173 | );
|
---|
| 174 |
|
---|
| 175 | /*and now the functions...*/
|
---|
| 176 |
|
---|
| 177 | /*msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_acmdriveropen.asp*/
|
---|
| 178 | MMRESULT WINAPI acmDriverOpen(LPHACMDRIVER phad, HACMDRIVERID hadid, DWORD fdwOpen);
|
---|
| 179 | /*msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_acmdriverenum.asp*/
|
---|
| 180 | MMRESULT WINAPI acmDriverEnum(ACMDRIVERENUMCB fnCallback, DWORD_PTR dwInstance, DWORD fdwEnum);
|
---|
| 181 | /*msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_acmformatenum.asp*/
|
---|
| 182 | MMRESULT WINAPI acmFormatEnumA(HACMDRIVER had, LPACMFORMATDETAILSA pafd, ACMFORMATENUMCBA fnCallback, DWORD_PTR dwInstance, DWORD fdwEnum);
|
---|
| 183 | MMRESULT WINAPI acmFormatEnumW(HACMDRIVER had, LPACMFORMATDETAILSW pafd, ACMFORMATENUMCBW fnCallback, DWORD_PTR dwInstance, DWORD fdwEnum);
|
---|
| 184 |
|
---|
| 185 | /*msdn.microsoft.com/en-us/library/dd742885%28VS.85%29.aspx*/
|
---|
| 186 | MMRESULT WINAPI acmDriverAddA(LPHACMDRIVERID phadid, HINSTANCE hinstModule, LPARAM lParam, DWORD dwPriority, DWORD fdwAdd);
|
---|
| 187 | MMRESULT WINAPI acmDriverAddW(LPHACMDRIVERID phadid, HINSTANCE hinstModule, LPARAM lParam, DWORD dwPriority, DWORD fdwAdd);
|
---|
| 188 |
|
---|
| 189 | /*msdn.microsoft.com/en-us/library/dd742897%28v=VS.85%29.aspx*/
|
---|
| 190 | MMRESULT WINAPI acmDriverRemove(HACMDRIVERID hadid, DWORD fdwRemove);
|
---|
| 191 |
|
---|
| 192 | /*msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_acmdriverclose.asp*/
|
---|
| 193 | MMRESULT WINAPI acmDriverClose(HACMDRIVER had, DWORD fdwClose);
|
---|
| 194 | /*msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_acmdriverdetails.asp*/
|
---|
| 195 | MMRESULT WINAPI acmDriverDetailsA(HACMDRIVERID hadid, LPACMDRIVERDETAILSA padd, DWORD fdwDetails);
|
---|
| 196 | MMRESULT WINAPI acmDriverDetailsW(HACMDRIVERID hadid, LPACMDRIVERDETAILSW padd, DWORD fdwDetails);
|
---|
| 197 | /*msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_acmformattagenum.asp*/
|
---|
| 198 | MMRESULT WINAPI acmFormatTagEnumA(HACMDRIVER had, LPACMFORMATTAGDETAILSA paftd, ACMFORMATTAGENUMCBA fnCallback, DWORD_PTR dwInstance, DWORD fdwEnum);
|
---|
| 199 | MMRESULT WINAPI acmFormatTagEnumW(HACMDRIVER had, LPACMFORMATTAGDETAILSW paftd, ACMFORMATTAGENUMCBW fnCallback, DWORD_PTR dwInstance, DWORD fdwEnum);
|
---|
| 200 |
|
---|
| 201 | /*msdn.microsoft.com/en-us/library/dd742922(VS.85).aspx*/
|
---|
| 202 | MMRESULT WINAPI acmMetrics(HACMOBJ hao, UINT uMetric, LPVOID pMetric);
|
---|
| 203 |
|
---|
| 204 | /*msdn.microsoft.com/en-us/library/dd742928%28VS.85%29.aspx*/
|
---|
| 205 | MMRESULT WINAPI acmStreamOpen(LPHACMSTREAM phas, HACMDRIVER had, LPWAVEFORMATEX pwfxSrc, LPWAVEFORMATEX pwfxDst, LPWAVEFILTER pwfltr, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen);
|
---|
| 206 |
|
---|
| 207 | /*msdn.microsoft.com/en-us/library/dd742931%28VS.85%29.aspx*/
|
---|
| 208 | MMRESULT WINAPI acmStreamSize(HACMSTREAM has, DWORD cbInput, LPDWORD pdwOutputBytes, DWORD fdwSize);
|
---|
| 209 |
|
---|
| 210 | /*msdn.microsoft.com/en-us/library/dd742929%28VS.85%29.aspx*/
|
---|
| 211 | MMRESULT WINAPI acmStreamPrepareHeader(HACMSTREAM has, LPACMSTREAMHEADER pash, DWORD fdwPrepare);
|
---|
| 212 |
|
---|
| 213 | /*msdn.microsoft.com/en-us/library/dd742932%28VS.85%29.aspx*/
|
---|
| 214 | MMRESULT WINAPI acmStreamUnprepareHeader(HACMSTREAM has, LPACMSTREAMHEADER pash, DWORD fdwUnprepare);
|
---|
| 215 |
|
---|
| 216 | /*msdn.microsoft.com/en-us/library/dd742930%28VS.85%29.aspx*/
|
---|
| 217 | MMRESULT WINAPI acmStreamReset(HACMSTREAM has, DWORD fdwReset);
|
---|
| 218 |
|
---|
| 219 | /*msdn.microsoft.com/en-us/library/dd742923%28VS.85%29.aspx*/
|
---|
| 220 | MMRESULT WINAPI acmStreamClose(HACMSTREAM has, DWORD fdwClose);
|
---|
| 221 |
|
---|
| 222 | /*msdn.microsoft.com/en-us/library/dd742924%28VS.85%29.aspx*/
|
---|
| 223 | MMRESULT WINAPI acmStreamConvert(HACMSTREAM has, LPACMSTREAMHEADER pash, DWORD fdwConvert);
|
---|
| 224 |
|
---|
| 225 | #ifdef UNICODE
|
---|
| 226 |
|
---|
| 227 | typedef ACMFORMATDETAILSW ACMFORMATDETAILS, *LPACMFORMATDETAILS;
|
---|
| 228 | typedef ACMFORMATTAGDETAILSW ACMFORMATTAGDETAILS, *LPACMFORMATTAGDETAILS;
|
---|
| 229 | typedef ACMDRIVERDETAILSW ACMDRIVERDETAILS, *LPACMDRIVERDETAILS;
|
---|
| 230 | typedef ACMFORMATENUMCBW ACMFORMATENUMCB;
|
---|
| 231 | typedef ACMFORMATTAGENUMCBW ACMFORMATTAGENUMCB;
|
---|
| 232 | #define acmFormatEnum acmFormatEnumW
|
---|
| 233 | #define acmDriverDetails acmDriverDetailsW
|
---|
| 234 | #define acmFormatTagEnum acmFormatTagEnumW
|
---|
| 235 | #define acmDriverAdd acmDriverAddW
|
---|
| 236 |
|
---|
| 237 | #else /*ifdef UNICODE*/
|
---|
| 238 |
|
---|
| 239 | typedef ACMFORMATDETAILSA ACMFORMATDETAILS, *LPACMFORMATDETAILS;
|
---|
| 240 | typedef ACMFORMATTAGDETAILSA ACMFORMATTAGDETAILS, *LPACMFORMATTAGDETAILS;
|
---|
| 241 | typedef ACMDRIVERDETAILSA ACMDRIVERDETAILS, *LPACMDRIVERDETAILS;
|
---|
| 242 | typedef ACMFORMATENUMCBA ACMFORMATENUMCB;
|
---|
| 243 | typedef ACMFORMATTAGENUMCBA ACMFORMATTAGENUMCB;
|
---|
| 244 | #define acmFormatEnum acmFormatEnumA
|
---|
| 245 | #define acmDriverDetails acmDriverDetailsA
|
---|
| 246 | #define acmFormatTagEnum acmFormatTagEnumA
|
---|
| 247 | #define acmDriverAdd acmDriverAddA
|
---|
| 248 |
|
---|
| 249 | #endif /*ifdef UNICODE*/
|
---|
| 250 |
|
---|
| 251 | #ifdef __cplusplus
|
---|
| 252 | }
|
---|
| 253 | #endif
|
---|
| 254 |
|
---|
| 255 | #endif
|
---|