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.

83 lines
2.1 KiB

  1. // TimeShiftPage.cpp : Implementation of CTimeShiftPage
  2. #include "stdafx.h"
  3. #include "ToolProps.h"
  4. #include "TimeShiftPage.h"
  5. /////////////////////////////////////////////////////////////////////////////
  6. // CTimeShiftPage
  7. CTimeShiftPage::CTimeShiftPage()
  8. {
  9. m_dwTitleID = IDS_TITLETimeShiftPage;
  10. m_dwHelpFileID = IDS_HELPFILETimeShiftPage;
  11. m_dwDocStringID = IDS_DOCSTRINGTimeShiftPage;
  12. m_pTimeShift = NULL;
  13. }
  14. CTimeShiftPage::~CTimeShiftPage()
  15. {
  16. if (m_pTimeShift)
  17. {
  18. m_pTimeShift->Release();
  19. }
  20. }
  21. STDMETHODIMP CTimeShiftPage::SetObjects(ULONG cObjects,IUnknown **ppUnk)
  22. {
  23. if (cObjects < 1 || cObjects > 1)
  24. return E_UNEXPECTED;
  25. return ppUnk[0]->QueryInterface(IID_IDirectMusicTimeShiftTool,(void **) &m_pTimeShift);
  26. }
  27. STDMETHODIMP CTimeShiftPage::Apply(void)
  28. {
  29. m_pTimeShift->SetRange((DWORD)m_ctRange.GetValue());
  30. m_pTimeShift->SetOffset((long)m_ctOffset.GetValue());
  31. m_bDirty = FALSE;
  32. return S_OK;
  33. }
  34. LRESULT CTimeShiftPage::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  35. {
  36. if (m_pTimeShift)
  37. {
  38. m_ctRange.Init(GetDlgItem(IDC_RANGE),GetDlgItem(IDC_RANGE_DISPLAY),0,200,true);
  39. m_ctOffset.Init(GetDlgItem(IDC_OFFSET),GetDlgItem(IDC_OFFSET_DISPLAY),-200,200,true);
  40. long lValue;
  41. m_pTimeShift->GetRange((DWORD *)&lValue);
  42. m_ctRange.SetValue((float)lValue);
  43. m_pTimeShift->GetOffset(&lValue);
  44. m_ctOffset.SetValue((float)lValue);
  45. }
  46. return 1;
  47. }
  48. LRESULT CTimeShiftPage::OnCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  49. {
  50. LRESULT lr = m_ctRange.MessageHandler(uMsg, wParam,lParam, bHandled);
  51. if (!bHandled)
  52. lr = m_ctOffset.MessageHandler(uMsg, wParam, lParam, bHandled);
  53. if (bHandled)
  54. SetDirty(true);
  55. return lr;
  56. }
  57. LRESULT CTimeShiftPage::OnSlider(UINT uMsg, WPARAM wParam,LPARAM lParam, BOOL& bHandled)
  58. {
  59. LRESULT lr = m_ctRange.MessageHandler(uMsg, wParam,lParam, bHandled);
  60. if (!bHandled)
  61. lr = m_ctOffset.MessageHandler(uMsg, wParam, lParam, bHandled);
  62. if (bHandled)
  63. SetDirty(true);
  64. return lr;
  65. }