LFOPluginEditor.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * LFOPluginEditor.h
  3. * -----------------
  4. * Purpose: Editor interface for the LFO plugin.
  5. * Notes : (currently none)
  6. * Authors: Johannes Schultz (OpenMPT Devs)
  7. * The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
  8. */
  9. #pragma once
  10. #include "openmpt/all/BuildSettings.hpp"
  11. #include "../AbstractVstEditor.h"
  12. #include "../../soundlib/plugins/LFOPlugin.h"
  13. OPENMPT_NAMESPACE_BEGIN
  14. struct UpdateHint;
  15. class LFOPluginEditor : public CAbstractVstEditor
  16. {
  17. protected:
  18. CComboBox m_plugParam, m_outPlug, m_midiCC;
  19. CSliderCtrl m_amplitudeSlider, m_offsetSlider, m_frequencySlider;
  20. CEdit m_midiChnEdit;
  21. CSpinButtonCtrl m_midiChnSpin;
  22. LFOPlugin &m_lfoPlugin;
  23. bool m_locked : 1;
  24. static constexpr int SLIDER_GRANULARITY = 1000;
  25. public:
  26. LFOPluginEditor(LFOPlugin &plugin);
  27. bool OpenEditor(CWnd *parent) override;
  28. bool IsResizable() const override { return false; }
  29. bool SetSize(int, int) override { return false; }
  30. void UpdateParamDisplays() override;
  31. void UpdateParam(int32 param) override;
  32. void UpdateView(UpdateHint hint) override;
  33. protected:
  34. void DoDataExchange(CDataExchange* pDX) override;
  35. void OnHScroll(UINT nCode, UINT nPos, CScrollBar *pSB);
  36. void InitSlider(CSliderCtrl &slider, LFOPlugin::Parameters param);
  37. void SetSliderText(LFOPlugin::Parameters param);
  38. void SetSliderValue(CSliderCtrl &slider, float value);
  39. float GetSliderValue(CSliderCtrl &slider);
  40. void OnPolarityChanged();
  41. void OnTempoSyncChanged();
  42. void OnBypassChanged();
  43. void OnLoopModeChanged();
  44. void OnWaveformChanged(UINT nID);
  45. void OnPlugParameterChanged();
  46. void OnMidiCCChanged();
  47. void OnParameterChanged();
  48. void OnOutputPlugChanged();
  49. void OnPluginEditor();
  50. LRESULT OnUpdateParam(WPARAM wParam, LPARAM lParam);
  51. DECLARE_MESSAGE_MAP()
  52. };
  53. OPENMPT_NAMESPACE_END