Source code of Windows XP (NT5)
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.

137 lines
4.5 KiB

  1. // COptDlg.h : Declaration of the COptionsDlg class
  2. //
  3. // Copyright (c) 1996 - 1999 Microsoft Corporation. All Rights Reserved.
  4. // All rights reserved.
  5. #include <commctrl.h>
  6. #include "resource.h"
  7. #include "Msdvdopt.h"
  8. #include "dvdopt.h"
  9. #include "password.h"
  10. #define C_PAGES 5
  11. #define PAGE_CHAP 0
  12. #define PAGE_SPRM 1
  13. #define PAGE_PG 2
  14. #define PAGE_KARAOKE 3
  15. #define PAGE_ABOUT 4
  16. #define MAX_SCAN_SPEED 4
  17. #define MIN_SCAN_SPEED 1
  18. #define MAX_PLAY_SPEED 0
  19. #define MIN_PLAY_SPEED -3
  20. #define LEVEL_G 1
  21. #define LEVEL_G_PG 2
  22. #define LEVEL_PG 3
  23. #define LEVEL_PG13 4
  24. #define LEVEL_PG_R 5
  25. #define LEVEL_R 6
  26. #define LEVEL_NC17 7
  27. #define LEVEL_ADULT 8
  28. #define LEVEL_DISABLED -1
  29. #define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp))
  30. #define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp))
  31. /////////////////////////////////////////////////////////////////////////////
  32. // COptionsDlg
  33. class COptionsDlg : public CDialogImpl<COptionsDlg>
  34. {
  35. BEGIN_MSG_MAP(COptionsDlg)
  36. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  37. MESSAGE_HANDLER(WM_ACTIVATE, OnActivate)
  38. MESSAGE_HANDLER(WM_NOTIFY, OnNotify)
  39. MESSAGE_HANDLER(WM_HELP, OnHelp)
  40. MESSAGE_HANDLER(WM_CONTEXTMENU, OnContextMenu)
  41. COMMAND_ID_HANDLER(IDOK, OnOK)
  42. COMMAND_ID_HANDLER(IDCANCEL, OnEndDialog)
  43. COMMAND_ID_HANDLER(IDC_APPLY, OnApply)
  44. END_MSG_MAP()
  45. static HRESULT pg_InitRateList(HWND ctlList, long level);
  46. static LPTSTR karaoke_InitContentString(long nContent);
  47. static long pg_GetLevel(LPTSTR szRate);
  48. static BOOL IsNewAdmin();
  49. HRESULT GetDvdAdm(LPVOID* ppAdmin);
  50. HRESULT GetDvd(IMSWebDVD** ppDvd);
  51. LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  52. LRESULT OnActivate (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  53. LRESULT OnNotify(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  54. LRESULT OnMove(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  55. LRESULT OnApply(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
  56. LRESULT OnOK(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
  57. LRESULT OnEndDialog(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
  58. LRESULT OnHelp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  59. LRESULT OnContextMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  60. HRESULT OnDoPasswordDlg(CPasswordDlg::PASSWORDDLG_REASON reason);
  61. HRESULT chapSrch_InitChapList(HWND chapList);
  62. HRESULT chapSrch_OnInitDialog(HWND hwndDlg);
  63. HRESULT chapSrch_OnApply(HWND hwnd);
  64. void chapSrch_Dirty(BOOL bDirty) {m_bChapDirty = bDirty;}
  65. BOOL chapSrch_Dirty() {return m_bChapDirty;}
  66. void otherPage_Dirty(BOOL bDirty) {m_bDirty = bDirty;}
  67. BOOL otherPage_Dirty() {return m_bDirty;}
  68. HRESULT karaoke_OnInitDialog(HWND hwnd);
  69. HRESULT karaoke_OnApply(HWND hwnd);
  70. HRESULT karaoke_InitChannelList(HWND hwnd);
  71. BOOL karaoke_HasKaraokeContent();
  72. HRESULT sprm_InitLangList(HWND cList, WORD id);
  73. HRESULT sprm_OnInitDialog(HWND hwndDlg);
  74. HRESULT sprm_OnApply(HWND hwnd);
  75. HRESULT pg_OnInitDialog(HWND hwndDlg);
  76. HRESULT pg_OnApply(HWND hwndDlg);
  77. void ShowRestartWarning(HWND hwndDlg);
  78. enum { IDD = IDD_OPTIONS };
  79. double m_dFFSpeed;
  80. double m_dBWSpeed;
  81. double m_dPlaySpeed;
  82. COptionsDlg(IMSWebDVD* pDvd = NULL);
  83. virtual ~COptionsDlg();
  84. void SetDvd(IMSWebDVD *pDvd) { m_pDvd = pDvd; }
  85. void SetDvdOpt(Cdvdopt *pDvdOpt) { m_pDvdOpt = pDvdOpt; }
  86. Cdvdopt* GetDvdOpt() { return m_pDvdOpt; }
  87. HWND m_hwndDisplay[C_PAGES]; // child dialog boxs
  88. private:
  89. DLGTEMPLATE * WINAPI DoLockDlgRes(LPCTSTR lpszResName);
  90. VOID WINAPI OnSelChanged();
  91. HWND m_hwndTab; // tab control
  92. DLGTEMPLATE *m_apRes[C_PAGES];
  93. UINT m_currentSel;
  94. CComPtr<IMSWebDVD> m_pDvd;
  95. Cdvdopt *m_pDvdOpt;
  96. CPasswordDlg *m_pPasswordDlg;
  97. BOOL m_bChapDirty; // If the chapter search page is dirty
  98. BOOL m_bDirty; // If any other page is dirty
  99. };
  100. INT_PTR CALLBACK ChildDialogProc(
  101. HWND hwndDlg, // handle to the child dialog box
  102. UINT uMsg, // message
  103. WPARAM wParam, // first message parameter
  104. LPARAM lParam // second message parameter
  105. );
  106. CComBSTR LoadBSTRFromRes(DWORD resId);
  107. LPTSTR LoadStringFromRes(DWORD redId);
  108. BOOL GetRegistryDword(const TCHAR *pKey, DWORD* dwRet, DWORD dwDefault);
  109. BOOL GetRegistryString(const TCHAR *pKey, TCHAR* szRet, DWORD* dwLen, TCHAR* szDefault);
  110. extern "C" const TCHAR g_szPassword[];
  111. extern "C" const TCHAR g_szPlayerLevel[];
  112. extern "C" const TCHAR g_szDisableParent[];