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
3.2 KiB

  1. // DirectSoundFXWavesReverbPage.cpp : Implementation of CDirectSoundFXWavesReverbPage
  2. #include "stdafx.h"
  3. #include "Dsdmoprp.h"
  4. #include "DirectSoundFXWavesReverbPage.h"
  5. /////////////////////////////////////////////////////////////////////////////
  6. // CDirectSoundFXWavesReverbPage
  7. CDirectSoundFXWavesReverbPage::CDirectSoundFXWavesReverbPage()
  8. {
  9. m_dwTitleID = IDS_TITLEDirectSoundFXWavesReverbPage;
  10. m_dwHelpFileID = IDS_HELPFILEDirectSoundFXWavesReverbPage;
  11. m_dwDocStringID = IDS_DOCSTRINGDirectSoundFXWavesReverbPage;
  12. m_rgpHandlers[0] = &m_sliderInGain;
  13. m_rgpHandlers[1] = &m_sliderReverbMix;
  14. m_rgpHandlers[2] = &m_sliderReverbTime;
  15. m_rgpHandlers[3] = &m_sliderHighFreqRTRatio;
  16. m_rgpHandlers[4] = NULL;
  17. }
  18. STDMETHODIMP CDirectSoundFXWavesReverbPage::SetObjects(ULONG nObjects, IUnknown **ppUnk)
  19. {
  20. if (nObjects < 1 || nObjects > 1)
  21. return E_UNEXPECTED;
  22. HRESULT hr = ppUnk[0]->QueryInterface(IID_IDirectSoundFXWavesReverb, reinterpret_cast<void**>(&m_IDSFXWavesReverb));
  23. return hr;
  24. }
  25. STDMETHODIMP CDirectSoundFXWavesReverbPage::Apply(void)
  26. {
  27. if (!m_IDSFXWavesReverb)
  28. return E_UNEXPECTED;
  29. DSFXWavesReverb dsfxwavesreverb;
  30. ZeroMemory(&dsfxwavesreverb, sizeof(DSFXWavesReverb));
  31. dsfxwavesreverb.fInGain = m_sliderInGain.GetValue();
  32. dsfxwavesreverb.fReverbMix = m_sliderReverbMix.GetValue();
  33. dsfxwavesreverb.fReverbTime = m_sliderReverbTime.GetValue();
  34. dsfxwavesreverb.fHighFreqRTRatio = m_sliderHighFreqRTRatio.GetValue();
  35. HRESULT hr = m_IDSFXWavesReverb->SetAllParameters(&dsfxwavesreverb);
  36. if (FAILED(hr))
  37. return hr;
  38. SetDirty(FALSE);
  39. return S_OK;
  40. }
  41. LRESULT CDirectSoundFXWavesReverbPage::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  42. {
  43. if (!m_IDSFXWavesReverb)
  44. return 1;
  45. DSFXWavesReverb dsfxwavesreverb;
  46. ZeroMemory(&dsfxwavesreverb, sizeof(DSFXWavesReverb));
  47. m_IDSFXWavesReverb->GetAllParameters(&dsfxwavesreverb);
  48. m_sliderInGain.Init(GetDlgItem(IDC_SLIDER_InGain), GetDlgItem(IDC_EDIT_InGain), DSFX_WAVESREVERB_INGAIN_MIN, DSFX_WAVESREVERB_INGAIN_MAX, false);
  49. m_sliderInGain.SetValue(dsfxwavesreverb.fInGain);
  50. m_sliderReverbMix.Init(GetDlgItem(IDC_SLIDER_ReverbMix), GetDlgItem(IDC_EDIT_ReverbMix), DSFX_WAVESREVERB_REVERBMIX_MIN, DSFX_WAVESREVERB_REVERBMIX_MAX, false);
  51. m_sliderReverbMix.SetValue(dsfxwavesreverb.fReverbMix);
  52. m_sliderReverbTime.Init(GetDlgItem(IDC_SLIDER_ReverbTime), GetDlgItem(IDC_EDIT_ReverbTime), DSFX_WAVESREVERB_REVERBTIME_MIN, DSFX_WAVESREVERB_REVERBTIME_MAX, false);
  53. m_sliderReverbTime.SetValue(dsfxwavesreverb.fReverbTime);
  54. m_sliderHighFreqRTRatio.Init(GetDlgItem(IDC_SLIDER_HighFreqRTRatio), GetDlgItem(IDC_EDIT_HighFreqRTRatio), DSFX_WAVESREVERB_HIGHFREQRTRATIO_MIN, DSFX_WAVESREVERB_HIGHFREQRTRATIO_MAX, false);
  55. m_sliderHighFreqRTRatio.SetValue(dsfxwavesreverb.fHighFreqRTRatio);
  56. return 1;
  57. }
  58. LRESULT CDirectSoundFXWavesReverbPage::OnControlMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  59. {
  60. LRESULT lr = MessageHandlerChain(m_rgpHandlers, uMsg, wParam, lParam, bHandled);
  61. if (bHandled)
  62. SetDirty(TRUE);
  63. return lr;
  64. }