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.

79 lines
1.8KB

  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__
  18. #define __CARLA_PLUGIN_GUI_HPP__
  19. #include "CarlaPluginInternal.hpp"
  20. #include <QtGui/QMainWindow>
  21. #include <QtGui/QCloseEvent>
  22. CARLA_BACKEND_START_NAMESPACE
  23. class CarlaPluginGui : public QMainWindow
  24. {
  25. Q_OBJECT
  26. public:
  27. class Callback
  28. {
  29. public:
  30. virtual ~Callback() {}
  31. virtual void guiClosedCallback() = 0;
  32. };
  33. struct Options {
  34. bool parented;
  35. bool resizable;
  36. };
  37. CarlaPluginGui(CarlaEngine* const engine, Callback* const callback, const Options& options);
  38. ~CarlaPluginGui();
  39. void setSize(const int width, const int height);
  40. // Parent UIs
  41. void* getContainerWinId();
  42. // Qt UIs
  43. void setWidget(QWidget* widget);
  44. void removeWidget();
  45. protected:
  46. void closeEvent(QCloseEvent* const event);
  47. private:
  48. Callback* const kCallback;
  49. QWidget* fContainer;
  50. const Options fOptions;
  51. signals:
  52. void setSizeSafeSignal(int, int);
  53. private slots:
  54. void setSizeSafeSlot(int width, int height);
  55. #ifndef MOC_PARSING
  56. CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(CarlaPluginGui)
  57. #endif
  58. };
  59. CARLA_BACKEND_END_NAMESPACE
  60. #endif // __CARLA_PLUGIN_GUI_HPP__