Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

749 lines
23 KiB

  1. //==========================================================================;
  2. //
  3. // msacmmap.h
  4. //
  5. // Copyright (c) 1992-1999 Microsoft Corporation
  6. //
  7. // Description:
  8. //
  9. //
  10. // History:
  11. // 8/ 2/93 cjp [curtisp]
  12. //
  13. //==========================================================================;
  14. #ifndef _INC_MSACMMAP
  15. #define _INC_MSACMMAP // #defined if msacmmap.h has been included
  16. #ifndef RC_INVOKED
  17. #pragma pack(1) // assume byte packing throughout
  18. #endif // RC_INVOKED
  19. #ifndef EXTERN_C
  20. #ifdef __cplusplus
  21. #define EXTERN_C extern "C"
  22. #else
  23. #define EXTERN_C extern
  24. #endif
  25. #endif
  26. #ifdef __cplusplus
  27. extern "C" // assume C declarations for C++
  28. {
  29. #endif // __cplusplus
  30. #ifndef MMVERSION
  31. #include <verinfo.h>
  32. #endif
  33. #define VERSION_MSACMMAP_MAJOR MMVERSION
  34. #define VERSION_MSACMMAP_MINOR MMREVISION
  35. #define VERSION_MSACMMAP ((VERSION_MSACMMAP_MAJOR << 8) | VERSION_MSACMMAP_MINOR)
  36. //
  37. //
  38. //
  39. #ifndef SIZEOF_WAVEFORMATEX
  40. #define SIZEOF_WAVEFORMATEX(pwfx) ((WAVE_FORMAT_PCM==(pwfx)->wFormatTag)?sizeof(PCMWAVEFORMAT):(sizeof(WAVEFORMATEX)+(pwfx)->cbSize))
  41. #endif
  42. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  43. //
  44. // Win 16/32 portability stuff...
  45. //
  46. //
  47. //
  48. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  49. #ifndef RC_INVOKED
  50. #ifdef WIN32
  51. #ifndef FNLOCAL
  52. #define FNLOCAL _stdcall
  53. #define FNCLOCAL _stdcall
  54. #define FNGLOBAL _stdcall
  55. #define FNCGLOBAL _stdcall
  56. #define FNCALLBACK CALLBACK
  57. #define FNEXPORT CALLBACK
  58. #endif
  59. //
  60. // there is no reason to have based stuff in win 32
  61. //
  62. #define BCODE
  63. #define BDATA
  64. #define BSTACK
  65. #define HUGE
  66. #define HTASK HANDLE
  67. #define SELECTOROF(a) (a)
  68. //
  69. //
  70. //
  71. #define Edit_GetSelEx(hwndCtl, pnS, pnE) \
  72. ((DWORD)SendMessage((hwndCtl), EM_GETSEL, (WPARAM)pnS, (LPARAM)pnE))
  73. //
  74. // for compiling Unicode
  75. //
  76. #ifdef UNICODE
  77. #define SIZEOF(x) (sizeof(x)/sizeof(WCHAR))
  78. #define DEVFMT_STR "%ls"
  79. #else
  80. #define SIZEOF(x) sizeof(x)
  81. #define DEVFMT_STR "%s"
  82. #endif
  83. #define GetCurrentTask (HTASK)GetCurrentThreadId
  84. #endif // #ifdef WIN32
  85. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  86. //
  87. // Win 16
  88. //
  89. //
  90. //
  91. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  92. #ifndef WIN32
  93. #ifndef FNLOCAL
  94. #define FNLOCAL NEAR PASCAL
  95. #define FNCLOCAL NEAR _cdecl
  96. #define FNGLOBAL FAR PASCAL
  97. #define FNCGLOBAL FAR _cdecl
  98. #ifdef _WINDLL
  99. #define FNCALLBACK FAR PASCAL _loadds
  100. #define FNEXPORT FAR PASCAL _loadds _export
  101. #else
  102. #define FNCALLBACK FAR PASCAL
  103. #define FNEXPORT FAR PASCAL _export
  104. #endif
  105. #endif
  106. //
  107. // based code makes since only in win 16 (to try and keep stuff out of
  108. // our fixed data segment...
  109. //
  110. #define BCODE _based(_segname("_CODE"))
  111. #define BDATA _based(_segname("_DATA"))
  112. #define BSTACK _based(_segname("_STACK"))
  113. #define HUGE _huge
  114. //
  115. //
  116. //
  117. //
  118. #ifndef FIELD_OFFSET
  119. #define FIELD_OFFSET(type, field) ((LONG)&(((type *)0)->field))
  120. #endif
  121. //
  122. // stuff for Unicode in Win 32--make it a noop in Win 16
  123. //
  124. #ifndef _TCHAR_DEFINED
  125. #define _TCHAR_DEFINED
  126. typedef char TCHAR, *PTCHAR;
  127. typedef unsigned char TBYTE, *PTUCHAR;
  128. typedef PSTR PTSTR, PTCH;
  129. typedef const PTSTR PCTSTR;
  130. typedef LPSTR LPTSTR, LPTCH;
  131. typedef LPCSTR LPCTSTR;
  132. #endif
  133. #define TEXT(a) a
  134. #define SIZEOF(x) sizeof(x)
  135. #define DEVFMT_STR "%s"
  136. //
  137. //
  138. //
  139. #define CharNext AnsiNext
  140. #define CharPrev AnsiPrev
  141. //
  142. //
  143. //
  144. #define Edit_GetSelEx(hwndCtl, pnS, pnE) \
  145. { \
  146. DWORD dw; \
  147. dw = (DWORD)SendMessage((hwndCtl), EM_GETSEL, 0, 0L); \
  148. *pnE = (int)HIWORD(dw); \
  149. *pnS = (int)LOWORD(dw); \
  150. }
  151. //
  152. // common message cracker macros available in windowx.h on NT--these
  153. // should be added to the Win 16 windowsx.h and probably will be
  154. // in the future.
  155. //
  156. // there is a windowsx.h16 that ships with the NT PDK that defines
  157. // these macros. so if that version is being used, don't redefine
  158. // message crackers.
  159. //
  160. #ifndef WM_CTLCOLORMSGBOX
  161. #define WM_CTLCOLORMSGBOX 0x0132
  162. #define WM_CTLCOLOREDIT 0x0133
  163. #define WM_CTLCOLORLISTBOX 0x0134
  164. #define WM_CTLCOLORBTN 0x0135
  165. #define WM_CTLCOLORDLG 0x0136
  166. #define WM_CTLCOLORSCROLLBAR 0x0137
  167. #define WM_CTLCOLORSTATIC 0x0138
  168. #endif
  169. #ifndef GET_WM_ACTIVATE_STATE
  170. #define GET_WM_ACTIVATE_STATE(wp, lp) (wp)
  171. #define GET_WM_ACTIVATE_FMINIMIZED(wp, lp) (BOOL)HIWORD(lp)
  172. #define GET_WM_ACTIVATE_HWND(wp, lp) (HWND)LOWORD(lp)
  173. #define GET_WM_ACTIVATE_MPS(s, fmin, hwnd) (WPARAM)(s), MAKELONG(hwnd, fmin)
  174. #define GET_WM_CHARTOITEM_CHAR(wp, lp) (CHAR)(wp)
  175. #define GET_WM_CHARTOITEM_POS(wp, lp) HIWORD(lp)
  176. #define GET_WM_CHARTOITEM_HWND(wp, lp) (HWND)LOWORD(lp)
  177. #define GET_WM_CHARTOITEM_MPS(ch, pos, hwnd) (WPARAM)(ch), MAKELONG(hwnd, pos)
  178. #define GET_WM_COMMAND_ID(wp, lp) (wp)
  179. #define GET_WM_COMMAND_HWND(wp, lp) (HWND)LOWORD(lp)
  180. #define GET_WM_COMMAND_CMD(wp, lp) HIWORD(lp)
  181. #define GET_WM_COMMAND_MPS(id, hwnd, cmd) (WPARAM)(id), MAKELONG(hwnd, cmd)
  182. #define GET_WM_CTLCOLOR_HDC(wp, lp, msg) (HDC)(wp)
  183. #define GET_WM_CTLCOLOR_HWND(wp, lp, msg) (HWND)LOWORD(lp)
  184. #define GET_WM_CTLCOLOR_TYPE(wp, lp, msg) HIWORD(lp)
  185. #define GET_WM_CTLCOLOR_MPS(hdc, hwnd, type) (WPARAM)(hdc), MAKELONG(hwnd, type)
  186. #define GET_WM_MENUSELECT_CMD(wp, lp) (wp)
  187. #define GET_WM_MENUSELECT_FLAGS(wp, lp) LOWORD(lp)
  188. #define GET_WM_MENUSELECT_HMENU(wp, lp) (HMENU)HIWORD(lp)
  189. #define GET_WM_MENUSELECT_MPS(cmd, f, hmenu) (WPARAM)(cmd), MAKELONG(f, hmenu)
  190. // Note: the following are for interpreting MDIclient to MDI child messages.
  191. #define GET_WM_MDIACTIVATE_FACTIVATE(hwnd, wp, lp) (BOOL)(wp)
  192. #define GET_WM_MDIACTIVATE_HWNDDEACT(wp, lp) (HWND)HIWORD(lp)
  193. #define GET_WM_MDIACTIVATE_HWNDACTIVATE(wp, lp) (HWND)LOWORD(lp)
  194. // Note: the following is for sending to the MDI client window.
  195. #define GET_WM_MDIACTIVATE_MPS(f, hwndD, hwndA) (WPARAM)(hwndA), 0
  196. #define GET_WM_MDISETMENU_MPS(hmenuF, hmenuW) 0, MAKELONG(hmenuF, hmenuW)
  197. #define GET_WM_MENUCHAR_CHAR(wp, lp) (CHAR)(wp)
  198. #define GET_WM_MENUCHAR_HMENU(wp, lp) (HMENU)LOWORD(lp)
  199. #define GET_WM_MENUCHAR_FMENU(wp, lp) (BOOL)HIWORD(lp)
  200. #define GET_WM_MENUCHAR_MPS(ch, hmenu, f) (WPARAM)(ch), MAKELONG(hmenu, f)
  201. #define GET_WM_PARENTNOTIFY_MSG(wp, lp) (wp)
  202. #define GET_WM_PARENTNOTIFY_ID(wp, lp) HIWORD(lp)
  203. #define GET_WM_PARENTNOTIFY_HWNDCHILD(wp, lp) (HWND)LOWORD(lp)
  204. #define GET_WM_PARENTNOTIFY_X(wp, lp) (INT)LOWORD(lp)
  205. #define GET_WM_PARENTNOTIFY_Y(wp, lp) (INT)HIWORD(lp)
  206. #define GET_WM_PARENTNOTIFY_MPS(msg, id, hwnd) (WPARAM)(msg), MAKELONG(hwnd, id)
  207. #define GET_WM_PARENTNOTIFY2_MPS(msg, x, y) (WPARAM)(msg), MAKELONG(x, y)
  208. #define GET_WM_VKEYTOITEM_CODE(wp, lp) (wp)
  209. #define GET_WM_VKEYTOITEM_ITEM(wp, lp) (INT)HIWORD(lp)
  210. #define GET_WM_VKEYTOITEM_HWND(wp, lp) (HWND)LOWORD(lp)
  211. #define GET_WM_VKEYTOITEM_MPS(code, item, hwnd) (WPARAM)(code), MAKELONG(hwnd, item)
  212. #define GET_EM_SETSEL_START(wp, lp) LOWORD(lp)
  213. #define GET_EM_SETSEL_END(wp, lp) HIWORD(lp)
  214. #define GET_EM_SETSEL_MPS(iStart, iEnd) 0, MAKELONG(iStart, iEnd)
  215. #define GET_EM_LINESCROLL_MPS(vert, horz) 0, MAKELONG(vert, horz)
  216. #define GET_WM_CHANGECBCHAIN_HWNDNEXT(wp, lp) (HWND)LOWORD(lp)
  217. #define GET_WM_HSCROLL_CODE(wp, lp) (wp)
  218. #define GET_WM_HSCROLL_POS(wp, lp) LOWORD(lp)
  219. #define GET_WM_HSCROLL_HWND(wp, lp) (HWND)HIWORD(lp)
  220. #define GET_WM_HSCROLL_MPS(code, pos, hwnd) (WPARAM)(code), MAKELONG(pos, hwnd)
  221. #define GET_WM_VSCROLL_CODE(wp, lp) (wp)
  222. #define GET_WM_VSCROLL_POS(wp, lp) LOWORD(lp)
  223. #define GET_WM_VSCROLL_HWND(wp, lp) (HWND)HIWORD(lp)
  224. #define GET_WM_VSCROLL_MPS(code, pos, hwnd) (WPARAM)(code), MAKELONG(pos, hwnd)
  225. #endif
  226. #endif // #ifndef WIN32
  227. #endif // #ifndef RC_INVOKED
  228. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  229. //
  230. // misc defines for misc sizes and things...
  231. //
  232. //
  233. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  234. //
  235. // bilingual. this allows the same identifier to be used in resource files
  236. // and code without having to decorate the id in your code.
  237. //
  238. #ifdef RC_INVOKED
  239. #define RCID(id) id
  240. #else
  241. #define RCID(id) MAKEINTRESOURCE(id)
  242. #endif
  243. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  244. //
  245. // Resource defines
  246. //
  247. //
  248. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  249. #ifdef WIN32
  250. //
  251. // Be compatible with multimed.cpl in Windows NT
  252. //
  253. #define ICON_MSACM RCID(3004)
  254. #else
  255. #define ICON_MSACM RCID(10)
  256. #endif
  257. #define ICON_INPUT RCID(11)
  258. #define ICON_OUTPUT RCID(12)
  259. #define ICON_MSACMMAP RCID(13)
  260. #define DLG_CPL_MSACM RCID(50)
  261. #define IDD_CPL_STATIC_DRIVERS 100
  262. #define IDD_CPL_LIST_DRIVERS 101
  263. #define IDD_CPL_BTN_CONFIGURE 102
  264. #define IDD_CPL_BTN_ABOUT 103
  265. #define IDD_CPL_BTN_PRIORITY 104
  266. #define IDD_CPL_BTN_HELP 105
  267. #define IDD_CPL_BTN_RESTART 106
  268. #define IDD_CPL_BTN_ABLE 107
  269. #define IDD_CPL_BTN_BUMPTOTOP 108
  270. #define IDD_CPL_BTN_INSTALL 109
  271. #define IDD_CPL_BTN_APPLY 110
  272. #define IDD_CPL_STATIC_PRIORITY 111
  273. #define IDD_CPL_COMBO_PLAYBACK 120
  274. #define IDD_CPL_COMBO_RECORD 121
  275. #define IDD_CPL_CHECK_PREFERRED 122
  276. #define DLG_RESTART_MSACM RCID(55)
  277. #define DLG_ABOUT_MSACM RCID(60)
  278. #define IDD_ABOUT_ICON_DRIVER 100
  279. #define IDD_ABOUT_TXT_DESCRIPTION 101
  280. #define IDD_ABOUT_TXT_VERSION 102
  281. #define IDD_ABOUT_TXT_COPYRIGHT 103
  282. #define IDD_ABOUT_TXT_LICENSING 104
  283. #define IDD_ABOUT_TXT_FEATURES 105
  284. #define IDS_ABOUT_TAG 200
  285. #define IDS_ABOUT_TITLE (IDS_ABOUT_TAG + 0)
  286. #define IDS_ABOUT_VERSION (IDS_ABOUT_TAG + 1)
  287. //
  288. // string resource defines, etc.
  289. //
  290. #define IDS_ACM_CAPS_TAG 50
  291. #define IDS_ACM_CAPS_DESCRIPTION (IDS_ACM_CAPS_TAG+0)
  292. #ifdef WIN32
  293. //
  294. // Be compatible with NT's multimed.cpl
  295. //
  296. #define IDS_CPL_TAG 3001
  297. #define IDS_CPL_HELPFILE 3003
  298. #else
  299. #define IDS_CPL_TAG 100
  300. #endif
  301. #define IDS_CPL_NAME (IDS_CPL_TAG+0)
  302. #define IDS_CPL_INFO (IDS_CPL_TAG+1)
  303. #define IDS_TXT_TAG 150
  304. #define IDS_TXT_NONE (IDS_TXT_TAG+0)
  305. #define IDS_TXT_DISABLED (IDS_TXT_TAG+1)
  306. #define DLG_PRIORITY_SET RCID(80)
  307. #define IDD_PRIORITY_TXT_DRIVER 100
  308. #define IDD_PRIORITY_TXT_FROMTO 101
  309. #define IDD_PRIORITY_COMBO_PRIORITY 102
  310. #define IDD_PRIORITY_CHECK_DISABLE 103
  311. #define IDS_PRIORITY_FROMTO (IDS_CPL_TAG+6)
  312. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  313. //
  314. //
  315. //
  316. //
  317. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  318. //
  319. // Note: These fields were taken out of ACMGARB b/c they are common to all
  320. // instances of the mapper and change in one instance should reflect
  321. // change in all instances.
  322. //
  323. typedef struct tACMGLOBALINFO
  324. {
  325. BOOL fPreferredOnly;
  326. BOOL fSyncOnlyOut;
  327. UINT uIdPreferredOut;
  328. BOOL fSyncOnlyIn;
  329. UINT uIdPreferredIn;
  330. } ACMGLOBALINFO, *PACMGLOBALINFO;
  331. // To simplify Win16/Win32 code
  332. #ifndef WIN32
  333. #define WAIT_FOR_MUTEX(a)
  334. #define RELEASE_MUTEX(a)
  335. #else // WIN32
  336. #define WAIT_FOR_MUTEX(a) if(NULL != a) WaitForSingleObject(a, INFINITE)
  337. #define RELEASE_MUTEX(a) if(NULL != a) ReleaseMutex(a)
  338. #endif // WIN32
  339. typedef struct tACMGARB
  340. {
  341. HINSTANCE hinst; // hinst of ACM module
  342. BOOL fEnabled; // whether mapper driver is enabled
  343. BOOL fPrestoSyncAsync; // allow async opens on sync devs
  344. UINT cInputStreams; // ref count for input mapping task
  345. #ifndef WIN32
  346. HTASK htaskInput; // input mapping task
  347. #else
  348. HANDLE hMutexSettings; // handle to mutex for settings
  349. #endif
  350. #ifdef DEBUG
  351. BOOL fFaultAndDie;
  352. #endif
  353. UINT cWaveOutDevs; // value from waveOutGetNumDevs
  354. UINT cWaveInDevs; // value from waveInGetNumDevs
  355. PACMGLOBALINFO pSettings;
  356. // BOOL fPreferredOnly;
  357. // BOOL fSyncOnlyOut;
  358. // UINT uIdPreferredOut;
  359. // BOOL fSyncOnlyIn;
  360. // UINT uIdPreferredIn;
  361. //
  362. // TCHAR szPreferredWaveOut[MAXPNAMELEN];
  363. // TCHAR szPreferredWaveIn[MAXPNAMELEN];
  364. } ACMGARB, *PACMGARB, FAR *LPACMGARB;
  365. typedef MMRESULT FAR * LPMMRESULT;
  366. //
  367. //
  368. //
  369. extern PACMGARB gpag;
  370. extern TCHAR gszNull[];
  371. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  372. //
  373. // structure/flag definitions used for GetWaveFormats and FindBestPCMFormat
  374. //
  375. //
  376. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  377. typedef struct tZYZPCMFORMAT
  378. {
  379. PUINT uFlagsInput;
  380. PUINT uFlagsOutput;
  381. UINT uSamplesPerSec;
  382. } ZYZPCMFORMAT, *PZYZPCMFORMAT, FAR LPZYZPCMFORMAT;
  383. //
  384. // note that the _order_ of these bits is very important--they map 1 to 1
  385. // with the format bits in dwFormats of the waveformat structure
  386. //
  387. #define ZYZPCMF_OUT_M08 0x0001
  388. #define ZYZPCMF_OUT_S08 0x0002
  389. #define ZYZPCMF_OUT_M16 0x0004
  390. #define ZYZPCMF_OUT_S16 0x0008
  391. #define ZYZPCMF_IN_M08 0x0100
  392. #define ZYZPCMF_IN_S08 0x0200
  393. #define ZYZPCMF_IN_M16 0x0400
  394. #define ZYZPCMF_IN_S16 0x0800
  395. #define ZYZPCMF_OUT_FORMATS (ZYZPCMF_OUT_M08 | ZYZPCMF_OUT_S08 | ZYZPCMF_OUT_M16 | ZYZPCMF_OUT_S16)
  396. #define ZYZPCMF_OUT_STEREO (ZYZPCMF_OUT_S08 | ZYZPCMF_OUT_S16)
  397. #define ZYZPCMF_OUT_MONO (ZYZPCMF_OUT_M08 | ZYZPCMF_OUT_M16)
  398. #define ZYZPCMF_OUT_8BIT (ZYZPCMF_OUT_M08 | ZYZPCMF_OUT_S08)
  399. #define ZYZPCMF_OUT_16BIT (ZYZPCMF_OUT_M16 | ZYZPCMF_OUT_S16)
  400. #define ZYZPCMF_IN_FORMATS (ZYZPCMF_IN_M08 | ZYZPCMF_IN_S08 | ZYZPCMF_IN_M16 | ZYZPCMF_IN_S16)
  401. #define ZYZPCMF_IN_STEREO (ZYZPCMF_IN_S08 | ZYZPCMF_IN_S16)
  402. #define ZYZPCMF_IN_MONO (ZYZPCMF_IN_M08 | ZYZPCMF_IN_M16)
  403. #define ZYZPCMF_IN_8BIT (ZYZPCMF_IN_M08 | ZYZPCMF_IN_S08)
  404. #define ZYZPCMF_IN_16BIT (ZYZPCMF_IN_M16 | ZYZPCMF_IN_S16)
  405. extern ZYZPCMFORMAT gaPCMFormats[];
  406. //
  407. //
  408. //
  409. //
  410. //
  411. typedef MMRESULT (WINAPI *MAPPEDWAVEOPEN)
  412. (
  413. HWAVE FAR *phw,
  414. UINT uId,
  415. LPWAVEFORMATEX pwfx,
  416. DWORD_PTR dwCallback,
  417. DWORD_PTR dwInstance,
  418. DWORD fdwOpen
  419. );
  420. typedef MMRESULT (WINAPI *MAPPEDWAVECLOSE)
  421. (
  422. HWAVE hw
  423. );
  424. typedef MMRESULT (WINAPI *MAPPEDWAVEPREPAREHEADER)
  425. (
  426. HWAVE hw,
  427. LPWAVEHDR pwh,
  428. UINT cbwh
  429. );
  430. typedef MMRESULT (WINAPI *MAPPEDWAVEUNPREPAREHEADER)
  431. (
  432. HWAVE hw,
  433. LPWAVEHDR pwh,
  434. UINT cbwh
  435. );
  436. typedef MMRESULT (WINAPI *MAPPEDWAVEWRITE)
  437. (
  438. HWAVE hw,
  439. LPWAVEHDR pwh,
  440. UINT cbwh
  441. );
  442. typedef MMRESULT (WINAPI *MAPPEDWAVEGETPOSITION)
  443. (
  444. HWAVE hw,
  445. LPMMTIME pmmt,
  446. UINT cbmmt
  447. );
  448. typedef MMRESULT (WINAPI *MAPPEDWAVEMESSAGE)
  449. (
  450. HWAVE hw,
  451. UINT msg,
  452. DWORD_PTR dw1,
  453. DWORD_PTR dw2
  454. );
  455. //
  456. //
  457. //
  458. //
  459. //
  460. typedef struct tMAPSTREAM FAR *LPMAPSTREAM;
  461. typedef struct tMAPSTREAM
  462. {
  463. ////LPMAPSTREAM pmsNext; // next stream for mapper
  464. MMRESULT mmrClient;
  465. UINT uHeuristic;
  466. HACMDRIVER had; // handle to ACM driver we chose
  467. HACMSTREAM has; // handle to ACM conversion stream
  468. LPWAVEFORMATEX pwfxSrc; // source format when mapping
  469. LPWAVEFORMATEX pwfxDst; // destination format when mapping
  470. DWORD fdwSupport; // support required for conversion
  471. BOOL fInput; // TRUE if input
  472. #ifdef WIN32
  473. DWORD htaskInput; // Thread id of input
  474. HANDLE hInput; // Thread handle of input
  475. HANDLE hStoppedEvent; // Input stopped
  476. volatile LONG nOutstanding; // Input buffers outstanding
  477. #else
  478. HTASK htaskInput; // for input mapping....
  479. #endif
  480. DWORD fdwOpen; // client's allocation flags
  481. UINT uMappedDeviceID;// device to map to if WAVE_MAPPED flag
  482. DWORD_PTR dwCallback; // client callback
  483. DWORD_PTR dwInstance; // client callback instance data
  484. LPWAVEFORMATEX pwfxClient; // format of client wave data
  485. union
  486. {
  487. HWAVE hwClient; // client's handle to ACM
  488. HWAVEOUT hwoClient;
  489. HWAVEIN hwiClient;
  490. };
  491. LPWAVEFORMATEX pwfxReal; // format of device wave data
  492. DWORD cbwfxReal;
  493. UINT uIdReal;
  494. union
  495. {
  496. HWAVE hwReal; // device wave handle
  497. HWAVEOUT hwoReal;
  498. HWAVEIN hwiReal;
  499. };
  500. MAPPEDWAVEOPEN fnWaveOpen;
  501. MAPPEDWAVECLOSE fnWaveClose;
  502. MAPPEDWAVEPREPAREHEADER fnWavePrepareHeader;
  503. MAPPEDWAVEUNPREPAREHEADER fnWaveUnprepareHeader;
  504. MAPPEDWAVEWRITE fnWaveWrite;
  505. MAPPEDWAVEGETPOSITION fnWaveGetPosition;
  506. MAPPEDWAVEMESSAGE fnWaveMessage;
  507. } MAPSTREAM;
  508. BOOL FNGLOBAL GetWaveFormats(PZYZPCMFORMAT pzpf);
  509. MMRESULT FNGLOBAL mapWaveGetDevCaps(BOOL fInput, LPWAVEOUTCAPS pwc, UINT cbSize);
  510. //
  511. //
  512. //
  513. //
  514. MMRESULT FNLOCAL FindConverterMatch(LPMAPSTREAM pms);
  515. MMRESULT FNLOCAL mapWaveGetPosition(LPMAPSTREAM pms,LPMMTIME pmmt,UINT cbmmt);
  516. DWORD FNLOCAL mapWaveOpen(BOOL fInput, UINT uId, DWORD_PTR dwUser, LPWAVEOPENDESC pwod, DWORD fdwOpen);
  517. DWORD FNLOCAL mapWaveClose(LPMAPSTREAM pms);
  518. DWORD FNLOCAL mapWavePrepareHeader(LPMAPSTREAM pms, LPWAVEHDR pwh);
  519. DWORD FNLOCAL mapWaveUnprepareHeader(LPMAPSTREAM pms, LPWAVEHDR pwh);
  520. DWORD FNLOCAL mapWaveWriteBuffer(LPMAPSTREAM pms, LPWAVEHDR pwh);
  521. EXTERN_C BOOL FNGLOBAL mapWaveDriverCallback
  522. (
  523. LPMAPSTREAM pms,
  524. UINT uMsg,
  525. DWORD_PTR dw1,
  526. DWORD_PTR dw2
  527. );
  528. // Task proc for hidden input mapping window
  529. EXTERN_C LRESULT FNCALLBACK mapWaveInputConvertProc
  530. (
  531. DWORD dwInst
  532. );
  533. EXTERN_C void FNCALLBACK mapWaveCallback
  534. (
  535. HWAVE hw,
  536. UINT uMsg,
  537. DWORD_PTR dwUser,
  538. DWORD_PTR dwParam1,
  539. DWORD_PTR dwParam2
  540. );
  541. //
  542. //
  543. //
  544. //
  545. BOOL FNGLOBAL mapSettingsRestore(void);
  546. BOOL FNGLOBAL mapSettingsSave(void);
  547. LRESULT FNGLOBAL mapDriverEnable(HDRVR hdrvr);
  548. LRESULT FNGLOBAL mapDriverDisable(HDRVR hdrvr);
  549. LRESULT FNGLOBAL mapDriverInstall(HDRVR hdrvr);
  550. LRESULT FNGLOBAL mapDriverRemove(HDRVR hdrvr);
  551. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  552. //
  553. // Misc defines and things...
  554. //
  555. //
  556. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  557. #define MAX_HEURISTIC 6
  558. //
  559. //
  560. //
  561. //
  562. #define WAVE_FORMAT_STEREO8 (WAVE_FORMAT_1S08 | WAVE_FORMAT_2S08 | WAVE_FORMAT_4S08)
  563. #define WAVE_FORMAT_STEREO16 (WAVE_FORMAT_1S16 | WAVE_FORMAT_2S16 | WAVE_FORMAT_4S16)
  564. #define WAVE_FORMAT_MONO8 (WAVE_FORMAT_1M08 | WAVE_FORMAT_2M08 | WAVE_FORMAT_4M08)
  565. #define WAVE_FORMAT_MONO16 (WAVE_FORMAT_1M16 | WAVE_FORMAT_2M16 | WAVE_FORMAT_4M16)
  566. #define WAVE_FORMAT_44k (WAVE_FORMAT_4M16 | WAVE_FORMAT_4S16 | WAVE_FORMAT_4M08 | WAVE_FORMAT_4S08)
  567. #define WAVE_FORMAT_22k (WAVE_FORMAT_2M16 | WAVE_FORMAT_2S16 | WAVE_FORMAT_2M08 | WAVE_FORMAT_2S08)
  568. #define WAVE_FORMAT_11k (WAVE_FORMAT_1M16 | WAVE_FORMAT_1S16 | WAVE_FORMAT_1M08 | WAVE_FORMAT_1S08)
  569. #define WAVE_FORMAT_MONO_44k (WAVE_FORMAT_4M16 | WAVE_FORMAT_4M08)
  570. #define WAVE_FORMAT_MONO_22k (WAVE_FORMAT_2M16 | WAVE_FORMAT_2M08)
  571. #define WAVE_FORMAT_MONO_11k (WAVE_FORMAT_1M16 | WAVE_FORMAT_1M08)
  572. #define WAVE_FORMAT_STEREO_44k (WAVE_FORMAT_4S16 | WAVE_FORMAT_4S08)
  573. #define WAVE_FORMAT_STEREO_22k (WAVE_FORMAT_2S16 | WAVE_FORMAT_2S08)
  574. #define WAVE_FORMAT_STEREO_11k (WAVE_FORMAT_1S16 | WAVE_FORMAT_1S08)
  575. #define WAVE_FORMAT_STEREO (WAVE_FORMAT_STEREO16 | WAVE_FORMAT_STEREO8)
  576. #define WAVE_FORMAT_MONO (WAVE_FORMAT_MONO16 | WAVE_FORMAT_MONO8)
  577. #define WAVE_FORMAT_16BIT (WAVE_FORMAT_STEREO16 | WAVE_FORMAT_MONO16)
  578. #define WAVE_FORMAT_8BIT (WAVE_FORMAT_STEREO8 | WAVE_FORMAT_MONO8)
  579. #ifndef RC_INVOKED
  580. #pragma pack() // revert to default packing
  581. #endif // RC_INVOKED
  582. #ifdef __cplusplus
  583. } // end of extern "C" {
  584. #endif // __cplusplus
  585. #endif // _INC_MSACMMAP