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.

91 lines
2.0KB

  1. /*
  2. * Carla Plugin
  3. * Copyright (C) 2011-2013 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 GPL.txt file
  16. */
  17. #ifndef CARLA_PLUGIN_GUI_HPP_INCLUDED
  18. #define CARLA_PLUGIN_GUI_HPP_INCLUDED
  19. #include "CarlaPluginInternal.hpp"
  20. #include "juce_gui_basics.h"
  21. #if 0
  22. #include <QtGui/QCloseEvent>
  23. # if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
  24. # include <QtWidgets/QMainWindow>
  25. #else
  26. # include <QtGui/QMainWindow>
  27. #endif
  28. CARLA_BACKEND_START_NAMESPACE
  29. #if 0
  30. } // Fix editor indentation
  31. #endif
  32. class CarlaPluginGui : public QMainWindow
  33. {
  34. Q_OBJECT
  35. public:
  36. class Callback
  37. {
  38. public:
  39. virtual ~Callback() {}
  40. virtual void guiClosedCallback() = 0;
  41. };
  42. struct Options {
  43. bool parented;
  44. bool resizable;
  45. };
  46. CarlaPluginGui(CarlaEngine* const engine, Callback* const callback, const Options& options, const QByteArray& lastGeometry);
  47. ~CarlaPluginGui();
  48. void setSize(const int width, const int height);
  49. // Parent UIs
  50. void* getContainerWinId();
  51. // Qt UIs
  52. void setWidget(QWidget* widget);
  53. protected:
  54. void closeEvent(QCloseEvent* const event);
  55. private:
  56. Callback* const kCallback;
  57. QWidget* fContainer;
  58. const Options fOptions;
  59. signals:
  60. void setSizeSafeSignal(int, int);
  61. private slots:
  62. void setSizeSafeSlot(int width, int height);
  63. #ifndef MOC_PARSING
  64. CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(CarlaPluginGui)
  65. #endif
  66. };
  67. CARLA_BACKEND_END_NAMESPACE
  68. #endif
  69. #endif // CARLA_PLUGIN_GUI_HPP_INCLUDED