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.

232 lines
9.6 KiB

  1. /****************************************************************************
  2. * @doc INTERNAL DIALOGS
  3. *
  4. * @module WDMDialg.h | Include file for <c CWDMDialog> class used to display
  5. * video settings and camera controls dialog for WDM devices.
  6. *
  7. * @comm This code is based on the VfW to WDM mapper code written by
  8. * FelixA and E-zu Wu. The original code can be found on
  9. * \\redrum\slmro\proj\wdm10\\src\image\vfw\win9x\raytube.
  10. *
  11. * Documentation by George Shaw on kernel streaming can be found in
  12. * \\popcorn\razzle1\src\spec\ks\ks.doc.
  13. *
  14. * WDM streaming capture is discussed by Jay Borseth in
  15. * \\blues\public\jaybo\WDMVCap.doc.
  16. ***************************************************************************/
  17. #ifndef _DIALOGS_H // { _DIALOGS_H
  18. #define _DIALOGS_H
  19. // Constants used to check if the property has an automatic mode or/and a manual mode
  20. #define KSPROPERTY_FLAGS_MANUAL KSPROPERTY_CAMERACONTROL_FLAGS_MANUAL
  21. #define KSPROPERTY_FLAGS_AUTO KSPROPERTY_CAMERACONTROL_FLAGS_AUTO
  22. #if (KSPROPERTY_FLAGS_AUTO != KSPROPERTY_VIDEOPROCAMP_FLAGS_AUTO) || (KSPROPERTY_FLAGS_MANUAL != KSPROPERTY_VIDEOPROCAMP_FLAGS_MANUAL)
  23. #error Why did you mess with the kernel streaming include files? - PhilF-
  24. #endif
  25. typedef struct _tagPROPSLIDECONTROL
  26. {
  27. LONG lLastValue;
  28. LONG lCurrentValue;
  29. LONG lMin;
  30. LONG lMax;
  31. ULONG ulCapabilities;
  32. // Dialog item IDs
  33. UINT uiProperty;
  34. UINT uiSlider;
  35. UINT uiString;
  36. UINT uiStatic;
  37. UINT uiCurrent;
  38. UINT uiAuto;
  39. } PROPSLIDECONTROL, * PPROPSLIDECONTROL;
  40. // Video settings (brightness tint hue etc.)
  41. static PROPSLIDECONTROL g_VideoSettingControls[] =
  42. {
  43. { 0, 0, 0, 0, 0, KSPROPERTY_VIDEOPROCAMP_BRIGHTNESS, IDC_SLIDER_BRIGHTNESS, IDS_BRIGHTNESS, IDC_BRIGHTNESS_STATIC, IDC_TXT_BRIGHTNESS_CURRENT, IDC_CB_AUTO_BRIGHTNESS},
  44. { 0, 0, 0, 0, 0, KSPROPERTY_VIDEOPROCAMP_CONTRAST, IDC_SLIDER_CONTRAST, IDS_CONTRAST, IDC_CONTRAST_STATIC, IDC_TXT_CONTRAST_CURRENT, IDC_CB_AUTO_CONTRAST},
  45. { 0, 0, 0, 0, 0, KSPROPERTY_VIDEOPROCAMP_HUE, IDC_SLIDER_HUE, IDS_HUE, IDC_HUE_STATIC, IDC_TXT_HUE_CURRENT, IDC_CB_AUTO_HUE},
  46. { 0, 0, 0, 0, 0, KSPROPERTY_VIDEOPROCAMP_SATURATION, IDC_SLIDER_SATURATION, IDS_SATURATION, IDC_SATURATION_STATIC, IDC_TXT_SATURATION_CURRENT, IDC_CB_AUTO_SATURATION},
  47. { 0, 0, 0, 0, 0, KSPROPERTY_VIDEOPROCAMP_SHARPNESS, IDC_SLIDER_SHARPNESS, IDS_SHARPNESS, IDC_SHARPNESS_STATIC, IDC_TXT_SHARPNESS_CURRENT, IDC_CB_AUTO_SHARPNESS},
  48. { 0, 0, 0, 0, 0, KSPROPERTY_VIDEOPROCAMP_WHITEBALANCE, IDC_SLIDER_WHITEBAL, IDS_WHITEBAL, IDC_WHITE_STATIC, IDC_TXT_WHITE_CURRENT, IDC_CB_AUTO_WHITEBAL},
  49. { 0, 0, 0, 0, 0, KSPROPERTY_VIDEOPROCAMP_GAMMA, IDC_SLIDER_GAMMA, IDS_GAMMA, IDC_GAMMA_STATIC, IDC_TXT_GAMMA_CURRENT, IDC_CB_AUTO_GAMMA},
  50. { 0, 0, 0, 0, 0, KSPROPERTY_VIDEOPROCAMP_BACKLIGHT_COMPENSATION, IDC_SLIDER_BACKLIGHT, IDS_BACKLIGHT, IDC_BACKLIGHT_STATIC, IDC_TXT_BACKLIGHT_CURRENT, IDC_CB_AUTO_BACKLIGHT}
  51. };
  52. const ULONG NumVideoSettings = sizeof(g_VideoSettingControls) / sizeof(PROPSLIDECONTROL);
  53. // PhilF-: Assign a bug to Debbie to get this used
  54. static DWORD g_VideoSettingsHelpIDs[] =
  55. {
  56. IDC_DEVICE_SETTINGS, IDH_DEVICE_SETTINGS,
  57. IDC_SLIDER_BRIGHTNESS, IDH_DEVICE_SETTINGS,
  58. IDC_BRIGHTNESS_STATIC, IDH_DEVICE_SETTINGS,
  59. IDC_TXT_BRIGHTNESS_CURRENT, IDH_DEVICE_SETTINGS,
  60. IDC_CB_AUTO_BRIGHTNESS, IDH_DEVICE_SETTINGS,
  61. IDC_SLIDER_CONTRAST, IDH_DEVICE_SETTINGS,
  62. IDC_CONTRAST_STATIC, IDH_DEVICE_SETTINGS,
  63. IDC_TXT_CONTRAST_CURRENT, IDH_DEVICE_SETTINGS,
  64. IDC_CB_AUTO_CONTRAST, IDH_DEVICE_SETTINGS,
  65. IDC_SLIDER_HUE, IDH_DEVICE_SETTINGS,
  66. IDC_HUE_STATIC, IDH_DEVICE_SETTINGS,
  67. IDC_TXT_HUE_CURRENT, IDH_DEVICE_SETTINGS,
  68. IDC_CB_AUTO_HUE, IDH_DEVICE_SETTINGS,
  69. IDC_SLIDER_SATURATION, IDH_DEVICE_SETTINGS,
  70. IDC_SATURATION_STATIC, IDH_DEVICE_SETTINGS,
  71. IDC_TXT_SATURATION_CURRENT, IDH_DEVICE_SETTINGS,
  72. IDC_CB_AUTO_SATURATION, IDH_DEVICE_SETTINGS,
  73. IDC_SLIDER_SHARPNESS, IDH_DEVICE_SETTINGS,
  74. IDC_SHARPNESS_STATIC, IDH_DEVICE_SETTINGS,
  75. IDC_TXT_SHARPNESS_CURRENT, IDH_DEVICE_SETTINGS,
  76. IDC_CB_AUTO_SHARPNESS, IDH_DEVICE_SETTINGS,
  77. IDC_SLIDER_WHITEBAL, IDH_DEVICE_SETTINGS,
  78. IDC_WHITE_STATIC, IDH_DEVICE_SETTINGS,
  79. IDC_TXT_WHITE_CURRENT, IDH_DEVICE_SETTINGS,
  80. IDC_CB_AUTO_WHITEBAL, IDH_DEVICE_SETTINGS,
  81. IDC_SLIDER_GAMMA, IDH_DEVICE_SETTINGS,
  82. IDC_GAMMA_STATIC, IDH_DEVICE_SETTINGS,
  83. IDC_TXT_GAMMA_CURRENT, IDH_DEVICE_SETTINGS,
  84. IDC_CB_AUTO_GAMMA, IDH_DEVICE_SETTINGS,
  85. IDC_SLIDER_BACKLIGHT, IDH_DEVICE_SETTINGS,
  86. IDC_BACKLIGHT_STATIC, IDH_DEVICE_SETTINGS,
  87. IDC_TXT_BACKLIGHT_CURRENT, IDH_DEVICE_SETTINGS,
  88. IDC_CB_AUTO_BACKLIGHT, IDH_DEVICE_SETTINGS,
  89. IDC_DEFAULT, IDH_DEVICE_SETTINGS,
  90. 0, 0 // terminator
  91. };
  92. // Camera control (focus, zoom etc.)
  93. static PROPSLIDECONTROL g_CameraControls[] =
  94. {
  95. { 0, 0, 0, 0, 0, KSPROPERTY_CAMERACONTROL_FOCUS, IDC_SLIDER_FOCUS, IDS_FOCUS, IDC_FOCUS_STATIC, IDC_TXT_FOCUS_CURRENT, IDC_CB_AUTO_FOCUS},
  96. { 0, 0, 0, 0, 0, KSPROPERTY_CAMERACONTROL_ZOOM, IDC_SLIDER_ZOOM, IDS_ZOOM, IDC_ZOOM_STATIC, IDC_TXT_ZOOM_CURRENT, IDC_CB_AUTO_ZOOM},
  97. { 0, 0, 0, 0, 0, KSPROPERTY_CAMERACONTROL_EXPOSURE,IDC_SLIDER_EXPOSURE,IDS_EXPOSURE, IDC_EXPOSURE_STATIC,IDC_TXT_EXPOSURE_CURRENT, IDC_CB_AUTO_EXPOSURE},
  98. { 0, 0, 0, 0, 0, KSPROPERTY_CAMERACONTROL_IRIS, IDC_SLIDER_IRIS, IDS_IRIS, IDC_IRIS_STATIC, IDC_TXT_IRIS_CURRENT, IDC_CB_AUTO_IRIS},
  99. { 0, 0, 0, 0, 0, KSPROPERTY_CAMERACONTROL_TILT, IDC_SLIDER_TILT, IDS_TILT, IDC_TILT_STATIC, IDC_TXT_TILT_CURRENT, IDC_CB_AUTO_TILT},
  100. { 0, 0, 0, 0, 0, KSPROPERTY_CAMERACONTROL_PAN, IDC_SLIDER_PAN, IDS_PAN, IDC_PAN_STATIC, IDC_TXT_PAN_CURRENT, IDC_CB_AUTO_PAN},
  101. { 0, 0, 0, 0, 0, KSPROPERTY_CAMERACONTROL_ROLL, IDC_SLIDER_ROLL, IDS_ROLL, IDC_ROLL_STATIC, IDC_TXT_ROLL_CURRENT, IDC_CB_AUTO_ROLL},
  102. };
  103. const ULONG NumCameraControls = sizeof(g_CameraControls) / sizeof(PROPSLIDECONTROL);
  104. static DWORD g_CameraControlsHelpIDs[] =
  105. {
  106. IDC_CAMERA_CONTROLS, IDH_CAMERA_CONTROLS,
  107. IDC_SLIDER_FOCUS, IDH_CAMERA_CONTROLS,
  108. IDC_FOCUS_STATIC, IDH_CAMERA_CONTROLS,
  109. IDC_TXT_FOCUS_CURRENT, IDH_CAMERA_CONTROLS,
  110. IDC_CB_AUTO_FOCUS, IDH_CAMERA_CONTROLS,
  111. IDC_SLIDER_ZOOM, IDH_CAMERA_CONTROLS,
  112. IDC_ZOOM_STATIC, IDH_CAMERA_CONTROLS,
  113. IDC_TXT_ZOOM_CURRENT, IDH_CAMERA_CONTROLS,
  114. IDC_CB_AUTO_ZOOM, IDH_CAMERA_CONTROLS,
  115. IDC_SLIDER_EXPOSURE, IDH_CAMERA_CONTROLS,
  116. IDC_EXPOSURE_STATIC, IDH_CAMERA_CONTROLS,
  117. IDC_TXT_EXPOSURE_CURRENT, IDH_CAMERA_CONTROLS,
  118. IDC_CB_AUTO_EXPOSURE, IDH_CAMERA_CONTROLS,
  119. IDC_SLIDER_IRIS, IDH_CAMERA_CONTROLS,
  120. IDC_IRIS_STATIC, IDH_CAMERA_CONTROLS,
  121. IDC_TXT_IRIS_CURRENT, IDH_CAMERA_CONTROLS,
  122. IDC_CB_AUTO_IRIS, IDH_CAMERA_CONTROLS,
  123. IDC_SLIDER_TILT, IDH_CAMERA_CONTROLS,
  124. IDC_TILT_STATIC, IDH_CAMERA_CONTROLS,
  125. IDC_TXT_TILT_CURRENT, IDH_CAMERA_CONTROLS,
  126. IDC_CB_AUTO_TILT, IDH_CAMERA_CONTROLS,
  127. IDC_SLIDER_PAN, IDH_CAMERA_CONTROLS,
  128. IDC_PAN_STATIC, IDH_CAMERA_CONTROLS,
  129. IDC_TXT_PAN_CURRENT, IDH_CAMERA_CONTROLS,
  130. IDC_CB_AUTO_PAN, IDH_CAMERA_CONTROLS,
  131. IDC_SLIDER_ROLL, IDH_CAMERA_CONTROLS,
  132. IDC_ROLL_STATIC, IDH_CAMERA_CONTROLS,
  133. IDC_TXT_ROLL_CURRENT, IDH_CAMERA_CONTROLS,
  134. IDC_CB_AUTO_ROLL, IDH_CAMERA_CONTROLS,
  135. IDC_DEFAULT, IDH_CAMERA_CONTROLS,
  136. 0, 0 // terminator
  137. };
  138. // For now, we only expose a video settings and camera control page
  139. #define MAX_PAGES 2
  140. /****************************************************************************
  141. * @doc INTERNAL CWDMDIALOGCLASS
  142. *
  143. * @class CWDMDialog | This class provides support for property
  144. * pages to be displayed within a property sheet.
  145. *
  146. * @mdata BOOL | CWDMDialog | m_bInit | This member is set to TRUE after the
  147. * page has been initialized.
  148. *
  149. * @mdata BOOL | CWDMDialog | m_bChanged | This member is set to TRUE after the
  150. * page has been changed.
  151. *
  152. * @mdata int | CWDMDialog | m_DlgID | Resource ID of the property page dialog.
  153. *
  154. * @mdata HWND | CWDMDialog | m_hDlg | Window handle of the property page.
  155. *
  156. * @mdata PDWORD | CWDMDialog | m_pdwHelp | Pointer to the list of help IDs
  157. * to be displayed in the property page.
  158. *
  159. * @mdata CWDMPin * | CWDMDialog | m_pCWDMPin | Pointer to the kernel
  160. * streaming object we will query the property on.
  161. *
  162. * @mdata PPROPSLIDECONTROL | CWDMDialog | m_pPC | Pointer to the list of
  163. * slider controls to be displayed in the property page.
  164. *
  165. * @mdata DWORD | CWDMDialog | m_dwNumControls | Number of controls to\
  166. * display in the page.
  167. *
  168. * @mdata GUID | CWDMDialog | m_guidPropertySet | GUID of the KS property
  169. * we are showing in the property page.
  170. ***************************************************************************/
  171. class CWDMDialog
  172. {
  173. public:
  174. CWDMDialog(int DlgID, DWORD dwNumControls, GUID guidPropertySet, PPROPSLIDECONTROL pPC, PDWORD pdwHelp, CWDMPin *pCWDMPin=0);
  175. ~CWDMDialog() {};
  176. HPROPSHEETPAGE Create();
  177. private:
  178. BOOL m_bInit;
  179. BOOL m_bChanged;
  180. int m_DlgID;
  181. HWND m_hDlg;
  182. PDWORD m_pdwHelp;
  183. CWDMPin *m_pCWDMPin;
  184. PPROPSLIDECONTROL m_pPC;
  185. DWORD m_dwNumControls;
  186. GUID m_guidPropertySet;
  187. // Dialog proc helper functions
  188. int SetActive();
  189. int QueryCancel();
  190. int DoCommand(WORD wCmdID,WORD hHow);
  191. // Dialog proc
  192. static INT_PTR CALLBACK BaseDlgProc(HWND hDlg, UINT uMessage, WPARAM wParam, LPARAM lParam);
  193. };
  194. #endif // } _DIALOGS_H