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.

231 lines
7.3 KiB

  1. /**************************************************************************
  2. *
  3. * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  4. * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  5. * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  6. * PURPOSE.
  7. *
  8. * Copyright (c) 1992 - 1995 Microsoft Corporation. All Rights Reserved.
  9. *
  10. **************************************************************************/
  11. /****************************************************************************
  12. *
  13. * vidcap.h: Main application include file
  14. *
  15. * Vidcap32 Source code
  16. *
  17. ***************************************************************************/
  18. #include "dialogs.h"
  19. #define USE_ACM 1 // Use ACM dialogs for audio format selection
  20. //
  21. // General purpose constants...
  22. //
  23. #define MAXVIDDRIVERS 10
  24. #define DEF_CAPTURE_FPS 15
  25. #define MIN_CAPTURE_FPS (1.0 / 60) // one frame per minute
  26. #define MAX_CAPTURE_FPS 100
  27. #define FPS_TO_MS(f) ((DWORD) ((double)1.0e6 / f))
  28. #define DEF_CAPTURE_RATE FPS_TO_MS(DEF_CAPTURE_FPS)
  29. #define MIN_CAPTURE_RATE FPS_TO_MS(MIN_CAPTURE_FPS)
  30. #define MAX_CAPTURE_RATE FPS_TO_MS(MAX_CAPTURE_FPS)
  31. #define DEF_PALNUMFRAMES 10
  32. #define DEF_PALNUMCOLORS 236L
  33. #define ONEMEG (1024L * 1024L)
  34. //standard index size options
  35. #define CAP_LARGE_INDEX (30 * 60 * 60 * 3) // 3 hrs @ 30fps
  36. #define CAP_SMALL_INDEX (30 * 60 * 15) // 15 minutes @ 30fps
  37. //
  38. // Menu Ids...must not conflict with string table ids
  39. // these are also the id of help strings in the string table
  40. // (along with all the SC_ system menu items).
  41. // menu popups must start 10 apart and be numbered in the same order
  42. // as they appear if the help text is to work correctly for the
  43. // popup heads as well as for the menu items.
  44. //
  45. #define IDM_SYSMENU 100
  46. #define IDM_FILE 200
  47. #define IDM_F_SETCAPTUREFILE 201
  48. #define IDM_F_SAVEVIDEOAS 202
  49. #define IDM_F_ALLOCATESPACE 203
  50. #define IDM_F_EXIT 204
  51. #define IDM_F_LOADPALETTE 205
  52. #define IDM_F_SAVEPALETTE 206
  53. #define IDM_F_SAVEFRAME 207
  54. #define IDM_F_EDITVIDEO 208
  55. #define IDM_EDIT 300
  56. #define IDM_E_COPY 301
  57. #define IDM_E_PASTEPALETTE 302
  58. #define IDM_E_PREFS 303
  59. #define IDM_CAPTURE 400
  60. #define IDM_C_CAPTUREVIDEO 401
  61. #define IDM_C_CAPTUREFRAME 402
  62. #define IDM_C_PALETTE 403
  63. #define IDM_C_CAPSEL 404
  64. #define IDM_C_TEST 405
  65. #define IDM_C_TESTAGAIN 406
  66. #define IDM_OPTIONS 500
  67. #define IDM_O_PREVIEW 501
  68. #define IDM_O_OVERLAY 502
  69. #define IDM_O_AUDIOFORMAT 503
  70. #define IDM_O_VIDEOFORMAT 504
  71. #define IDM_O_VIDEOSOURCE 505
  72. #define IDM_O_VIDEODISPLAY 506
  73. #define IDM_O_CHOOSECOMPRESSOR 507
  74. #define IDM_O_DRIVER0 520
  75. #define IDM_O_DRIVER1 521
  76. #define IDM_O_DRIVER2 522
  77. #define IDM_O_DRIVER3 523
  78. #define IDM_O_DRIVER4 524
  79. #define IDM_O_DRIVER5 525
  80. #define IDM_O_DRIVER6 526
  81. #define IDM_O_DRIVER7 527
  82. #define IDM_O_DRIVER8 528
  83. #define IDM_O_DRIVER9 529
  84. #define IDM_HELP 600
  85. #define IDM_H_CONTENTS 601
  86. #define IDM_H_ABOUT 602
  87. // filter rcdata ids
  88. #define ID_FILTER_AVI 900
  89. #define ID_FILTER_PALETTE 901
  90. #define ID_FILTER_DIB 902
  91. /*
  92. * string table id
  93. *
  94. * NOTE: string table ID's must not conflict with IDM_ menu ids,
  95. * as there is a help string for each menu id.
  96. */
  97. #define IDS_APP_TITLE 1001
  98. #define IDS_ERR_REGISTER_CLASS 1002
  99. #define IDS_ERR_CREATE_WINDOW 1003
  100. #define IDS_ERR_FIND_HARDWARE 1004
  101. #define IDS_ERR_CANT_PREALLOC 1005
  102. #define IDS_ERR_MEASUREFREEDISK 1006
  103. #define IDS_ERR_SIZECAPFILE 1007
  104. #define IDS_ERR_RECONNECTDRIVER 1008
  105. #define IDS_ERR_CMDLINE 1009
  106. #define IDS_WARN_DEFAULT_PALETTE 1010
  107. #define IDS_TITLE_SETCAPTUREFILE 1101
  108. #define IDS_TITLE_SAVEAS 1102
  109. #define IDS_TITLE_LOADPALETTE 1104
  110. #define IDS_TITLE_SAVEPALETTE 1105
  111. #define IDS_TITLE_SAVEDIB 1106
  112. #define IDS_PROMPT_CAPFRAMES 1107
  113. #define IDS_STATUS_NUMFRAMES 1108
  114. #define IDS_CAP_CLOSE 1109
  115. #define IDS_MCI_CONTROL_ERROR 1110
  116. #define IDS_ERR_ACCESS_SOUNDDRIVER 1111
  117. #define IDS_ERR_VIDEDIT 1112
  118. #define IDC_toolbarSETFILE 1220
  119. #define IDC_toolbarCAPFRAME 1221
  120. #define IDC_toolbarCAPSEL 1222
  121. #define IDC_toolbarCAPAVI 1223
  122. #define IDC_toolbarCAPPAL 1224
  123. #define IDC_toolbarLIVE 1225
  124. #define IDC_toolbarEDITCAP 1226
  125. #define IDC_toolbarOVERLAY 1227
  126. #define IDS_CAPPAL_CLOSE 1230
  127. #define IDS_CAPPAL_STATUS 1231
  128. #define IDS_CAPPAL_STOP 1232
  129. #define IDS_CAPPAL_START 1233
  130. #define IDS_CAP_RTL 1234
  131. #define IDBMP_TOOLBAR 100 // main toolbar
  132. //
  133. // Macro Definitions...
  134. //
  135. #define IsDriverIndex(w) ( ((w) >= IDM_O_DRIVERS) && \
  136. ((w) - IDM_O_DRIVERS < MAXVIDDRIVERS) )
  137. #define RECTWIDTH(rc) ((rc).right - (rc).left)
  138. #define RECTHEIGHT(rc) ((rc).bottom - (rc).top)
  139. //
  140. // Global Variables...
  141. //
  142. // preferences
  143. extern BOOL gbCentre;
  144. extern BOOL gbToolBar;
  145. extern BOOL gbStatusBar;
  146. extern BOOL gbAutoSizeFrame;
  147. extern int gBackColour;
  148. extern BOOL gfIsRTL;
  149. extern TCHAR gachAppName[] ;
  150. extern TCHAR gachAppTitle[];
  151. extern TCHAR gachIconName[] ;
  152. extern TCHAR gachMenuName[] ;
  153. extern TCHAR gachString[] ;
  154. extern TCHAR gachMCIDeviceName[] ;
  155. extern HINSTANCE ghInstApp ;
  156. extern HWND ghWndMain ;
  157. extern HWND ghWndCap ;
  158. extern HWND ghWndFrame;
  159. extern HANDLE ghAccel ;
  160. extern WORD gwDeviceIndex ;
  161. extern WORD gwPalFrames ;
  162. extern WORD gwPalColors ;
  163. extern WORD gwCapFileSize ;
  164. extern BOOL gbLive ;
  165. extern CAPSTATUS gCapStatus ;
  166. extern CAPDRIVERCAPS gCapDriverCaps ;
  167. extern CAPTUREPARMS gCapParms ;
  168. extern HANDLE ghwfex ;
  169. extern LPWAVEFORMATEX glpwfex ;
  170. //
  171. // Dialog Box Procedures...
  172. //
  173. LRESULT FAR PASCAL AboutProc(HWND, UINT, WPARAM, LPARAM) ;
  174. LRESULT FAR PASCAL AudioFormatProc(HWND, UINT, WPARAM, LPARAM) ;
  175. LRESULT FAR PASCAL CapSetUpProc(HWND, UINT, WPARAM, LPARAM) ;
  176. LRESULT CALLBACK MakePaletteProc(HWND, UINT, WPARAM, LPARAM) ;
  177. LRESULT FAR PASCAL AllocCapFileProc(HWND, UINT, WPARAM, LPARAM) ;
  178. LRESULT FAR PASCAL PrefsDlgProc(HWND, UINT, WPARAM, LPARAM);
  179. LRESULT FAR PASCAL NoHardwareDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
  180. LRESULT FAR PASCAL CapFramesProc(HWND hDlg, UINT Message, WPARAM wParam, LPARAM lParam);
  181. // utility functions (in vidcap.c)
  182. /*
  183. * put up a message box. the main window ghWndMain is used as the parent
  184. * window, and the app title gachAppTitle is used as the dialog title.
  185. * the text for the dialog -idString- is loaded from the resource string table
  186. */
  187. int MessageBoxID(UINT idString, UINT fuStyle);
  188. LPSTR tmpString(UINT idString);