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.

75 lines
1.7 KiB

  1. // DurationPage.cpp : Implementation of CDurationPage
  2. #include "stdafx.h"
  3. #include "ToolProps.h"
  4. #include "DurationPage.h"
  5. /////////////////////////////////////////////////////////////////////////////
  6. // CDurationPage
  7. CDurationPage::CDurationPage()
  8. {
  9. m_dwTitleID = IDS_TITLEDurationPage;
  10. m_dwHelpFileID = IDS_HELPFILEDurationPage;
  11. m_dwDocStringID = IDS_DOCSTRINGDurationPage;
  12. m_pDuration = NULL;
  13. }
  14. CDurationPage::~CDurationPage()
  15. {
  16. if (m_pDuration)
  17. {
  18. m_pDuration->Release();
  19. }
  20. }
  21. STDMETHODIMP CDurationPage::SetObjects(ULONG cObjects,IUnknown **ppUnk)
  22. {
  23. if (cObjects < 1 || cObjects > 1)
  24. return E_UNEXPECTED;
  25. return ppUnk[0]->QueryInterface(IID_IDirectMusicDurationTool,(void **) &m_pDuration);
  26. }
  27. STDMETHODIMP CDurationPage::Apply(void)
  28. {
  29. m_pDuration->SetScale(m_ctScale.GetValue());
  30. m_bDirty = FALSE;
  31. return S_OK;
  32. }
  33. LRESULT CDurationPage::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  34. {
  35. if (m_pDuration)
  36. {
  37. m_ctScale.Init(GetDlgItem(IDC_SCALE),GetDlgItem(IDC_SCALE_DISPLAY),0,8.0,false);
  38. float fScale;
  39. m_pDuration->GetScale(&fScale);
  40. m_ctScale.SetValue(fScale);
  41. }
  42. return 1;
  43. }
  44. LRESULT CDurationPage::OnCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  45. {
  46. LRESULT lr = m_ctScale.MessageHandler(uMsg, wParam,lParam, bHandled);
  47. if (bHandled)
  48. SetDirty(true);
  49. return lr;
  50. }
  51. LRESULT CDurationPage::OnSlider(UINT uMsg, WPARAM wParam,LPARAM lParam, BOOL& bHandled)
  52. {
  53. LRESULT lr = m_ctScale.MessageHandler(uMsg, wParam,lParam, bHandled);
  54. if (bHandled)
  55. SetDirty(true);
  56. return lr;
  57. }