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.

85 lines
1.9KB

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