MIDIMacroDialog.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * MIDIMacroDialog.h
  3. * -----------------
  4. * Purpose: MIDI Macro Configuration Dialog
  5. * Notes : (currently none)
  6. * Authors: 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 "ColourEdit.h"
  12. #include "../common/misc_util.h"
  13. #include "../soundlib/MIDIMacros.h"
  14. #include "mpt/base/alloc.hpp"
  15. OPENMPT_NAMESPACE_BEGIN
  16. class CMidiMacroSetup: public CDialog
  17. {
  18. protected:
  19. CComboBox m_CbnSFx, m_CbnSFxPreset, m_CbnZxx, m_CbnZxxPreset, m_CbnMacroPlug, m_CbnMacroParam, m_CbnMacroCC;
  20. CEdit m_EditSFx, m_EditZxx;
  21. CColourEdit m_EditMacroValue[kSFxMacros], m_EditMacroType[kSFxMacros];
  22. CButton m_EditMacro[kSFxMacros], m_BtnMacroShowAll[kSFxMacros];
  23. CSoundFile &m_SndFile;
  24. public:
  25. CMidiMacroSetup(CSoundFile &sndFile, CWnd *parent = nullptr) : CDialog(IDD_MIDIMACRO, parent), m_SndFile(sndFile), m_vMidiCfg(sndFile.m_MidiCfg), m_MidiCfg(*m_vMidiCfg) { }
  26. private:
  27. mpt::heap_value<MIDIMacroConfig> m_vMidiCfg;
  28. public:
  29. MIDIMacroConfig & m_MidiCfg;
  30. protected:
  31. BOOL OnInitDialog() override;
  32. void DoDataExchange(CDataExchange* pDX) override;
  33. bool ValidateMacroString(CEdit &wnd, const MIDIMacroConfig::Macro &prevMacro, bool isParametric);
  34. void UpdateMacroList(int macro=-1);
  35. void ToggleBoxes(UINT preset, UINT sfx);
  36. afx_msg void UpdateDialog();
  37. afx_msg void OnSetAsDefault();
  38. afx_msg void OnResetCfg();
  39. afx_msg void OnMacroHelp();
  40. afx_msg void OnSFxChanged();
  41. afx_msg void OnSFxPresetChanged();
  42. afx_msg void OnZxxPresetChanged();
  43. afx_msg void OnSFxEditChanged();
  44. afx_msg void OnZxxEditChanged();
  45. afx_msg void UpdateZxxSelection();
  46. afx_msg void OnPlugChanged();
  47. afx_msg void OnPlugParamChanged();
  48. afx_msg void OnCCChanged();
  49. afx_msg void OnViewAllParams(UINT id);
  50. afx_msg void OnSetSFx(UINT id);
  51. DECLARE_MESSAGE_MAP()
  52. };
  53. OPENMPT_NAMESPACE_END