Audio plugin host https://kx.studio/carla
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.

198 lines
6.6KB

  1. /*
  2. * Carla widgets code
  3. * Copyright (C) 2011-2019 Filipe Coelho <falktx@falktx.com>
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License as
  7. * published by the Free Software Foundation; either version 2 of
  8. * the License, or any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * For a full copy of the GNU General Public License see the doc/GPL.txt file.
  16. */
  17. #ifndef CARLA_WIDGETS_HPP_INCLUDED
  18. #define CARLA_WIDGETS_HPP_INCLUDED
  19. //---------------------------------------------------------------------------------------------------------------------
  20. // Imports (Global)
  21. #include <QtWidgets/QDialog>
  22. //---------------------------------------------------------------------------------------------------------------------
  23. // Imports (Custom)
  24. #include "CarlaJuceUtils.hpp"
  25. class CarlaHost;
  26. // --------------------------------------------------------------------------------------------------------------------
  27. // Carla About dialog
  28. class CarlaAboutW : public QDialog
  29. {
  30. Q_OBJECT
  31. public:
  32. CarlaAboutW(QWidget* parent, const CarlaHost& host);
  33. ~CarlaAboutW() override;
  34. private:
  35. struct PrivateData;
  36. PrivateData* const self;
  37. CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(CarlaAboutW)
  38. };
  39. // --------------------------------------------------------------------------------------------------------------------
  40. // JUCE About dialog
  41. class JuceAboutW : public QDialog
  42. {
  43. Q_OBJECT
  44. public:
  45. JuceAboutW(QWidget* parent);
  46. ~JuceAboutW() override;
  47. private:
  48. struct PrivateData;
  49. PrivateData* const self;
  50. CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(JuceAboutW)
  51. };
  52. // --------------------------------------------------------------------------------------------------------------------
  53. // Settings Dialog
  54. class PluginParameter : public QWidget
  55. {
  56. Q_OBJECT
  57. signals:
  58. void mappedControlChanged(int, int);
  59. void midiChannelChanged(int, int);
  60. void valueChanged(int, float);
  61. public:
  62. PluginParameter(QWidget* parent, const CarlaHost& host);
  63. ~PluginParameter() override;
  64. private:
  65. struct PrivateData;
  66. PrivateData* const self;
  67. // ----------------------------------------------------------------------------------------------------------------
  68. private slots:
  69. void slot_optionsCustomMenu();
  70. void slot_parameterDragStateChanged(bool touch);
  71. private:
  72. CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(PluginParameter)
  73. };
  74. //---------------------------------------------------------------------------------------------------------------------
  75. // Plugin Editor Parent (Meta class)
  76. class PluginEditParentMeta
  77. {
  78. protected:
  79. virtual void editDialogVisibilityChanged(int pluginId, bool visible) = 0;
  80. virtual void editDialogPluginHintsChanged(int pluginId, int hints) = 0;
  81. virtual void editDialogParameterValueChanged(int pluginId, int parameterId, float value) = 0;
  82. virtual void editDialogProgramChanged(int pluginId, int index) = 0;
  83. virtual void editDialogMidiProgramChanged(int pluginId, int index) = 0;
  84. virtual void editDialogNotePressed(int pluginId, int note) = 0;
  85. virtual void editDialogNoteReleased(int pluginId, int note) = 0;
  86. virtual void editDialogMidiActivityChanged(int pluginId, bool onOff) = 0;
  87. };
  88. //---------------------------------------------------------------------------------------------------------------------
  89. // Plugin Editor (Built-in)
  90. class PluginEdit : public QDialog
  91. {
  92. Q_OBJECT
  93. public:
  94. PluginEdit(QWidget* parent, const CarlaHost& host);
  95. ~PluginEdit() override;
  96. private:
  97. struct PrivateData;
  98. PrivateData* const self;
  99. protected:
  100. void closeEvent(QCloseEvent* event) override;
  101. void timerEvent(QTimerEvent* event) override;
  102. private slots:
  103. void slot_handleNoteOnCallback(int pluginId, int channel, int note, int velocity);
  104. void slot_handleNoteOffCallback(int pluginId, int channel, int note);
  105. void slot_handleUpdateCallback(int pluginId);
  106. void slot_handleReloadInfoCallback(int pluginId);
  107. void slot_handleReloadParametersCallback(int pluginId);
  108. void slot_handleReloadProgramsCallback(int pluginId);
  109. void slot_handleReloadAllCallback(int pluginId);
  110. //-----------------------------------------------------------------------------------------------------------------
  111. void slot_stateSave();
  112. void slot_stateLoad();
  113. //-----------------------------------------------------------------------------------------------------------------
  114. void slot_optionChanged(bool clicked);
  115. //-----------------------------------------------------------------------------------------------------------------
  116. void slot_dryWetChanged(float value);
  117. void slot_volumeChanged(float value);
  118. void slot_balanceLeftChanged(float value);
  119. void slot_balanceRightChanged(float value);
  120. void slot_panChanged(float value);
  121. void slot_ctrlChannelChanged(int value);
  122. //-----------------------------------------------------------------------------------------------------------------
  123. void slot_parameterValueChanged(int parameterId, float value);
  124. void slot_parameterMappedControlChanged(int parameterId, int control);
  125. void slot_parameterMidiChannelChanged(int parameterId, int channel);
  126. //-----------------------------------------------------------------------------------------------------------------
  127. void slot_programIndexChanged(int index);
  128. void slot_midiProgramIndexChanged(int index);
  129. //-----------------------------------------------------------------------------------------------------------------
  130. void slot_noteOn(int note);
  131. void slot_noteOff(int note);
  132. //-----------------------------------------------------------------------------------------------------------------
  133. void slot_finished();
  134. //-----------------------------------------------------------------------------------------------------------------
  135. void slot_knobCustomMenu();
  136. //-----------------------------------------------------------------------------------------------------------------
  137. void slot_channelCustomMenu();
  138. //-----------------------------------------------------------------------------------------------------------------
  139. private:
  140. CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(PluginEdit)
  141. };
  142. //---------------------------------------------------------------------------------------------------------------------
  143. #endif // CARLA_WIDGETS_HPP_INCLUDED