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.

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