home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 June / Chip_2002-06_cd1.bin / zkuste / delphi / kompon / d23456 / WAVICAP.ZIP / avicap / TAviCap / AviCapH.pas < prev   
Encoding:
Pascal/Delphi Source File  |  2002-04-04  |  24.1 KB  |  650 lines

  1. {
  2.  ****************************************************************************
  3.  *                                                                          *
  4.  *  Translated from  avicap.h                                               *
  5.  *                                                                          *
  6.  *   Main include file.                                                     *
  7.  *                                                                          *
  8.  *   Microsoft Video for Windows Sample Capture Class                       *
  9.  *                                                                          *
  10.  *                                                                          *
  11.  *      C/C++ Run Time Library - Version 8.0                                *
  12.  *                                                                          *
  13.  *      Copyright (c) 1994, 1997 by Borland International                   *
  14.  *      All Rights Reserved.                                                *
  15.  *                                                                          *
  16.  *                                                                          *
  17.  ****************************************************************************
  18. }
  19. unit AviCapH;
  20.  
  21. interface
  22.  
  23. uses windows, messages;
  24.  
  25. // ------------------------------------------------------------------
  26. //  Window Messages  WM_CAP... which can be sent to an AVICAP window
  27. // ------------------------------------------------------------------
  28.  
  29. // Defines start of the message range
  30. const
  31.   avicap32 = 'avicap32.dll';
  32.  
  33.   WM_CAP_START = WM_USER;
  34.  
  35.   // start of unicode messages
  36.   WM_CAP_UNICODE_START = WM_USER + 100;
  37.  
  38.   WM_CAP_GET_CAPSTREAMPTR = (WM_CAP_START + 1);
  39.  
  40.   WM_CAP_SET_CALLBACK_ERROR = (WM_CAP_START + 2);
  41.   WM_CAP_SET_CALLBACK_STATUS = (WM_CAP_START + 3);
  42.  
  43.   WM_CAP_SET_CALLBACK_YIELD = (WM_CAP_START + 4);
  44.   WM_CAP_SET_CALLBACK_FRAME = (WM_CAP_START + 5);
  45.   WM_CAP_SET_CALLBACK_VIDEOSTREAM = (WM_CAP_START + 6);
  46.   WM_CAP_SET_CALLBACK_WAVESTREAM = (WM_CAP_START + 7);
  47.   WM_CAP_GET_USER_DATA = (WM_CAP_START + 8);
  48.   WM_CAP_SET_USER_DATA = (WM_CAP_START + 9);
  49.  
  50.   WM_CAP_DRIVER_CONNECT = (WM_CAP_START + 10);
  51.   WM_CAP_DRIVER_DISCONNECT = (WM_CAP_START + 11);
  52.  
  53.   WM_CAP_DRIVER_GET_NAME = (WM_CAP_START + 12);
  54.   WM_CAP_DRIVER_GET_VERSION = (WM_CAP_START + 13);
  55.  
  56.   WM_CAP_DRIVER_GET_CAPS = (WM_CAP_START + 14);
  57.  
  58.   WM_CAP_FILE_SET_CAPTURE_FILE = (WM_CAP_START + 20);
  59.   WM_CAP_FILE_GET_CAPTURE_FILE = (WM_CAP_START + 21);
  60.   WM_CAP_FILE_SAVEAS = (WM_CAP_START + 23);
  61.   WM_CAP_FILE_SAVEDIB = (WM_CAP_START + 25);
  62.  
  63.   // out of order to save on ifdefs
  64.   WM_CAP_FILE_ALLOCATE = (WM_CAP_START + 22);
  65.   WM_CAP_FILE_SET_INFOCHUNK = (WM_CAP_START + 24);
  66.  
  67.   WM_CAP_EDIT_COPY = (WM_CAP_START + 30);
  68.  
  69.   WM_CAP_SET_AUDIOFORMAT = (WM_CAP_START + 35);
  70.   WM_CAP_GET_AUDIOFORMAT = (WM_CAP_START + 36);
  71.  
  72.   WM_CAP_DLG_VIDEOFORMAT = (WM_CAP_START + 41);
  73.   WM_CAP_DLG_VIDEOSOURCE = (WM_CAP_START + 42);
  74.   WM_CAP_DLG_VIDEODISPLAY = (WM_CAP_START + 43);
  75.   WM_CAP_GET_VIDEOFORMAT = (WM_CAP_START + 44);
  76.   WM_CAP_SET_VIDEOFORMAT = (WM_CAP_START + 45);
  77.   WM_CAP_DLG_VIDEOCOMPRESSION = (WM_CAP_START + 46);
  78.  
  79.   WM_CAP_SET_PREVIEW = (WM_CAP_START + 50);
  80.   WM_CAP_SET_OVERLAY = (WM_CAP_START + 51);
  81.   WM_CAP_SET_PREVIEWRATE = (WM_CAP_START + 52);
  82.   WM_CAP_SET_SCALE = (WM_CAP_START + 53);
  83.   WM_CAP_GET_STATUS = (WM_CAP_START + 54);
  84.   WM_CAP_SET_SCROLL = (WM_CAP_START + 55);
  85.  
  86.   WM_CAP_GRAB_FRAME = (WM_CAP_START + 60);
  87.   WM_CAP_GRAB_FRAME_NOSTOP = (WM_CAP_START + 61);
  88.  
  89.   WM_CAP_SEQUENCE = (WM_CAP_START + 62);
  90.   WM_CAP_SEQUENCE_NOFILE = (WM_CAP_START + 63);
  91.   WM_CAP_SET_SEQUENCE_SETUP = (WM_CAP_START + 64);
  92.   WM_CAP_GET_SEQUENCE_SETUP = (WM_CAP_START + 65);
  93.  
  94.   WM_CAP_SET_MCI_DEVICE = (WM_CAP_START + 66);
  95.   WM_CAP_GET_MCI_DEVICE = (WM_CAP_START + 67);
  96.  
  97.   WM_CAP_STOP = (WM_CAP_START + 68);
  98.   WM_CAP_ABORT = (WM_CAP_START + 69);
  99.  
  100.   WM_CAP_SINGLE_FRAME_OPEN = (WM_CAP_START + 70);
  101.   WM_CAP_SINGLE_FRAME_CLOSE = (WM_CAP_START + 71);
  102.   WM_CAP_SINGLE_FRAME = (WM_CAP_START + 72);
  103.  
  104.   WM_CAP_PAL_OPEN = (WM_CAP_START + 80);
  105.   WM_CAP_PAL_SAVE = (WM_CAP_START + 81);
  106.  
  107.   WM_CAP_PAL_PASTE = (WM_CAP_START + 82);
  108.   WM_CAP_PAL_AUTOCREATE = (WM_CAP_START + 83);
  109.   WM_CAP_PAL_MANUALCREATE = (WM_CAP_START + 84);
  110.  
  111.   // Following added post VFW 1.1
  112.   WM_CAP_SET_CALLBACK_CAPCONTROL = (WM_CAP_START + 85);
  113.  
  114.   WM_CAP_END = WM_CAP_SET_CALLBACK_CAPCONTROL;
  115.  
  116.   CAP_MSG = WM_CAP_UNICODE_START + 100;
  117.  
  118. function capCreateCaptureWindowA(
  119.   lpszWindowName: PChar;
  120.   dwStyle: DWORD;
  121.   x, y, nWidth, nHeight: Integer;
  122.   hwndParent: HWnd; nID: Integer): hwnd; stdcall; external avicap32;
  123.  
  124. function capGetDriverDescriptionA(
  125.   wDriverIndex: UINT;
  126.   lpszName: PChar; cbName: Integer;
  127.   lpszVer: PChar; cbVer: Integer): Boolean; stdcall; external avicap32;
  128.  
  129. procedure capSetCallbackOnError(hCapWnd: hwnd; fpProc: Lparam);
  130. procedure capSetCallbackOnStatus(hCapWnd: hwnd; fpProc: LParam);
  131. procedure capSetCallbackOnYield(hCapWnd: hwnd; fpProc: LParam);
  132. procedure capSetCallbackOnFrame(hCapWnd: hwnd; fpProc: LParam);
  133. procedure capSetCallbackOnVideoStream(hCapWnd: hwnd; fpProc: LParam);
  134. procedure capSetCallbackOnWaveStream(hCapWnd: hwnd; fpProc: LParam);
  135. procedure capSetCallbackOnCapControl(hCapWnd: hwnd; fpProc: LParam);
  136. procedure capSetUserData(hCapWnd: hwnd; lUser: LParam);
  137. procedure capGetUserData(hCapWnd: hwnd);
  138. function capDriverConnect(hCapWnd: hwnd; i: wParam): Boolean;
  139. procedure capDriverDisconnect(hCapWnd: hwnd);
  140. procedure capDriverGetName(hCapWnd: hwnd; szName: wParam; wSize: LParam);
  141. procedure capDriverGetVersion(hCapWnd: hwnd; szVer: wParam; wSize: LParam);
  142. procedure capDriverGetCaps(hCapWnd: hwnd; s: wParam; wSize: LParam);
  143. procedure capFileSetCaptureFile(hCapWnd: hwnd; szName: LPARAM);
  144. procedure capFileGetCaptureFile(hCapWnd: hwnd; wSize: wPARAM; szName: LPARAM);
  145. procedure capFileAlloc(hCapWnd: hwnd; dwSize: LPARAM);
  146. procedure capFileSaveAs(hCapWnd: hwnd; szName: LPARAM);
  147. procedure capFileSetInfoChunk(hCapWnd: hwnd; lpInfoChunk: LPARAM);
  148. procedure capFileSaveDIB(hCapWnd: hwnd; szName: LPARAM);
  149. procedure capEditCopy(hCapWnd: hwnd);
  150. procedure capSetAudioFormat(hCapWnd: hwnd; s: WPARAM; wSize: LPARAM);
  151. procedure capGetAudioFormat(hCapWnd: hwnd; s: WPARAM; wSize: LPARAM);
  152. procedure capGetAudioFormatSize(hCapWnd: hwnd);
  153. procedure capDlgVideoFormat(hCapWnd: hwnd);
  154. procedure capDlgVideoSource(hCapWnd: hwnd);
  155. procedure capDlgVideoDisplay(hCapWnd: hwnd);
  156. procedure capDlgVideoCompression(hCapWnd: hwnd);
  157. procedure capGetVideoFormat(hCapWnd: hwnd; s: WPARAM; wSize: LPARAM);
  158. procedure capGetVideoFormatSize(hCapWnd: hwnd);
  159. procedure capSetVideoFormat(hCapWnd: hwnd; s: WPARAM; wSize: LPARAM);
  160. procedure capPreview(hCapWnd: hwnd; f: WPARAM);
  161. procedure capPreviewRate(hCapWnd: hwnd; wMS: WPARAM);
  162. procedure capOverlay(hCapWnd: hwnd; f: WPARAM);
  163. procedure capPreviewScale(hCapWnd: hwnd; f: WPARAM);
  164. procedure capGetStatus(hCapWnd: hwnd; s: WPARAM; wSize: LPARAM);
  165. procedure capSetScrollPos(hCapWnd: hwnd; lpP: LPARAM);
  166. procedure capGrabFrame(hCapWnd: hwnd);
  167. procedure capGrabFrameNoStop(hCapWnd: hwnd);
  168. procedure capCaptureSequence(hCapWnd: hwnd);
  169. procedure capCaptureSequenceNoFile(hCapWnd: hwnd);
  170. procedure capCaptureStop(hCapWnd: hwnd);
  171. procedure capCaptureAbort(hCapWnd: hwnd);
  172. procedure capCaptureSingleFrameOpen(hCapWnd: hwnd);
  173. procedure capCaptureSingleFrameClose(hCapWnd: hwnd);
  174. procedure capCaptureSingleFrame(hCapWnd: hwnd);
  175. procedure capCaptureGetSetup(hCapWnd: hwnd; s: WPARAM; wSize: LPARAM);
  176. procedure capCaptureSetSetup(hCapWnd: hwnd; s: WPARAM; wSize: LPARAM);
  177. procedure capSetMCIDeviceName(hCapWnd: hwnd; szName: LPARAM);
  178. procedure capGetMCIDeviceName(hCapWnd: hwnd; szName: LPARAM; wSize: WPARAM);
  179. procedure capPaletteOpen(hCapWnd: hwnd; szName: LPARAM);
  180. procedure capPaletteSave(hCapWnd: hwnd; szName: LPARAM);
  181. procedure capPalettePaste(hCapWnd: hwnd);
  182. procedure capPaletteAuto(hCapWnd: hwnd; iFrames: WPARAM; iColors: LPARAM);
  183. procedure capPaletteManual(hCapWnd: hwnd; fGrab: WPARAM; iColors: LPARAM);
  184.  
  185. // ------------------------------------------------------------------
  186. //  Structures
  187. // ------------------------------------------------------------------
  188.  
  189. type
  190.   TCapDriverCaps = record
  191.     wDeviceIndex: UINT; // Driver index in system.ini
  192.     fHasOverlay: BOOL; // Can device overlay?
  193.     fHasDlgVideoSource: BOOL; // Has Video source dlg?
  194.     fHasDlgVideoFormat: BOOL; // Has Format dlg?
  195.     fHasDlgVideoDisplay: BOOL; // Has External out dlg?
  196.     fCaptureInitialized: BOOL; // Driver ready to capture?
  197.     fDriverSuppliesPalettes: BOOL; // Can driver make palettes?
  198.  
  199.     // following always NULL on Win32.
  200.     hVideoIn: THANDLE; // Driver In channel
  201.     hVideoOut: THANDLE; // Driver Out channel
  202.     hVideoExtIn: THANDLE; // Driver Ext In channel
  203.     hVideoExtOut: THANDLE; // Driver Ext Out channel
  204.   end;
  205.  
  206. type
  207.   TCapStatus = record
  208.     uiImageWidth: UINT; // Width of the image
  209.     uiImageHeight: UINT; // Height of the image
  210.     fLiveWindow: BOOL; // Now Previewing video?
  211.     fOverlayWindow: BOOL; // Now Overlaying video?
  212.     fScale: BOOL; // Scale image to client?
  213.     ptScroll: TPOINT; // Scroll position
  214.     fUsingDefaultPalette: BOOL; // Using default driver palette?
  215.     fAudioHardware: BOOL; // Audio hardware present?
  216.     fCapFileExists: BOOL; // Does capture file exist?
  217.     dwCurrentVideoFrame: DWORD; // # of video frames cap'td
  218.     dwCurrentVideoFramesDropped: DWORD; // # of video frames dropped
  219.     dwCurrentWaveSamples: DWORD; // # of wave samples cap'td
  220.     dwCurrentTimeElapsedMS: DWORD; // Elapsed capture duration
  221.     hPalCurrent: HPALETTE; // Current palette in use
  222.     fCapturingNow: BOOL; // Capture in progress?
  223.     dwReturn: DWORD; // Error value after any operation
  224.     wNumVideoAllocated: UINT; // Actual number of video buffers
  225.     wNumAudioAllocated: UINT; // Actual number of audio buffers
  226.   end;
  227.  
  228. type
  229.   TCaptureParms = record
  230.     dwRequestMicroSecPerFrame: DWORD; // Requested capture rate
  231.     fMakeUserHitOKToCapture: BOOL; // Show "Hit OK to cap" dlg?
  232.     wPercentDropForError: UINT; // Give error msg if > (10%)
  233.     fYield: BOOL; // Capture via background task?
  234.     dwIndexSize: DWORD; // Max index size in frames (32K)
  235.     wChunkGranularity: UINT; // Junk chunk granularity (2K)
  236.     fUsingDOSMemory: BOOL; // Use DOS buffers?
  237.     wNumVideoRequested: UINT; // # video buffers, If 0, autocalc
  238.     fCaptureAudio: BOOL; // Capture audio?
  239.     wNumAudioRequested: UINT; // # audio buffers, If 0, autocalc
  240.     vKeyAbort: UINT; // Virtual key causing abort
  241.     fAbortLeftMouse: BOOL; // Abort on left mouse?
  242.     fAbortRightMouse: BOOL; // Abort on right mouse?
  243.     fLimitEnabled: BOOL; // Use wTimeLimit?
  244.     wTimeLimit: UINT; // Seconds to capture
  245.     fMCIControl: BOOL; // Use MCI video source?
  246.     fStepMCIDevice: BOOL; // Step MCI device?
  247.     dwMCIStartTime: DWORD; // Time to start in MS
  248.     dwMCIStopTime: DWORD; // Time to stop in MS
  249.     fStepCaptureAt2x: BOOL; // Perform spatial averaging 2x
  250.     wStepCaptureAverageFrames: UINT; // Temporal average n Frames
  251.     dwAudioBufferSize: DWORD; // Size of audio bufs (0 = default)
  252.     fDisableWriteCache: BOOL; // Attempt to disable write cache
  253.     AVStreamMaster: DWORD;
  254.  
  255.   end;
  256.  
  257. type
  258.   TByteRec = record
  259.     Lo, Hi: Byte;
  260.   end;
  261.  
  262.   TWordRec = record
  263.     Low, High: TByteRec;
  264.   end;
  265.  
  266. type
  267.   FOURCC = TWordRec;
  268.  
  269. function mmioFOURCC(const c0, c1, c2, c3: Char): FOURCC;
  270.  
  271. type
  272.   TCapInfoChunk = record
  273.     fccInfoID: FOURCC; // Chunk ID, "ICOP" for copyright
  274.     lpData: Pointer; // pointer to data
  275.     cbData: LONGINT; // size of lpData
  276.   end;
  277.  
  278.   // ------------------------------------------------------------------
  279.   //  CapControlCallback states
  280.   // ------------------------------------------------------------------
  281. const
  282.   CONTROLCALLBACK_PREROLL = 1; //* Waiting to start capture */
  283.   CONTROLCALLBACK_CAPTURING = 2; //* Now capturing */
  284.  
  285.   // ------------------------------------------------------------------
  286.   // New Information chunk IDs
  287.   // ------------------------------------------------------------------
  288.  
  289.   // DIGITIZATION_TIME = mmioFOURCC ('I','D','I','T');
  290.   // infotypeSMPTE_TIME         mmioFOURCC ('I','S','M','P')
  291.  
  292.   // ------------------------------------------------------------------
  293.   // String IDs from status and error callbacks
  294.   // ------------------------------------------------------------------
  295.   {
  296.     IDS_CAP_BEGIN               300  /* "Capture Start" */
  297.    IDS_CAP_END                 301  /* "Capture End" */
  298.  
  299.    IDS_CAP_INFO                401  /* "%s" */
  300.    IDS_CAP_OUTOFMEM            402  /* "Out of memory" */
  301.    IDS_CAP_FILEEXISTS          403  /* "File '%s' exists -- overwrite it?" */
  302.    IDS_CAP_ERRORPALOPEN        404  /* "Error opening palette '%s'" */
  303.    IDS_CAP_ERRORPALSAVE        405  /* "Error saving palette '%s'" */
  304.    IDS_CAP_ERRORDIBSAVE        406  /* "Error saving frame '%s'" */
  305.    IDS_CAP_DEFAVIEXT           407  /* "avi" */
  306.    IDS_CAP_DEFPALEXT           408  /* "pal" */
  307.    IDS_CAP_CANTOPEN            409  /* "Cannot open '%s'" */
  308.    IDS_CAP_SEQ_MSGSTART        410  /* "Select OK to start capture\nof video sequence\nto %s." */
  309.    IDS_CAP_SEQ_MSGSTOP         411  /* "Hit ESCAPE or click to end capture" */
  310.  
  311.    IDS_CAP_VIDEDITERR          412  /* "An error occurred while trying to run VidEdit." */
  312.    IDS_CAP_READONLYFILE        413  /* "The file '%s' is a read-only file." */
  313.    IDS_CAP_WRITEERROR          414  /* "Unable to write to file '%s'.\nDisk may be full." */
  314.    IDS_CAP_NODISKSPACE         415  /* "There is no space to create a capture file on the specified device." */
  315.    IDS_CAP_SETFILESIZE         416  /* "Set File Size" */
  316.    IDS_CAP_SAVEASPERCENT       417  /* "SaveAs: %2ld%%  Hit Escape to abort." */
  317.  
  318.    IDS_CAP_DRIVER_ERROR        418  /* Driver specific error message */
  319.  
  320.    IDS_CAP_WAVE_OPEN_ERROR     419  /* "Error: Cannot open the wave input device.\nCheck sample size, frequency, and channels." */
  321.    IDS_CAP_WAVE_ALLOC_ERROR    420  /* "Error: Out of memory for wave buffers." */
  322.    IDS_CAP_WAVE_PREPARE_ERROR  421  /* "Error: Cannot prepare wave buffers." */
  323.    IDS_CAP_WAVE_ADD_ERROR      422  /* "Error: Cannot add wave buffers." */
  324.    IDS_CAP_WAVE_SIZE_ERROR     423  /* "Error: Bad wave size." */
  325.  
  326.    IDS_CAP_VIDEO_OPEN_ERROR    424  /* "Error: Cannot open the video input device." */
  327.    IDS_CAP_VIDEO_ALLOC_ERROR   425  /* "Error: Out of memory for video buffers." */
  328.    IDS_CAP_VIDEO_PREPARE_ERROR 426  /* "Error: Cannot prepare video buffers." */
  329.    IDS_CAP_VIDEO_ADD_ERROR     427  /* "Error: Cannot add video buffers." */
  330.    IDS_CAP_VIDEO_SIZE_ERROR    428  /* "Error: Bad video size." */
  331.  
  332.    IDS_CAP_FILE_OPEN_ERROR     429  /* "Error: Cannot open capture file." */
  333.    IDS_CAP_FILE_WRITE_ERROR    430  /* "Error: Cannot write to capture file.  Disk may be full." */
  334.    IDS_CAP_RECORDING_ERROR     431  /* "Error: Cannot write to capture file.  Data rate too high or disk full." */
  335.    IDS_CAP_RECORDING_ERROR2    432  /* "Error while recording" */
  336.    IDS_CAP_AVI_INIT_ERROR      433  /* "Error: Unable to initialize for capture." */
  337.    IDS_CAP_NO_FRAME_CAP_ERROR  434  /* "Warning: No frames captured.\nConfirm that vertical sync interrupts\nare configured and enabled." */
  338.    IDS_CAP_NO_PALETTE_WARN     435  /* "Warning: Using default palette." */
  339.    IDS_CAP_MCI_CONTROL_ERROR   436  /* "Error: Unable to access MCI device." */
  340.    IDS_CAP_MCI_CANT_STEP_ERROR 437  /* "Error: Unable to step MCI device." */
  341.    IDS_CAP_NO_AUDIO_CAP_ERROR  438  /* "Error: No audio data captured.\nCheck audio card settings." */
  342.    IDS_CAP_AVI_DRAWDIB_ERROR   439  /* "Error: Unable to draw this data format." */
  343.    IDS_CAP_COMPRESSOR_ERROR    440  /* "Error: Unable to initialize compressor." */
  344.    IDS_CAP_AUDIO_DROP_ERROR    441  /* "Error: Audio data was lost during capture, reduce capture rate." */
  345.  
  346.   /* status string IDs */
  347.    IDS_CAP_STAT_LIVE_MODE      500  /* "Live window" */
  348.    IDS_CAP_STAT_OVERLAY_MODE   501  /* "Overlay window" */
  349.    IDS_CAP_STAT_CAP_INIT       502  /* "Setting up for capture - Please wait" */
  350.    IDS_CAP_STAT_CAP_FINI       503  /* "Finished capture, now writing frame %ld" */
  351.    IDS_CAP_STAT_PALETTE_BUILD  504  /* "Building palette map" */
  352.    IDS_CAP_STAT_OPTPAL_BUILD   505  /* "Computing optimal palette" */
  353.    IDS_CAP_STAT_I_FRAMES       506  /* "%d frames" */
  354.    IDS_CAP_STAT_L_FRAMES       507  /* "%ld frames" */
  355.    IDS_CAP_STAT_CAP_L_FRAMES   508  /* "Captured %ld frames" */
  356.    IDS_CAP_STAT_CAP_AUDIO      509  /* "Capturing audio" */
  357.    IDS_CAP_STAT_VIDEOCURRENT   510  /* "Captured %ld frames (%ld dropped); //%d.%03d sec." */
  358.    IDS_CAP_STAT_VIDEOAUDIO     511  /* "Captured %d.%03d sec.  %ld frames (%ld dropped); //(%d.%03d fps).  %ld audio bytes (%d,%03d sps)" */
  359.    IDS_CAP_STAT_VIDEOONLY      512  /* "Captured %d.%03d sec.  %ld frames (%ld dropped); //(%d.%03d fps)" */
  360.    IDS_CAP_STAT_FRAMESDROPPED  513  /* "Dropped %ld of %ld frames (%d.%02d%%); //during capture." */
  361.    }
  362.  
  363. implementation
  364.  
  365. function mmioFOURCC(const c0, c1, c2, c3: Char): FOURCC;
  366. begin
  367.   result.High.Hi := Byte(c0);
  368.   result.High.Lo := Byte(c1);
  369.   result.Low.Hi := Byte(c2);
  370.   result.Low.Lo := Byte(c3);
  371. end;
  372.  
  373. procedure capSetCallbackOnError(hCapWnd: hwnd; fpProc: Lparam);
  374. begin
  375.   SendMessage(hCapWnd, WM_CAP_SET_CALLBACK_ERROR, 0, fpProc)
  376. end;
  377.  
  378. procedure capSetCallbackOnStatus(hCapWnd: hwnd; fpProc: LParam);
  379. begin
  380.   SendMessage(hCapWnd, WM_CAP_SET_CALLBACK_Status, 0, fpProc)
  381. end;
  382.  
  383. procedure capSetCallbackOnYield(hCapWnd: hwnd; fpProc: LParam);
  384. begin
  385.   SendMessage(hCapWnd, WM_CAP_SET_CALLBACK_YIELD, 0, fpProc)
  386. end;
  387.  
  388. procedure capSetCallbackOnFrame(hCapWnd: hwnd; fpProc: LParam);
  389. begin
  390.   SendMessage(hCapWnd, WM_CAP_SET_CALLBACK_FRAME, 0, fpProc)
  391. end;
  392.  
  393. procedure capSetCallbackOnVideoStream(hCapWnd: hwnd; fpProc: LParam);
  394. begin
  395.   SendMessage(hCapWnd, WM_CAP_SET_CALLBACK_VideoSTREAM, 0, fpProc)
  396. end;
  397.  
  398. procedure capSetCallbackOnWaveStream(hCapWnd: hwnd; fpProc: LParam);
  399. begin
  400.   SendMessage(hCapWnd, WM_CAP_SET_CALLBACK_WAVESTREAM, 0, fpProc)
  401. end;
  402.  
  403. procedure capSetCallbackOnCapControl(hCapWnd: hwnd; fpProc: LParam);
  404. begin
  405.   SendMessage(hCapWnd, WM_CAP_SET_CALLBACK_CapControl, 0, fpProc)
  406. end;
  407.  
  408. procedure capGetUserData(hCapWnd: hwnd);
  409. begin
  410.   SendMessage(hCapWnd, WM_CAP_GET_USER_DATA, 0, 0)
  411. end;
  412.  
  413. procedure capSetUserData(hCapWnd: hwnd; lUser: LParam);
  414. begin
  415.   SendMessage(hCapWnd, WM_CAP_SET_USER_DATA, 0, lUser)
  416. end;
  417.  
  418. function capDriverConnect(hCapWnd: hwnd; i: wParam): Boolean;
  419. begin
  420.   result := SendMessage(hCapWnd, WM_CAP_DRIVER_CONNECT, i, 0) <> 0;
  421. end;
  422.  
  423. procedure capDriverDisconnect(hCapWnd: hwnd);
  424. begin
  425.   SendMessage(hCapWnd, WM_CAP_DRIVER_DISCONNECT, 0, 0)
  426. end;
  427.  
  428. procedure capDriverGetName(hCapWnd: hwnd; szName: wParam; wSize: LParam);
  429. begin
  430.   SendMessage(hCapWnd, WM_CAP_DRIVER_Get_Name, szName, wSize)
  431. end;
  432.  
  433. procedure capDriverGetVersion(hCapWnd: hwnd; szVer: wParam; wSize: LParam);
  434. begin
  435.   SendMessage(hCapWnd, WM_CAP_DRIVER_Get_VERSION, szVer, wSize)
  436. end;
  437.  
  438. procedure capDriverGetCaps(hCapWnd: hwnd; s: wParam; wSize: LParam);
  439. begin
  440.   SendMessage(hCapWnd, WM_CAP_DRIVER_Get_CAPS, s, wSize)
  441. end;
  442.  
  443. procedure capFileSetCaptureFile(hCapWnd: hwnd; szName: LPARAM);
  444. begin
  445.   SendMessage(hCapWnd, WM_CAP_FILE_SET_CAPTURE_FILE, 0, szName)
  446. end;
  447.  
  448. procedure capFileGetCaptureFile(hCapWnd: hwnd; wSize: wPARAM; szName: LPARAM);
  449. begin
  450.   SendMessage(hCapWnd, WM_CAP_FILE_GET_CAPTURE_FILE, wSize, szName)
  451. end;
  452.  
  453. procedure capFileAlloc(hCapWnd: hwnd; dwSize: LPARAM);
  454. begin
  455.   SendMessage(hCapWnd, WM_CAP_FILE_ALLOCATE, 0, dwSize)
  456. end;
  457.  
  458. procedure capFileSaveAs(hCapWnd: hwnd; szName: LPARAM);
  459. begin
  460.   SendMessage(hCapWnd, WM_CAP_FILE_SAVEAS, 0, szName)
  461. end;
  462.  
  463. procedure capFileSetInfoChunk(hCapWnd: hwnd; lpInfoChunk: LPARAM);
  464. begin
  465.   SendMessage(hCapWnd, WM_CAP_FILE_SET_INFOCHUNK, 0, lpInfoChunk)
  466. end;
  467.  
  468. procedure capFileSaveDIB(hCapWnd: hwnd; szName: LPARAM);
  469. begin
  470.   SendMessage(hCapWnd, WM_CAP_FILE_SAVEDIB, 0, szName)
  471. end;
  472.  
  473. procedure capEditCopy(hCapWnd: hwnd);
  474. begin
  475.   SendMessage(hCapWnd, WM_CAP_EDIT_COPY, 0, 0)
  476. end;
  477.  
  478. procedure capSetAudioFormat(hCapWnd: hwnd; s: WPARAM; wSize: LPARAM);
  479. begin
  480.   SendMessage(hCapWnd, WM_CAP_SET_AUDIOFORMAT, s, wSize)
  481. end;
  482.  
  483. procedure capGetAudioFormat(hCapWnd: hwnd; s: WPARAM; wSize: LPARAM);
  484. begin
  485.   SendMessage(hCapWnd, WM_CAP_GET_AUDIOFORMAT, s, wSize)
  486. end;
  487.  
  488. procedure capGetAudioFormatSize(hCapWnd: hwnd);
  489. begin
  490.   SendMessage(hCapWnd, WM_CAP_GET_AUDIOFORMAT, 0, 0)
  491. end;
  492.  
  493. procedure capDlgVideoFormat(hCapWnd: hwnd);
  494. begin
  495.   SendMessage(hCapWnd, WM_CAP_DLG_VIDEOFORMAT, 0, 0)
  496. end;
  497.  
  498. procedure capDlgVideoSource(hCapWnd: hwnd);
  499. begin
  500.   SendMessage(hCapWnd, WM_CAP_DLG_VIDEOSOURCE, 0, 0)
  501. end;
  502.  
  503. procedure capDlgVideoDisplay(hCapWnd: hwnd);
  504. begin
  505.   SendMessage(hCapWnd, WM_CAP_DLG_VIDEODISPLAY, 0, 0)
  506. end;
  507.  
  508. procedure capDlgVideoCompression(hCapWnd: hwnd);
  509. begin
  510.   SendMessage(hCapWnd, WM_CAP_DLG_VIDEOCOMPRESSION, 0, 0)
  511. end;
  512.  
  513. procedure capGetVideoFormat(hCapWnd: hwnd; s: WPARAM; wSize: LPARAM);
  514. begin
  515.   SendMessage(hCapWnd, WM_CAP_GET_VIDEOFORMAT, s, wSize)
  516. end;
  517.  
  518. procedure capGetVideoFormatSize(hCapWnd: hwnd);
  519. begin
  520.   SendMessage(hCapWnd, WM_CAP_GET_VIDEOFORMAT, 0, 0)
  521. end;
  522.  
  523. procedure capSetVideoFormat(hCapWnd: hwnd; s: WPARAM; wSize: LPARAM);
  524. begin
  525.   SendMessage(hCapWnd, WM_CAP_GET_VIDEOFORMAT, 0, 0)
  526. end;
  527.  
  528. procedure capPreview(hCapWnd: hwnd; f: WPARAM);
  529. begin
  530.   SendMessage(hCapWnd, WM_CAP_SET_PREVIEW, f, 0)
  531. end;
  532.  
  533. procedure capPreviewRate(hCapWnd: hwnd; wMS: WPARAM);
  534. begin
  535.   SendMessage(hCapWnd, WM_CAP_SET_PREVIEWRATE, wMS, 0)
  536. end;
  537.  
  538. procedure capOverlay(hCapWnd: hwnd; f: WPARAM);
  539. begin
  540.   SendMessage(hCapWnd, WM_CAP_SET_OVERLAY, f, 0)
  541. end;
  542.  
  543. procedure capPreviewScale(hCapWnd: hwnd; f: WPARAM);
  544. begin
  545.   SendMessage(hCapWnd, WM_CAP_SET_SCALE, f, 0)
  546. end;
  547.  
  548. procedure capGetStatus(hCapWnd: hwnd; s: WPARAM; wSize: LPARAM);
  549. begin
  550.   SendMessage(hCapWnd, WM_CAP_GET_STATUS, s, wSize)
  551. end;
  552.  
  553. procedure capSetScrollPos(hCapWnd: hwnd; lpP: LPARAM);
  554. begin
  555.   SendMessage(hCapWnd, WM_CAP_SET_SCROLL, 0, lpP)
  556. end;
  557.  
  558. procedure capGrabFrame(hCapWnd: hwnd);
  559. begin
  560.   SendMessage(hCapWnd, WM_CAP_GRAB_FRAME, 0, 0)
  561. end;
  562.  
  563. procedure capGrabFrameNoStop(hCapWnd: hwnd);
  564. begin
  565.   SendMessage(hCapWnd, WM_CAP_GRAB_FRAME_NOSTOP, 0, 0)
  566. end;
  567.  
  568. procedure capCaptureSequence(hCapWnd: hwnd);
  569. begin
  570.   SendMessage(hCapWnd, WM_CAP_SEQUENCE, 0, 0)
  571. end;
  572.  
  573. procedure capCaptureSequenceNoFile(hCapWnd: hwnd);
  574. begin
  575.   SendMessage(hCapWnd, WM_CAP_SEQUENCE_NOFILE, 0, 0)
  576. end;
  577.  
  578. procedure capCaptureStop(hCapWnd: hwnd);
  579. begin
  580.   SendMessage(hCapWnd, WM_CAP_Stop, 0, 0)
  581. end;
  582.  
  583. procedure capCaptureAbort(hCapWnd: hwnd);
  584. begin
  585.   SendMessage(hCapWnd, WM_CAP_ABORT, 0, 0)
  586. end;
  587.  
  588. procedure capCaptureSingleFrameOpen(hCapWnd: hwnd);
  589. begin
  590.   SendMessage(hCapWnd, WM_CAP_SINGLE_FRAME_OPEN, 0, 0)
  591. end;
  592.  
  593. procedure capCaptureSingleFrameClose(hCapWnd: hwnd);
  594. begin
  595.   SendMessage(hCapWnd, WM_CAP_SINGLE_FRAME_CLOSE, 0, 0)
  596. end;
  597.  
  598. procedure capCaptureSingleFrame(hCapWnd: hwnd);
  599. begin
  600.   SendMessage(hCapWnd, WM_CAP_SINGLE_FRAME, 0, 0)
  601. end;
  602.  
  603. procedure capCaptureGetSetup(hCapWnd: hwnd; s: WPARAM; wSize: LPARAM);
  604. begin
  605.   SendMessage(hCapWnd, WM_CAP_GET_SEQUENCE_SETUP, s, wSize)
  606. end;
  607.  
  608. procedure capCaptureSetSetup(hCapWnd: hwnd; s: WPARAM; wSize: LPARAM);
  609. begin
  610.   SendMessage(hCapWnd, WM_CAP_SET_SEQUENCE_SETUP, s, wSize)
  611. end;
  612.  
  613. procedure capSetMCIDeviceName(hCapWnd: hwnd; szName: LPARAM);
  614. begin
  615.   SendMessage(hCapWnd, WM_CAP_SET_MCI_DEVICE, 0, szName)
  616. end;
  617.  
  618. procedure capGetMCIDeviceName(hCapWnd: hwnd; szName: LPARAM; wSize: WPARAM);
  619. begin
  620.   SendMessage(hCapWnd, WM_CAP_GET_MCI_DEVICE, wSize, szName)
  621. end;
  622.  
  623. procedure capPaletteOpen(hCapWnd: hwnd; szName: LPARAM);
  624. begin
  625.   SendMessage(hCapWnd, WM_CAP_PAL_OPEN, 0, szName)
  626. end;
  627.  
  628. procedure capPaletteSave(hCapWnd: hwnd; szName: LPARAM);
  629. begin
  630.   SendMessage(hCapWnd, WM_CAP_PAL_SAVE, 0, szName)
  631. end;
  632.  
  633. procedure capPalettePaste(hCapWnd: hwnd);
  634. begin
  635.   SendMessage(hCapWnd, WM_CAP_PAL_PASTE, 0, 0)
  636. end;
  637.  
  638. procedure capPaletteAuto(hCapWnd: hwnd; iFrames: WPARAM; iColors: LPARAM);
  639. begin
  640.   SendMessage(hCapWnd, WM_CAP_PAL_AUTOCREATE, iFrames, iColors)
  641. end;
  642.  
  643. procedure capPaletteManual(hCapWnd: hwnd; fGrab: WPARAM; iColors: LPARAM);
  644. begin
  645.   SendMessage(hCapWnd, WM_CAP_PAL_MANUALCREATE, fGrab, iColors)
  646. end;
  647.  
  648. end.
  649.  
  650.