home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 May / PCP163A.iso / Runimage / Cbuilder4 / Include / AVICAP.H < prev    next >
Encoding:
C/C++ Source or Header  |  1999-01-26  |  29.3 KB  |  573 lines

  1. /****************************************************************************
  2.  *
  3.  *   avicap.h
  4.  *
  5.  *   Main include file.
  6.  *
  7.  *   Microsoft Video for Windows Sample Capture Class
  8.  *
  9.  *    You have a royalty-free right to use, modify, reproduce and
  10.  *    distribute the Sample Files (and/or any modified version) in
  11.  *    any way you find useful, provided that you agree that
  12.  *    Microsoft has no warranty obligations or liability for any
  13.  *    Sample Application Files which are modified.
  14.  *
  15.  ***************************************************************************/
  16.  
  17. /*
  18.  *      C/C++ Run Time Library - Version 9.5
  19.  *
  20.  *      Copyright (c) 1994, 1999 by Inprise Corporation
  21.  *      All Rights Reserved.
  22.  *
  23.  */
  24.  
  25.  
  26. #ifndef _INC_AVICAP
  27. #pragma option push -b -a8 -pc -A- /*P_O_Push_S*/
  28. #define _INC_AVICAP
  29. #define __AVICAP_H
  30. #pragma option push -b
  31.  
  32.  
  33. #if !defined(RC_INVOKED) && !defined(VFWAPI)
  34. #ifdef _WIN32
  35.     #define VFWAPI  __stdcall
  36.     #define VFWAPIV __stdcall
  37.     #define _LOADDS
  38.     #pragma message("AVICAP.H: Defining VFWAPIV to be __stdcall...................")
  39. #else
  40.     #define VFWAPI  FAR PASCAL
  41.     #define VFWAPIV FAR CDECL
  42. #endif
  43. #endif
  44.  
  45. #ifdef __cplusplus
  46. #define AVICapSM ::SendMessage  /* SendMessage in C++*/
  47. #else
  48. #define AVICapSM SendMessage    /* SendMessage in C */
  49. #endif  /* __cplusplus */
  50.  
  51. #ifdef __cplusplus
  52. extern "C" {            /* Assume C declarations for C++ */
  53. #endif  /* __cplusplus */
  54.  
  55. #ifdef __BORLANDC__
  56.  
  57.   #include <pshpack1.h>
  58.  
  59. #endif
  60.  
  61. #ifndef RC_INVOKED
  62.  
  63. // ------------------------------------------------------------------
  64. //  Window Messages  WM_CAP... which can be sent to an AVICAP window
  65. // ------------------------------------------------------------------
  66.  
  67.  
  68.  
  69. // UNICODE
  70. //
  71. // The Win32 version of AVICAP supports UNICODE applications:
  72. // for each API or message that takes a char or string parameter, there are
  73. // two versions, ApiNameA and ApiNameW. The default name ApiName is #defined
  74. // to one or other depending on whether UNICODE is defined. Apps can call
  75. // the A and W apis directly, and mix them.
  76. //
  77. // The 32-bit AVICAP uses unicode exclusively internally. ApiNameA() will be
  78. // implemented as a call to ApiNameW() together with translation of strings.
  79.  
  80.  
  81.  
  82.  
  83. // Defines start of the message range
  84. #define WM_CAP_START                    WM_USER
  85.  
  86. // start of unicode messages
  87. #define WM_CAP_UNICODE_START            WM_USER+100
  88.  
  89. #define WM_CAP_GET_CAPSTREAMPTR         (WM_CAP_START+  1)
  90.  
  91. #ifdef _WIN32
  92. #define WM_CAP_SET_CALLBACK_ERRORW     (WM_CAP_UNICODE_START+  2)
  93. #define WM_CAP_SET_CALLBACK_STATUSW    (WM_CAP_UNICODE_START+  3)
  94. #define WM_CAP_SET_CALLBACK_ERRORA     (WM_CAP_START+  2)
  95. #define WM_CAP_SET_CALLBACK_STATUSA    (WM_CAP_START+  3)
  96. #ifdef UNICODE
  97. #define WM_CAP_SET_CALLBACK_ERROR       WM_CAP_SET_CALLBACK_ERRORW
  98. #define WM_CAP_SET_CALLBACK_STATUS      WM_CAP_SET_CALLBACK_STATUSW
  99. #else
  100. #define WM_CAP_SET_CALLBACK_ERROR       WM_CAP_SET_CALLBACK_ERRORA
  101. #define WM_CAP_SET_CALLBACK_STATUS      WM_CAP_SET_CALLBACK_STATUSA
  102. #endif
  103. #else
  104. #define WM_CAP_SET_CALLBACK_ERROR       (WM_CAP_START+  2)
  105. #define WM_CAP_SET_CALLBACK_STATUS      (WM_CAP_START+  3)
  106. #endif
  107.  
  108.  
  109. #define WM_CAP_SET_CALLBACK_YIELD       (WM_CAP_START+  4)
  110. #define WM_CAP_SET_CALLBACK_FRAME       (WM_CAP_START+  5)
  111. #define WM_CAP_SET_CALLBACK_VIDEOSTREAM (WM_CAP_START+  6)
  112. #define WM_CAP_SET_CALLBACK_WAVESTREAM  (WM_CAP_START+  7)
  113. #define WM_CAP_GET_USER_DATA            (WM_CAP_START+  8)
  114. #define WM_CAP_SET_USER_DATA            (WM_CAP_START+  9)
  115.  
  116. #define WM_CAP_DRIVER_CONNECT           (WM_CAP_START+  10)
  117. #define WM_CAP_DRIVER_DISCONNECT        (WM_CAP_START+  11)
  118.  
  119. #ifdef _WIN32
  120. #define WM_CAP_DRIVER_GET_NAMEA        (WM_CAP_START+  12)
  121. #define WM_CAP_DRIVER_GET_VERSIONA     (WM_CAP_START+  13)
  122. #define WM_CAP_DRIVER_GET_NAMEW        (WM_CAP_UNICODE_START+  12)
  123. #define WM_CAP_DRIVER_GET_VERSIONW     (WM_CAP_UNICODE_START+  13)
  124. #ifdef UNICODE
  125. #define WM_CAP_DRIVER_GET_NAME          WM_CAP_DRIVER_GET_NAMEW
  126. #define WM_CAP_DRIVER_GET_VERSION       WM_CAP_DRIVER_GET_VERSIONW
  127. #else
  128. #define WM_CAP_DRIVER_GET_NAME          WM_CAP_DRIVER_GET_NAMEA
  129. #define WM_CAP_DRIVER_GET_VERSION       WM_CAP_DRIVER_GET_VERSIONA
  130. #endif
  131. #else
  132. #define WM_CAP_DRIVER_GET_NAME          (WM_CAP_START+  12)
  133. #define WM_CAP_DRIVER_GET_VERSION       (WM_CAP_START+  13)
  134. #endif
  135.  
  136. #define WM_CAP_DRIVER_GET_CAPS          (WM_CAP_START+  14)
  137.  
  138. #ifdef _WIN32
  139. #define WM_CAP_FILE_SET_CAPTURE_FILEA  (WM_CAP_START+  20)
  140. #define WM_CAP_FILE_GET_CAPTURE_FILEA  (WM_CAP_START+  21)
  141. #define WM_CAP_FILE_SAVEASA            (WM_CAP_START+  23)
  142. #define WM_CAP_FILE_SAVEDIBA           (WM_CAP_START+  25)
  143. #define WM_CAP_FILE_SET_CAPTURE_FILEW  (WM_CAP_UNICODE_START+  20)
  144. #define WM_CAP_FILE_GET_CAPTURE_FILEW  (WM_CAP_UNICODE_START+  21)
  145. #define WM_CAP_FILE_SAVEASW            (WM_CAP_UNICODE_START+  23)
  146. #define WM_CAP_FILE_SAVEDIBW           (WM_CAP_UNICODE_START+  25)
  147. #ifdef UNICODE
  148. #define WM_CAP_FILE_SET_CAPTURE_FILE    WM_CAP_FILE_SET_CAPTURE_FILEW
  149. #define WM_CAP_FILE_GET_CAPTURE_FILE    WM_CAP_FILE_GET_CAPTURE_FILEW
  150. #define WM_CAP_FILE_SAVEAS              WM_CAP_FILE_SAVEASW
  151. #define WM_CAP_FILE_SAVEDIB             WM_CAP_FILE_SAVEDIBW
  152. #else
  153. #define WM_CAP_FILE_SET_CAPTURE_FILE    WM_CAP_FILE_SET_CAPTURE_FILEA
  154. #define WM_CAP_FILE_GET_CAPTURE_FILE    WM_CAP_FILE_GET_CAPTURE_FILEA
  155. #define WM_CAP_FILE_SAVEAS              WM_CAP_FILE_SAVEASA
  156. #define WM_CAP_FILE_SAVEDIB             WM_CAP_FILE_SAVEDIBA
  157. #endif
  158. #else
  159. #define WM_CAP_FILE_SET_CAPTURE_FILE    (WM_CAP_START+  20)
  160. #define WM_CAP_FILE_GET_CAPTURE_FILE    (WM_CAP_START+  21)
  161. #define WM_CAP_FILE_SAVEAS              (WM_CAP_START+  23)
  162. #define WM_CAP_FILE_SAVEDIB             (WM_CAP_START+  25)
  163. #endif
  164.  
  165. // out of order to save on ifdefs
  166. #define WM_CAP_FILE_ALLOCATE            (WM_CAP_START+  22)
  167. #define WM_CAP_FILE_SET_INFOCHUNK       (WM_CAP_START+  24)
  168.  
  169. #define WM_CAP_EDIT_COPY                (WM_CAP_START+  30)
  170.  
  171. #define WM_CAP_SET_AUDIOFORMAT          (WM_CAP_START+  35)
  172. #define WM_CAP_GET_AUDIOFORMAT          (WM_CAP_START+  36)
  173.  
  174. #define WM_CAP_DLG_VIDEOFORMAT          (WM_CAP_START+  41)
  175. #define WM_CAP_DLG_VIDEOSOURCE          (WM_CAP_START+  42)
  176. #define WM_CAP_DLG_VIDEODISPLAY         (WM_CAP_START+  43)
  177. #define WM_CAP_GET_VIDEOFORMAT          (WM_CAP_START+  44)
  178. #define WM_CAP_SET_VIDEOFORMAT          (WM_CAP_START+  45)
  179. #define WM_CAP_DLG_VIDEOCOMPRESSION     (WM_CAP_START+  46)
  180.  
  181. #define WM_CAP_SET_PREVIEW              (WM_CAP_START+  50)
  182. #define WM_CAP_SET_OVERLAY              (WM_CAP_START+  51)
  183. #define WM_CAP_SET_PREVIEWRATE          (WM_CAP_START+  52)
  184. #define WM_CAP_SET_SCALE                (WM_CAP_START+  53)
  185. #define WM_CAP_GET_STATUS               (WM_CAP_START+  54)
  186. #define WM_CAP_SET_SCROLL               (WM_CAP_START+  55)
  187.  
  188. #define WM_CAP_GRAB_FRAME               (WM_CAP_START+  60)
  189. #define WM_CAP_GRAB_FRAME_NOSTOP        (WM_CAP_START+  61)
  190.  
  191. #define WM_CAP_SEQUENCE                 (WM_CAP_START+  62)
  192. #define WM_CAP_SEQUENCE_NOFILE          (WM_CAP_START+  63)
  193. #define WM_CAP_SET_SEQUENCE_SETUP       (WM_CAP_START+  64)
  194. #define WM_CAP_GET_SEQUENCE_SETUP       (WM_CAP_START+  65)
  195.  
  196. #ifdef _WIN32
  197. #define WM_CAP_SET_MCI_DEVICEA         (WM_CAP_START+  66)
  198. #define WM_CAP_GET_MCI_DEVICEA         (WM_CAP_START+  67)
  199. #define WM_CAP_SET_MCI_DEVICEW         (WM_CAP_UNICODE_START+  66)
  200. #define WM_CAP_GET_MCI_DEVICEW         (WM_CAP_UNICODE_START+  67)
  201. #ifdef UNICODE
  202. #define WM_CAP_SET_MCI_DEVICE           WM_CAP_SET_MCI_DEVICEW
  203. #define WM_CAP_GET_MCI_DEVICE           WM_CAP_GET_MCI_DEVICEW
  204. #else
  205. #define WM_CAP_SET_MCI_DEVICE           WM_CAP_SET_MCI_DEVICEA
  206. #define WM_CAP_GET_MCI_DEVICE           WM_CAP_GET_MCI_DEVICEA
  207. #endif
  208. #else
  209. #define WM_CAP_SET_MCI_DEVICE           (WM_CAP_START+  66)
  210. #define WM_CAP_GET_MCI_DEVICE           (WM_CAP_START+  67)
  211. #endif
  212.  
  213.  
  214.  
  215. #define WM_CAP_STOP                     (WM_CAP_START+  68)
  216. #define WM_CAP_ABORT                    (WM_CAP_START+  69)
  217.  
  218. #define WM_CAP_SINGLE_FRAME_OPEN        (WM_CAP_START+  70)
  219. #define WM_CAP_SINGLE_FRAME_CLOSE       (WM_CAP_START+  71)
  220. #define WM_CAP_SINGLE_FRAME             (WM_CAP_START+  72)
  221.  
  222. #ifdef _WIN32
  223. #define WM_CAP_PAL_OPENA               (WM_CAP_START+  80)
  224. #define WM_CAP_PAL_SAVEA               (WM_CAP_START+  81)
  225. #define WM_CAP_PAL_OPENW               (WM_CAP_UNICODE_START+  80)
  226. #define WM_CAP_PAL_SAVEW               (WM_CAP_UNICODE_START+  81)
  227. #ifdef UNICODE
  228. #define WM_CAP_PAL_OPEN                 WM_CAP_PAL_OPENW
  229. #define WM_CAP_PAL_SAVE                 WM_CAP_PAL_SAVEW
  230. #else
  231. #define WM_CAP_PAL_OPEN                 WM_CAP_PAL_OPENA
  232. #define WM_CAP_PAL_SAVE                 WM_CAP_PAL_SAVEA
  233. #endif
  234. #else
  235. #define WM_CAP_PAL_OPEN                 (WM_CAP_START+  80)
  236. #define WM_CAP_PAL_SAVE                 (WM_CAP_START+  81)
  237. #endif
  238.  
  239. #define WM_CAP_PAL_PASTE                (WM_CAP_START+  82)
  240. #define WM_CAP_PAL_AUTOCREATE           (WM_CAP_START+  83)
  241. #define WM_CAP_PAL_MANUALCREATE         (WM_CAP_START+  84)
  242.  
  243. // Following added post VFW 1.1
  244. #define WM_CAP_SET_CALLBACK_CAPCONTROL  (WM_CAP_START+  85)
  245.  
  246.  
  247. // Defines end of the message range
  248. #ifdef _WIN32
  249. #define WM_CAP_UNICODE_END              WM_CAP_PAL_SAVEW
  250. #define WM_CAP_END                      WM_CAP_UNICODE_END
  251. #else
  252. #define WM_CAP_END                      WM_CAP_SET_CALLBACK_CAPCONTROL
  253. #endif
  254.  
  255. // ------------------------------------------------------------------
  256. //  Message crackers for above
  257. // ------------------------------------------------------------------
  258.  
  259. // message wrapper macros are defined for the default messages only. Apps
  260. // that wish to mix Ansi and UNICODE message sending will have to
  261. // reference the _A and _W messages directly
  262.  
  263. #define capSetCallbackOnError(hwnd, fpProc)        ((BOOL)AVICapSM(hwnd, WM_CAP_SET_CALLBACK_ERROR, 0, (LPARAM)(LPVOID)(fpProc)))
  264. #define capSetCallbackOnStatus(hwnd, fpProc)       ((BOOL)AVICapSM(hwnd, WM_CAP_SET_CALLBACK_STATUS, 0, (LPARAM)(LPVOID)(fpProc)))
  265. #define capSetCallbackOnYield(hwnd, fpProc)        ((BOOL)AVICapSM(hwnd, WM_CAP_SET_CALLBACK_YIELD, 0, (LPARAM)(LPVOID)(fpProc)))
  266. #define capSetCallbackOnFrame(hwnd, fpProc)        ((BOOL)AVICapSM(hwnd, WM_CAP_SET_CALLBACK_FRAME, 0, (LPARAM)(LPVOID)(fpProc)))
  267. #define capSetCallbackOnVideoStream(hwnd, fpProc)  ((BOOL)AVICapSM(hwnd, WM_CAP_SET_CALLBACK_VIDEOSTREAM, 0, (LPARAM)(LPVOID)(fpProc)))
  268. #define capSetCallbackOnWaveStream(hwnd, fpProc)   ((BOOL)AVICapSM(hwnd, WM_CAP_SET_CALLBACK_WAVESTREAM, 0, (LPARAM)(LPVOID)(fpProc)))
  269. #define capSetCallbackOnCapControl(hwnd, fpProc)   ((BOOL)AVICapSM(hwnd, WM_CAP_SET_CALLBACK_CAPCONTROL, 0, (LPARAM)(LPVOID)(fpProc)))
  270.  
  271. #define capSetUserData(hwnd, lUser)        ((BOOL)AVICapSM(hwnd, WM_CAP_SET_USER_DATA, 0, (LPARAM)lUser))
  272. #define capGetUserData(hwnd)               (AVICapSM(hwnd, WM_CAP_GET_USER_DATA, 0, 0))
  273.  
  274. #define capDriverConnect(hwnd, i)                  ((BOOL)AVICapSM(hwnd, WM_CAP_DRIVER_CONNECT, (WPARAM)(i), 0L))
  275. #define capDriverDisconnect(hwnd)                  ((BOOL)AVICapSM(hwnd, WM_CAP_DRIVER_DISCONNECT, (WPARAM)0, 0L))
  276. #define capDriverGetName(hwnd, szName, wSize)      ((BOOL)AVICapSM(hwnd, WM_CAP_DRIVER_GET_NAME, (WPARAM)(wSize), (LPARAM)(LPVOID)(LPTSTR)(szName)))
  277. #define capDriverGetVersion(hwnd, szVer, wSize)    ((BOOL)AVICapSM(hwnd, WM_CAP_DRIVER_GET_VERSION, (WPARAM)(wSize), (LPARAM)(LPVOID)(LPTSTR)(szVer)))
  278. #define capDriverGetCaps(hwnd, s, wSize)           ((BOOL)AVICapSM(hwnd, WM_CAP_DRIVER_GET_CAPS, (WPARAM)(wSize), (LPARAM)(LPVOID)(LPCAPDRIVERCAPS)(s)))
  279.  
  280. #define capFileSetCaptureFile(hwnd, szName)        ((BOOL)AVICapSM(hwnd, WM_CAP_FILE_SET_CAPTURE_FILE, 0, (LPARAM)(LPVOID)(LPTSTR)(szName)))
  281. #define capFileGetCaptureFile(hwnd, szName, wSize) ((BOOL)AVICapSM(hwnd, WM_CAP_FILE_GET_CAPTURE_FILE, (WPARAM)(wSize), (LPARAM)(LPVOID)(LPTSTR)(szName)))
  282. #define capFileAlloc(hwnd, dwSize)                 ((BOOL)AVICapSM(hwnd, WM_CAP_FILE_ALLOCATE, 0, (LPARAM)(DWORD)(dwSize)))
  283. #define capFileSaveAs(hwnd, szName)                ((BOOL)AVICapSM(hwnd, WM_CAP_FILE_SAVEAS, 0, (LPARAM)(LPVOID)(LPTSTR)(szName)))
  284. #define capFileSetInfoChunk(hwnd, lpInfoChunk)     ((BOOL)AVICapSM(hwnd, WM_CAP_FILE_SET_INFOCHUNK, (WPARAM)0, (LPARAM)(LPCAPINFOCHUNK)(lpInfoChunk)))
  285. #define capFileSaveDIB(hwnd, szName)               ((BOOL)AVICapSM(hwnd, WM_CAP_FILE_SAVEDIB, 0, (LPARAM)(LPVOID)(LPTSTR)(szName)))
  286.  
  287. #define capEditCopy(hwnd)                          ((BOOL)AVICapSM(hwnd, WM_CAP_EDIT_COPY, 0, 0L))
  288.  
  289. #define capSetAudioFormat(hwnd, s, wSize)          ((BOOL)AVICapSM(hwnd, WM_CAP_SET_AUDIOFORMAT, (WPARAM)(wSize), (LPARAM)(LPVOID)(LPWAVEFORMATEX)(s)))
  290. #define capGetAudioFormat(hwnd, s, wSize)          ((DWORD)AVICapSM(hwnd, WM_CAP_GET_AUDIOFORMAT, (WPARAM)(wSize), (LPARAM)(LPVOID)(LPWAVEFORMATEX)(s)))
  291. #define capGetAudioFormatSize(hwnd)                ((DWORD)AVICapSM(hwnd, WM_CAP_GET_AUDIOFORMAT, (WPARAM)0, (LPARAM)0L))
  292.  
  293. #define capDlgVideoFormat(hwnd)                    ((BOOL)AVICapSM(hwnd, WM_CAP_DLG_VIDEOFORMAT, 0, 0L))
  294. #define capDlgVideoSource(hwnd)                    ((BOOL)AVICapSM(hwnd, WM_CAP_DLG_VIDEOSOURCE, 0, 0L))
  295. #define capDlgVideoDisplay(hwnd)                   ((BOOL)AVICapSM(hwnd, WM_CAP_DLG_VIDEODISPLAY, 0, 0L))
  296. #define capDlgVideoCompression(hwnd)               ((BOOL)AVICapSM(hwnd, WM_CAP_DLG_VIDEOCOMPRESSION, 0, 0L))
  297.  
  298. #define capGetVideoFormat(hwnd, s, wSize)          ((DWORD)AVICapSM(hwnd, WM_CAP_GET_VIDEOFORMAT, (WPARAM)(wSize), (LPARAM)(LPVOID)(s)))
  299. #define capGetVideoFormatSize(hwnd)            ((DWORD)AVICapSM(hwnd, WM_CAP_GET_VIDEOFORMAT, 0, 0L))
  300. #define capSetVideoFormat(hwnd, s, wSize)          ((BOOL)AVICapSM(hwnd, WM_CAP_SET_VIDEOFORMAT, (WPARAM)(wSize), (LPARAM)(LPVOID)(s)))
  301.  
  302. #define capPreview(hwnd, f)                        ((BOOL)AVICapSM(hwnd, WM_CAP_SET_PREVIEW, (WPARAM)(BOOL)(f), 0L))
  303. #define capPreviewRate(hwnd, wMS)                  ((BOOL)AVICapSM(hwnd, WM_CAP_SET_PREVIEWRATE, (WPARAM)(wMS), 0))
  304. #define capOverlay(hwnd, f)                        ((BOOL)AVICapSM(hwnd, WM_CAP_SET_OVERLAY, (WPARAM)(BOOL)(f), 0L))
  305. #define capPreviewScale(hwnd, f)                   ((BOOL)AVICapSM(hwnd, WM_CAP_SET_SCALE, (WPARAM)(BOOL)f, 0L))
  306. #define capGetStatus(hwnd, s, wSize)               ((BOOL)AVICapSM(hwnd, WM_CAP_GET_STATUS, (WPARAM)(wSize), (LPARAM)(LPVOID)(LPCAPSTATUS)(s)))
  307. #define capSetScrollPos(hwnd, lpP)                 ((BOOL)AVICapSM(hwnd, WM_CAP_SET_SCROLL, (WPARAM)0, (LPARAM)(LPPOINT)(lpP)))
  308.  
  309. #define capGrabFrame(hwnd)                         ((BOOL)AVICapSM(hwnd, WM_CAP_GRAB_FRAME, (WPARAM)0, (LPARAM)0L))
  310. #define capGrabFrameNoStop(hwnd)                   ((BOOL)AVICapSM(hwnd, WM_CAP_GRAB_FRAME_NOSTOP, (WPARAM)0, (LPARAM)0L))
  311.  
  312. #define capCaptureSequence(hwnd)                   ((BOOL)AVICapSM(hwnd, WM_CAP_SEQUENCE, (WPARAM)0, (LPARAM)0L))
  313. #define capCaptureSequenceNoFile(hwnd)             ((BOOL)AVICapSM(hwnd, WM_CAP_SEQUENCE_NOFILE, (WPARAM)0, (LPARAM)0L))
  314. #define capCaptureStop(hwnd)                       ((BOOL)AVICapSM(hwnd, WM_CAP_STOP, (WPARAM)0, (LPARAM)0L))
  315. #define capCaptureAbort(hwnd)                      ((BOOL)AVICapSM(hwnd, WM_CAP_ABORT, (WPARAM)0, (LPARAM)0L))
  316.  
  317. #define capCaptureSingleFrameOpen(hwnd)            ((BOOL)AVICapSM(hwnd, WM_CAP_SINGLE_FRAME_OPEN, (WPARAM)0, (LPARAM)0L))
  318. #define capCaptureSingleFrameClose(hwnd)           ((BOOL)AVICapSM(hwnd, WM_CAP_SINGLE_FRAME_CLOSE, (WPARAM)0, (LPARAM)0L))
  319. #define capCaptureSingleFrame(hwnd)                ((BOOL)AVICapSM(hwnd, WM_CAP_SINGLE_FRAME, (WPARAM)0, (LPARAM)0L))
  320.  
  321. #define capCaptureGetSetup(hwnd, s, wSize)         ((BOOL)AVICapSM(hwnd, WM_CAP_GET_SEQUENCE_SETUP, (WPARAM)(wSize), (LPARAM)(LPVOID)(LPCAPTUREPARMS)(s)))
  322. #define capCaptureSetSetup(hwnd, s, wSize)         ((BOOL)AVICapSM(hwnd, WM_CAP_SET_SEQUENCE_SETUP, (WPARAM)(wSize), (LPARAM)(LPVOID)(LPCAPTUREPARMS)(s)))
  323.  
  324. #define capSetMCIDeviceName(hwnd, szName)          ((BOOL)AVICapSM(hwnd, WM_CAP_SET_MCI_DEVICE, 0, (LPARAM)(LPVOID)(LPTSTR)(szName)))
  325. #define capGetMCIDeviceName(hwnd, szName, wSize)   ((BOOL)AVICapSM(hwnd, WM_CAP_GET_MCI_DEVICE, (WPARAM)(wSize), (LPARAM)(LPVOID)(LPTSTR)(szName)))
  326.  
  327. #define capPaletteOpen(hwnd, szName)               ((BOOL)AVICapSM(hwnd, WM_CAP_PAL_OPEN, 0, (LPARAM)(LPVOID)(LPTSTR)(szName)))
  328. #define capPaletteSave(hwnd, szName)               ((BOOL)AVICapSM(hwnd, WM_CAP_PAL_SAVE, 0, (LPARAM)(LPVOID)(LPTSTR)(szName)))
  329. #define capPalettePaste(hwnd)                      ((BOOL)AVICapSM(hwnd, WM_CAP_PAL_PASTE, (WPARAM) 0, (LPARAM)0L))
  330. #define capPaletteAuto(hwnd, iFrames, iColors)     ((BOOL)AVICapSM(hwnd, WM_CAP_PAL_AUTOCREATE, (WPARAM)(iFrames), (LPARAM)(DWORD)(iColors)))
  331. #define capPaletteManual(hwnd, fGrab, iColors)     ((BOOL)AVICapSM(hwnd, WM_CAP_PAL_MANUALCREATE, (WPARAM)(fGrab), (LPARAM)(DWORD)(iColors)))
  332.  
  333. // ------------------------------------------------------------------
  334. //  Structures
  335. // ------------------------------------------------------------------
  336.  
  337. typedef struct tagCapDriverCaps {
  338.     UINT        wDeviceIndex;               // Driver index in system.ini
  339.     BOOL        fHasOverlay;                // Can device overlay?
  340.     BOOL        fHasDlgVideoSource;         // Has Video source dlg?
  341.     BOOL        fHasDlgVideoFormat;         // Has Format dlg?
  342.     BOOL        fHasDlgVideoDisplay;        // Has External out dlg?
  343.     BOOL        fCaptureInitialized;        // Driver ready to capture?
  344.     BOOL        fDriverSuppliesPalettes;    // Can driver make palettes?
  345.  
  346. // following always NULL on Win32.
  347.     HANDLE      hVideoIn;                   // Driver In channel
  348.     HANDLE      hVideoOut;                  // Driver Out channel
  349.     HANDLE      hVideoExtIn;                // Driver Ext In channel
  350.     HANDLE      hVideoExtOut;               // Driver Ext Out channel
  351. } CAPDRIVERCAPS, *PCAPDRIVERCAPS, FAR *LPCAPDRIVERCAPS;
  352.  
  353. typedef struct tagCapStatus {
  354.     UINT        uiImageWidth;               // Width of the image
  355.     UINT        uiImageHeight;              // Height of the image
  356.     BOOL        fLiveWindow;                // Now Previewing video?
  357.     BOOL        fOverlayWindow;             // Now Overlaying video?
  358.     BOOL        fScale;                     // Scale image to client?
  359.     POINT       ptScroll;                   // Scroll position
  360.     BOOL        fUsingDefaultPalette;       // Using default driver palette?
  361.     BOOL        fAudioHardware;             // Audio hardware present?
  362.     BOOL        fCapFileExists;             // Does capture file exist?
  363.     DWORD       dwCurrentVideoFrame;        // # of video frames cap'td
  364.     DWORD       dwCurrentVideoFramesDropped;// # of video frames dropped
  365.     DWORD       dwCurrentWaveSamples;       // # of wave samples cap'td
  366.     DWORD       dwCurrentTimeElapsedMS;     // Elapsed capture duration
  367.     HPALETTE    hPalCurrent;                // Current palette in use
  368.     BOOL        fCapturingNow;              // Capture in progress?
  369.     DWORD       dwReturn;                   // Error value after any operation
  370.     UINT        wNumVideoAllocated;         // Actual number of video buffers
  371.     UINT        wNumAudioAllocated;         // Actual number of audio buffers
  372. } CAPSTATUS, *PCAPSTATUS, FAR *LPCAPSTATUS;
  373.  
  374.                         // Default values in parenthesis
  375. typedef struct tagCaptureParms {
  376.     DWORD       dwRequestMicroSecPerFrame;  // Requested capture rate
  377.     BOOL        fMakeUserHitOKToCapture;    // Show "Hit OK to cap" dlg?
  378.     UINT        wPercentDropForError;       // Give error msg if > (10%)
  379.     BOOL        fYield;                     // Capture via background task?
  380.     DWORD       dwIndexSize;                // Max index size in frames (32K)
  381.     UINT        wChunkGranularity;          // Junk chunk granularity (2K)
  382.     BOOL        fUsingDOSMemory;            // Use DOS buffers?
  383.     UINT        wNumVideoRequested;         // # video buffers, If 0, autocalc
  384.     BOOL        fCaptureAudio;              // Capture audio?
  385.     UINT        wNumAudioRequested;         // # audio buffers, If 0, autocalc
  386.     UINT        vKeyAbort;                  // Virtual key causing abort
  387.     BOOL        fAbortLeftMouse;            // Abort on left mouse?
  388.     BOOL        fAbortRightMouse;           // Abort on right mouse?
  389.     BOOL        fLimitEnabled;              // Use wTimeLimit?
  390.     UINT        wTimeLimit;                 // Seconds to capture
  391.     BOOL        fMCIControl;                // Use MCI video source?
  392.     BOOL        fStepMCIDevice;             // Step MCI device?
  393.     DWORD       dwMCIStartTime;             // Time to start in MS
  394.     DWORD       dwMCIStopTime;              // Time to stop in MS
  395.     BOOL        fStepCaptureAt2x;           // Perform spatial averaging 2x
  396.     UINT        wStepCaptureAverageFrames;  // Temporal average n Frames
  397.     DWORD       dwAudioBufferSize;          // Size of audio bufs (0 = default)
  398.     BOOL        fDisableWriteCache;         // Attempt to disable write cache
  399. } CAPTUREPARMS, *PCAPTUREPARMS, FAR *LPCAPTUREPARMS;
  400.  
  401. typedef struct tagCapInfoChunk {
  402.     FOURCC      fccInfoID;                  // Chunk ID, "ICOP" for copyright
  403.     LPVOID      lpData;                     // pointer to data
  404.     LONG        cbData;                     // size of lpData
  405. } CAPINFOCHUNK, *PCAPINFOCHUNK, FAR *LPCAPINFOCHUNK;
  406.  
  407.  
  408. // ------------------------------------------------------------------
  409. //  Callback Definitions
  410. // ------------------------------------------------------------------
  411.  
  412. typedef LRESULT (CALLBACK* CAPYIELDCALLBACK)  (HWND hWnd);
  413. #ifdef _WIN32
  414. typedef LRESULT (CALLBACK* CAPSTATUSCALLBACKW) (HWND hWnd, int nID, LPCWSTR lpsz);
  415. typedef LRESULT (CALLBACK* CAPERRORCALLBACKW)  (HWND hWnd, int nID, LPCWSTR lpsz);
  416. typedef LRESULT (CALLBACK* CAPSTATUSCALLBACKA) (HWND hWnd, int nID, LPCSTR lpsz);
  417. typedef LRESULT (CALLBACK* CAPERRORCALLBACKA)  (HWND hWnd, int nID, LPCSTR lpsz);
  418. #ifdef UNICODE
  419. #define CAPSTATUSCALLBACK  CAPSTATUSCALLBACKW
  420. #define CAPERRORCALLBACK   CAPERRORCALLBACKW
  421. #else
  422. #define CAPSTATUSCALLBACK  CAPSTATUSCALLBACKA
  423. #define CAPERRORCALLBACK   CAPERRORCALLBACKA
  424. #endif
  425. #else
  426. typedef LRESULT (CALLBACK* CAPSTATUSCALLBACK) (HWND hWnd, int nID, LPCSTR lpsz);
  427. typedef LRESULT (CALLBACK* CAPERRORCALLBACK)  (HWND hWnd, int nID, LPCSTR lpsz);
  428. #endif
  429. typedef LRESULT (CALLBACK* CAPVIDEOCALLBACK)  (HWND hWnd, LPVIDEOHDR lpVHdr);
  430. typedef LRESULT (CALLBACK* CAPWAVECALLBACK)   (HWND hWnd, LPWAVEHDR lpWHdr);
  431. typedef LRESULT (CALLBACK* CAPCONTROLCALLBACK)(HWND hWnd, int nState);
  432.  
  433. // ------------------------------------------------------------------
  434. //  CapControlCallback states
  435. // ------------------------------------------------------------------
  436. #define CONTROLCALLBACK_PREROLL         1 /* Waiting to start capture */
  437. #define CONTROLCALLBACK_CAPTURING       2 /* Now capturing */
  438.  
  439. // ------------------------------------------------------------------
  440. //  The only exported functions from AVICAP.DLL
  441. // ------------------------------------------------------------------
  442.  
  443. #ifdef _WIN32
  444. HWND VFWAPI capCreateCaptureWindowA (
  445.     LPCSTR lpszWindowName,
  446.     DWORD dwStyle,
  447.     int x, int y, int nWidth, int nHeight,
  448.     HWND hwndParent, int nID);
  449.  
  450. BOOL VFWAPI capGetDriverDescriptionA (UINT wDriverIndex,
  451.     LPSTR lpszName, int cbName,
  452.     LPSTR lpszVer, int cbVer);
  453.  
  454. HWND VFWAPI capCreateCaptureWindowW (
  455.     LPCWSTR lpszWindowName,
  456.     DWORD dwStyle,
  457.     int x, int y, int nWidth, int nHeight,
  458.     HWND hwndParent, int nID);
  459.  
  460. BOOL VFWAPI capGetDriverDescriptionW (UINT wDriverIndex,
  461.     LPWSTR lpszName, int cbName,
  462.     LPWSTR lpszVer, int cbVer);
  463. #ifdef UNICODE
  464. #define capCreateCaptureWindow  capCreateCaptureWindowW
  465. #define capGetDriverDescription capGetDriverDescriptionW
  466. #else
  467. #define capCreateCaptureWindow  capCreateCaptureWindowA
  468. #define capGetDriverDescription capGetDriverDescriptionA
  469. #endif
  470. #else
  471. HWND VFWAPI capCreateCaptureWindow (
  472.     LPCSTR lpszWindowName,
  473.     DWORD dwStyle,
  474.     int x, int y, int nWidth, int nHeight,
  475.     HWND hwndParent, int nID);
  476.  
  477. BOOL VFWAPI capGetDriverDescription (UINT wDriverIndex,
  478.     LPSTR lpszName, int cbName,
  479.     LPSTR lpszVer, int cbVer);
  480. #endif
  481.  
  482. #endif  /* RC_INVOKED */
  483.  
  484. // ------------------------------------------------------------------
  485. // New Information chunk IDs
  486. // ------------------------------------------------------------------
  487. #define infotypeDIGITIZATION_TIME  mmioFOURCC ('I','D','I','T')
  488. #define infotypeSMPTE_TIME         mmioFOURCC ('I','S','M','P')
  489.  
  490. // ------------------------------------------------------------------
  491. // String IDs from status and error callbacks
  492. // ------------------------------------------------------------------
  493.  
  494. #define IDS_CAP_BEGIN               300  /* "Capture Start" */
  495. #define IDS_CAP_END                 301  /* "Capture End" */
  496.  
  497. #define IDS_CAP_INFO                401  /* "%s" */
  498. #define IDS_CAP_OUTOFMEM            402  /* "Out of memory" */
  499. #define IDS_CAP_FILEEXISTS          403  /* "File '%s' exists -- overwrite it?" */
  500. #define IDS_CAP_ERRORPALOPEN        404  /* "Error opening palette '%s'" */
  501. #define IDS_CAP_ERRORPALSAVE        405  /* "Error saving palette '%s'" */
  502. #define IDS_CAP_ERRORDIBSAVE        406  /* "Error saving frame '%s'" */
  503. #define IDS_CAP_DEFAVIEXT           407  /* "avi" */
  504. #define IDS_CAP_DEFPALEXT           408  /* "pal" */
  505. #define IDS_CAP_CANTOPEN            409  /* "Cannot open '%s'" */
  506. #define IDS_CAP_SEQ_MSGSTART        410  /* "Select OK to start capture\nof video sequence\nto %s." */
  507. #define IDS_CAP_SEQ_MSGSTOP         411  /* "Hit ESCAPE or click to end capture" */
  508.  
  509. #define IDS_CAP_VIDEDITERR          412  /* "An error occurred while trying to run VidEdit." */
  510. #define IDS_CAP_READONLYFILE        413  /* "The file '%s' is a read-only file." */
  511. #define IDS_CAP_WRITEERROR          414  /* "Unable to write to file '%s'.\nDisk may be full." */
  512. #define IDS_CAP_NODISKSPACE         415  /* "There is no space to create a capture file on the specified device." */
  513. #define IDS_CAP_SETFILESIZE         416  /* "Set File Size" */
  514. #define IDS_CAP_SAVEASPERCENT       417  /* "SaveAs: %2ld%%  Hit Escape to abort." */
  515.  
  516. #define IDS_CAP_DRIVER_ERROR        418  /* Driver specific error message */
  517.  
  518. #define IDS_CAP_WAVE_OPEN_ERROR     419  /* "Error: Cannot open the wave input device.\nCheck sample size, frequency, and channels." */
  519. #define IDS_CAP_WAVE_ALLOC_ERROR    420  /* "Error: Out of memory for wave buffers." */
  520. #define IDS_CAP_WAVE_PREPARE_ERROR  421  /* "Error: Cannot prepare wave buffers." */
  521. #define IDS_CAP_WAVE_ADD_ERROR      422  /* "Error: Cannot add wave buffers." */
  522. #define IDS_CAP_WAVE_SIZE_ERROR     423  /* "Error: Bad wave size." */
  523.  
  524. #define IDS_CAP_VIDEO_OPEN_ERROR    424  /* "Error: Cannot open the video input device." */
  525. #define IDS_CAP_VIDEO_ALLOC_ERROR   425  /* "Error: Out of memory for video buffers." */
  526. #define IDS_CAP_VIDEO_PREPARE_ERROR 426  /* "Error: Cannot prepare video buffers." */
  527. #define IDS_CAP_VIDEO_ADD_ERROR     427  /* "Error: Cannot add video buffers." */
  528. #define IDS_CAP_VIDEO_SIZE_ERROR    428  /* "Error: Bad video size." */
  529.  
  530. #define IDS_CAP_FILE_OPEN_ERROR     429  /* "Error: Cannot open capture file." */
  531. #define IDS_CAP_FILE_WRITE_ERROR    430  /* "Error: Cannot write to capture file.  Disk may be full." */
  532. #define IDS_CAP_RECORDING_ERROR     431  /* "Error: Cannot write to capture file.  Data rate too high or disk full." */
  533. #define IDS_CAP_RECORDING_ERROR2    432  /* "Error while recording" */
  534. #define IDS_CAP_AVI_INIT_ERROR      433  /* "Error: Unable to initialize for capture." */
  535. #define IDS_CAP_NO_FRAME_CAP_ERROR  434  /* "Warning: No frames captured.\nConfirm that vertical sync interrupts\nare configured and enabled." */
  536. #define IDS_CAP_NO_PALETTE_WARN     435  /* "Warning: Using default palette." */
  537. #define IDS_CAP_MCI_CONTROL_ERROR   436  /* "Error: Unable to access MCI device." */
  538. #define IDS_CAP_MCI_CANT_STEP_ERROR 437  /* "Error: Unable to step MCI device." */
  539. #define IDS_CAP_NO_AUDIO_CAP_ERROR  438  /* "Error: No audio data captured.\nCheck audio card settings." */
  540. #define IDS_CAP_AVI_DRAWDIB_ERROR   439  /* "Error: Unable to draw this data format." */
  541. #define IDS_CAP_COMPRESSOR_ERROR    440  /* "Error: Unable to initialize compressor." */
  542. #define IDS_CAP_AUDIO_DROP_ERROR    441  /* "Error: Audio data was lost during capture, reduce capture rate." */
  543.  
  544. /* status string IDs */
  545. #define IDS_CAP_STAT_LIVE_MODE      500  /* "Live window" */
  546. #define IDS_CAP_STAT_OVERLAY_MODE   501  /* "Overlay window" */
  547. #define IDS_CAP_STAT_CAP_INIT       502  /* "Setting up for capture - Please wait" */
  548. #define IDS_CAP_STAT_CAP_FINI       503  /* "Finished capture, now writing frame %ld" */
  549. #define IDS_CAP_STAT_PALETTE_BUILD  504  /* "Building palette map" */
  550. #define IDS_CAP_STAT_OPTPAL_BUILD   505  /* "Computing optimal palette" */
  551. #define IDS_CAP_STAT_I_FRAMES       506  /* "%d frames" */
  552. #define IDS_CAP_STAT_L_FRAMES       507  /* "%ld frames" */
  553. #define IDS_CAP_STAT_CAP_L_FRAMES   508  /* "Captured %ld frames" */
  554. #define IDS_CAP_STAT_CAP_AUDIO      509  /* "Capturing audio" */
  555. #define IDS_CAP_STAT_VIDEOCURRENT   510  /* "Captured %ld frames (%ld dropped) %d.%03d sec." */
  556. #define IDS_CAP_STAT_VIDEOAUDIO     511  /* "Captured %d.%03d sec.  %ld frames (%ld dropped) (%d.%03d fps).  %ld audio bytes (%d,%03d sps)" */
  557. #define IDS_CAP_STAT_VIDEOONLY      512  /* "Captured %d.%03d sec.  %ld frames (%ld dropped) (%d.%03d fps)" */
  558. #define IDS_CAP_STAT_FRAMESDROPPED  513  /* "Dropped %ld of %ld frames (%d.%02d%%) during capture." */
  559.  
  560. #ifdef __BORLANDC__
  561.  
  562.   #include <poppack.h>
  563.  
  564. #endif
  565.  
  566. #ifdef __cplusplus
  567. }                       /* End of extern "C" { */
  568. #endif    /* __cplusplus */
  569.  
  570. #pragma option pop
  571. #pragma option pop /*P_O_Pop*/
  572. #endif /* INC_AVICAP */
  573.