1
0

View_gen.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. /*
  2. * view_gen.h
  3. * ----------
  4. * Purpose: General tab, lower panel.
  5. * Notes : (currently none)
  6. * Authors: Olivier Lapicque
  7. * OpenMPT Devs
  8. * The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
  9. */
  10. #pragma once
  11. #include "openmpt/all/BuildSettings.hpp"
  12. #include "ColorPickerButton.h"
  13. OPENMPT_NAMESPACE_BEGIN
  14. //Note: Changing this won't increase the number of tabs in general view. Most
  15. //of the code use plain number 4.
  16. #define CHANNELS_IN_TAB 4
  17. class CViewGlobals: public CFormView
  18. {
  19. protected:
  20. CRect m_rcClient;
  21. CTabCtrl m_TabCtrl;
  22. CComboBox m_CbnEffects[CHANNELS_IN_TAB];
  23. CComboBox m_CbnPlugin, m_CbnParam, m_CbnOutput;
  24. CSliderCtrl m_sbVolume[CHANNELS_IN_TAB], m_sbPan[CHANNELS_IN_TAB], m_sbValue, m_sbDryRatio;
  25. ColorPickerButton m_channelColor[CHANNELS_IN_TAB];
  26. CComboBox m_CbnPreset;
  27. CSliderCtrl m_sbWetDry;
  28. CSpinButtonCtrl m_spinVolume[CHANNELS_IN_TAB], m_spinPan[CHANNELS_IN_TAB];
  29. CButton m_BtnSelect, m_BtnEdit;
  30. int m_nLockCount = 1;
  31. PlugParamIndex m_nCurrentParam = 0;
  32. CHANNELINDEX m_nActiveTab = 0;
  33. CHANNELINDEX m_lastEdit = CHANNELINDEX_INVALID;
  34. PLUGINDEX m_nCurrentPlugin = 0;
  35. CComboBox m_CbnSpecialMixProcessing;
  36. CSpinButtonCtrl m_SpinMixGain;
  37. enum {AdjustPattern = true, NoPatternAdjust = false};
  38. protected:
  39. CViewGlobals() : CFormView(IDD_VIEW_GLOBALS) { }
  40. DECLARE_SERIAL(CViewGlobals)
  41. public:
  42. CModDoc* GetDocument() const { return static_cast<CModDoc *>(m_pDocument); }
  43. void RecalcLayout();
  44. void LockControls() { m_nLockCount++; }
  45. void UnlockControls() { PostMessage(WM_MOD_UNLOCKCONTROLS); }
  46. bool IsLocked() const noexcept { return (m_nLockCount > 0); }
  47. int GetDlgItemIntEx(UINT nID);
  48. void PopulateChannelPlugins(PLUGINDEX plugin = PLUGINDEX_INVALID);
  49. void BuildEmptySlotList(std::vector<PLUGINDEX> &emptySlots);
  50. bool MovePlug(PLUGINDEX src, PLUGINDEX dest, bool bAdjustPat = AdjustPattern);
  51. public:
  52. //{{AFX_VIRTUAL(CViewGlobals)
  53. void OnInitialUpdate() override;
  54. void DoDataExchange(CDataExchange *pDX) override;
  55. void OnUpdate(CView *pSender, LPARAM lHint, CObject *pHint) override;
  56. void UpdateView(UpdateHint hint, CObject *pObj = nullptr);
  57. LRESULT OnModViewMsg(WPARAM, LPARAM);
  58. LRESULT OnMidiMsg(WPARAM midiData, LPARAM);
  59. private:
  60. void PrepareUndo(CHANNELINDEX chnMod4);
  61. void UndoRedo(bool undo);
  62. void OnEditColor(const CHANNELINDEX chnMod4);
  63. void OnMute(const CHANNELINDEX chnMod4, const UINT itemID);
  64. void OnSurround(const CHANNELINDEX chnMod4, const UINT itemID);
  65. void OnEditVol(const CHANNELINDEX chnMod4, const UINT itemID);
  66. void OnEditPan(const CHANNELINDEX chnMod4, const UINT itemID);
  67. void OnEditName(const CHANNELINDEX chnMod4, const UINT itemID);
  68. void OnFxChanged(const CHANNELINDEX chnMod4);
  69. IMixPlugin *GetCurrentPlugin() const;
  70. void FillPluginProgramBox(int32 firstProg, int32 lastProg);
  71. void SetPluginModified();
  72. void UpdateDryWetDisplay();
  73. protected:
  74. //{{AFX_MSG(CViewGlobals)
  75. afx_msg void OnEditUndo();
  76. afx_msg void OnEditRedo();
  77. afx_msg void OnUpdateUndo(CCmdUI *pCmdUI);
  78. afx_msg void OnUpdateRedo(CCmdUI *pCmdUI);
  79. afx_msg void OnEditColor1();
  80. afx_msg void OnEditColor2();
  81. afx_msg void OnEditColor3();
  82. afx_msg void OnEditColor4();
  83. afx_msg void OnMute1();
  84. afx_msg void OnMute2();
  85. afx_msg void OnMute3();
  86. afx_msg void OnMute4();
  87. afx_msg void OnSurround1();
  88. afx_msg void OnSurround2();
  89. afx_msg void OnSurround3();
  90. afx_msg void OnSurround4();
  91. afx_msg void OnEditVol1();
  92. afx_msg void OnEditVol2();
  93. afx_msg void OnEditVol3();
  94. afx_msg void OnEditVol4();
  95. afx_msg void OnEditPan1();
  96. afx_msg void OnEditPan2();
  97. afx_msg void OnEditPan3();
  98. afx_msg void OnEditPan4();
  99. afx_msg void OnEditName1();
  100. afx_msg void OnEditName2();
  101. afx_msg void OnEditName3();
  102. afx_msg void OnEditName4();
  103. afx_msg void OnFx1Changed();
  104. afx_msg void OnFx2Changed();
  105. afx_msg void OnFx3Changed();
  106. afx_msg void OnFx4Changed();
  107. afx_msg void OnPluginChanged();
  108. afx_msg void OnPluginNameChanged();
  109. afx_msg void OnFillParamCombo();
  110. afx_msg void OnParamChanged();
  111. afx_msg void OnFocusParam();
  112. afx_msg void OnFillProgramCombo();
  113. afx_msg void OnProgramChanged();
  114. afx_msg void OnLoadParam();
  115. afx_msg void OnSaveParam();
  116. afx_msg void OnSelectPlugin();
  117. afx_msg void OnRemovePlugin();
  118. afx_msg void OnSetParameter();
  119. afx_msg void OnEditPlugin();
  120. afx_msg void OnMixModeChanged();
  121. afx_msg void OnBypassChanged();
  122. afx_msg void OnDryMixChanged();
  123. afx_msg void OnMovePlugToSlot();
  124. afx_msg void OnInsertSlot();
  125. afx_msg void OnClonePlug();
  126. LRESULT OnParamAutomated(WPARAM plugin, LPARAM param);
  127. LRESULT OnDryWetRatioChangedFromPlayer(WPARAM plugin, LPARAM);
  128. afx_msg void OnWetDryExpandChanged();
  129. afx_msg void OnSpecialMixProcessingChanged();
  130. afx_msg void OnOutputRoutingChanged();
  131. afx_msg void OnPrevPlugin();
  132. afx_msg void OnNextPlugin();
  133. afx_msg void OnDestroy();
  134. afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
  135. afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
  136. afx_msg void OnSize(UINT nType, int cx, int cy);
  137. afx_msg void OnTabSelchange(NMHDR* pNMHDR, LRESULT* pResult);
  138. afx_msg LRESULT OnMDIDeactivate(WPARAM, LPARAM);
  139. afx_msg LRESULT OnUnlockControls(WPARAM, LPARAM) { if (m_nLockCount > 0) m_nLockCount--; return 0; }
  140. afx_msg BOOL OnToolTipText(UINT, NMHDR *pNMHDR, LRESULT *pResult);
  141. //}}AFX_MSG
  142. DECLARE_MESSAGE_MAP()
  143. };
  144. OPENMPT_NAMESPACE_END