1
0

SelectPluginDialog.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*
  2. * SelectPluginDialog.h
  3. * --------------------
  4. * Purpose: Dialog for adding plugins to a song.
  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 "ResizableDialog.h"
  13. #include "../common/ComponentManager.h"
  14. OPENMPT_NAMESPACE_BEGIN
  15. class CModDoc;
  16. struct SNDMIXPLUGIN;
  17. struct VSTPluginLib;
  18. class ComponentPluginBridge_x86;
  19. class ComponentPluginBridgeLegacy_x86;
  20. class ComponentPluginBridge_amd64;
  21. class ComponentPluginBridgeLegacy_amd64;
  22. #if defined(MPT_WITH_WINDOWS10)
  23. class ComponentPluginBridge_arm;
  24. class ComponentPluginBridgeLegacy_arm;
  25. class ComponentPluginBridge_arm64;
  26. class ComponentPluginBridgeLegacy_arm64;
  27. #endif // MPT_WITH_WINDOWS10
  28. class CSelectPluginDlg : public ResizableDialog
  29. {
  30. protected:
  31. SNDMIXPLUGIN *m_pPlugin = nullptr;
  32. CModDoc *m_pModDoc = nullptr;
  33. CTreeCtrl m_treePlugins;
  34. CButton m_chkBridge;
  35. CButton m_chkShare;
  36. CButton m_chkLegacyBridge;
  37. mpt::ustring m_nameFilter;
  38. #ifdef MPT_WITH_VST
  39. ComponentHandle<ComponentPluginBridge_x86> pluginBridge_x86;
  40. ComponentHandle<ComponentPluginBridgeLegacy_x86> pluginBridgeLegacy_x86;
  41. ComponentHandle<ComponentPluginBridge_amd64> pluginBridge_amd64;
  42. ComponentHandle<ComponentPluginBridgeLegacy_amd64> pluginBridgeLegacy_amd64;
  43. #if defined(MPT_WITH_WINDOWS10)
  44. ComponentHandle<ComponentPluginBridge_arm> pluginBridge_arm;
  45. ComponentHandle<ComponentPluginBridgeLegacy_arm> pluginBridgeLegacy_arm;
  46. ComponentHandle<ComponentPluginBridge_arm64> pluginBridge_arm64;
  47. ComponentHandle<ComponentPluginBridgeLegacy_arm64> pluginBridgeLegacy_arm64;
  48. #endif // MPT_WITH_WINDOWS10
  49. #endif // !MPT_WITH_VST
  50. PLUGINDEX m_nPlugSlot = 0;
  51. public:
  52. CSelectPluginDlg(CModDoc *pModDoc, PLUGINDEX pluginSlot, CWnd *parent);
  53. ~CSelectPluginDlg();
  54. static VSTPluginLib *ScanPlugins(const mpt::PathString &path, CWnd *parent);
  55. static bool VerifyPlugin(VSTPluginLib *plug, CWnd *parent);
  56. protected:
  57. HTREEITEM AddTreeItem(const TCHAR *title, int image, bool sort, HTREEITEM hParent = TVI_ROOT, LPARAM lParam = NULL);
  58. VSTPluginLib *GetSelectedPlugin();
  59. void SaveWindowPos() const;
  60. void ReloadMissingPlugins(const VSTPluginLib *lib) const;
  61. void UpdatePluginsList(const VSTPluginLib *forceSelect = nullptr);
  62. void DoDataExchange(CDataExchange *pDX) override;
  63. BOOL OnInitDialog() override;
  64. void OnOK() override;
  65. void OnCancel() override;
  66. BOOL PreTranslateMessage(MSG *pMsg) override;
  67. DECLARE_MESSAGE_MAP()
  68. afx_msg void OnAddPlugin();
  69. afx_msg void OnScanFolder();
  70. afx_msg void OnRemovePlugin();
  71. afx_msg void OnNameFilterChanged();
  72. afx_msg void OnSetBridge();
  73. afx_msg void OnSelChanged(NMHDR *pNotifyStruct, LRESULT *result);
  74. afx_msg void OnSelDblClk(NMHDR *pNotifyStruct, LRESULT *result);
  75. afx_msg void OnPluginTagsChanged();
  76. };
  77. OPENMPT_NAMESPACE_END