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.

carla_widgets.hpp 7.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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. #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
  22. # pragma GCC diagnostic push
  23. # pragma GCC diagnostic ignored "-Wconversion"
  24. # pragma GCC diagnostic ignored "-Weffc++"
  25. # pragma GCC diagnostic ignored "-Wsign-conversion"
  26. #endif
  27. #include <QtWidgets/QDialog>
  28. #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
  29. # pragma GCC diagnostic pop
  30. #endif
  31. //---------------------------------------------------------------------------------------------------------------------
  32. // Imports (Custom)
  33. #include "CarlaJuceUtils.hpp"
  34. class CarlaHost;
  35. // --------------------------------------------------------------------------------------------------------------------
  36. // Carla About dialog
  37. class CarlaAboutW : public QDialog
  38. {
  39. Q_OBJECT
  40. public:
  41. CarlaAboutW(QWidget* parent, const CarlaHost& host);
  42. ~CarlaAboutW() override;
  43. private:
  44. struct PrivateData;
  45. PrivateData* const self;
  46. CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(CarlaAboutW)
  47. };
  48. // --------------------------------------------------------------------------------------------------------------------
  49. // JUCE About dialog
  50. class JuceAboutW : public QDialog
  51. {
  52. Q_OBJECT
  53. public:
  54. JuceAboutW(QWidget* parent);
  55. ~JuceAboutW() override;
  56. private:
  57. struct PrivateData;
  58. PrivateData* const self;
  59. CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(JuceAboutW)
  60. };
  61. // --------------------------------------------------------------------------------------------------------------------
  62. // Settings Dialog
  63. class PluginParameter : public QWidget
  64. {
  65. Q_OBJECT
  66. signals:
  67. void mappedControlChanged(int, int);
  68. void midiChannelChanged(int, int);
  69. void valueChanged(int, float);
  70. public:
  71. PluginParameter(QWidget* parent, const CarlaHost& host);
  72. ~PluginParameter() override;
  73. private:
  74. struct PrivateData;
  75. PrivateData* const self;
  76. // ----------------------------------------------------------------------------------------------------------------
  77. private slots:
  78. void slot_optionsCustomMenu();
  79. void slot_parameterDragStateChanged(bool touch);
  80. private:
  81. CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(PluginParameter)
  82. };
  83. //---------------------------------------------------------------------------------------------------------------------
  84. // Plugin Editor Parent (Meta class)
  85. class PluginEditParentMeta
  86. {
  87. protected:
  88. virtual ~PluginEditParentMeta() {};
  89. virtual void editDialogVisibilityChanged(int pluginId, bool visible) = 0;
  90. virtual void editDialogPluginHintsChanged(int pluginId, int hints) = 0;
  91. virtual void editDialogParameterValueChanged(int pluginId, int parameterId, float value) = 0;
  92. virtual void editDialogProgramChanged(int pluginId, int index) = 0;
  93. virtual void editDialogMidiProgramChanged(int pluginId, int index) = 0;
  94. virtual void editDialogNotePressed(int pluginId, int note) = 0;
  95. virtual void editDialogNoteReleased(int pluginId, int note) = 0;
  96. virtual void editDialogMidiActivityChanged(int pluginId, bool onOff) = 0;
  97. };
  98. //---------------------------------------------------------------------------------------------------------------------
  99. // Plugin Editor (Built-in)
  100. class PluginEdit : public QDialog
  101. {
  102. Q_OBJECT
  103. public:
  104. PluginEdit(QWidget* parent, const CarlaHost& host);
  105. ~PluginEdit() override;
  106. private:
  107. struct PrivateData;
  108. PrivateData* const self;
  109. protected:
  110. void closeEvent(QCloseEvent* event) override;
  111. void timerEvent(QTimerEvent* event) override;
  112. private slots:
  113. void slot_handleNoteOnCallback(int pluginId, int channel, int note, int velocity);
  114. void slot_handleNoteOffCallback(int pluginId, int channel, int note);
  115. void slot_handleUpdateCallback(int pluginId);
  116. void slot_handleReloadInfoCallback(int pluginId);
  117. void slot_handleReloadParametersCallback(int pluginId);
  118. void slot_handleReloadProgramsCallback(int pluginId);
  119. void slot_handleReloadAllCallback(int pluginId);
  120. //-----------------------------------------------------------------------------------------------------------------
  121. void slot_stateSave();
  122. void slot_stateLoad();
  123. //-----------------------------------------------------------------------------------------------------------------
  124. void slot_optionChanged(bool clicked);
  125. //-----------------------------------------------------------------------------------------------------------------
  126. void slot_dryWetChanged(float value);
  127. void slot_volumeChanged(float value);
  128. void slot_balanceLeftChanged(float value);
  129. void slot_balanceRightChanged(float value);
  130. void slot_panChanged(float value);
  131. void slot_ctrlChannelChanged(int value);
  132. //-----------------------------------------------------------------------------------------------------------------
  133. void slot_parameterValueChanged(int parameterId, float value);
  134. void slot_parameterMappedControlChanged(int parameterId, int control);
  135. void slot_parameterMidiChannelChanged(int parameterId, int channel);
  136. //-----------------------------------------------------------------------------------------------------------------
  137. void slot_programIndexChanged(int index);
  138. void slot_midiProgramIndexChanged(int index);
  139. //-----------------------------------------------------------------------------------------------------------------
  140. void slot_noteOn(int note);
  141. void slot_noteOff(int note);
  142. //-----------------------------------------------------------------------------------------------------------------
  143. void slot_finished();
  144. //-----------------------------------------------------------------------------------------------------------------
  145. void slot_knobCustomMenu();
  146. //-----------------------------------------------------------------------------------------------------------------
  147. void slot_channelCustomMenu();
  148. //-----------------------------------------------------------------------------------------------------------------
  149. private:
  150. CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(PluginEdit)
  151. };
  152. //---------------------------------------------------------------------------------------------------------------------
  153. #endif // CARLA_WIDGETS_HPP_INCLUDED