DISTRHO Plugin Framework
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.

111 lines
2.4KB

  1. /*
  2. * DISTRHO Plugin Framework (DPF)
  3. * Copyright (C) 2012-2019 Filipe Coelho <falktx@falktx.com>
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for any purpose with
  6. * or without fee is hereby granted, provided that the above copyright notice and this
  7. * permission notice appear in all copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
  10. * TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN
  11. * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  12. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
  13. * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  14. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #ifndef DISTRHO_VSTGUI_HPP_INCLUDED
  17. #define DISTRHO_VSTGUI_HPP_INCLUDED
  18. #include "Base.hpp"
  19. #include "../distrho/extra/String.hpp"
  20. START_NAMESPACE_DGL
  21. // -----------------------------------------------------------------------
  22. class VstGuiWidget
  23. {
  24. public:
  25. VstGuiWidget(const uint w = 1, const uint h = 1, const char* const t = "")
  26. : width(w),
  27. height(h),
  28. title(t),
  29. transientWinId(0),
  30. visible(false) {}
  31. virtual ~VstGuiWidget()
  32. {
  33. }
  34. uint getWidth() const noexcept
  35. {
  36. return width;
  37. }
  38. uint getHeight() const noexcept
  39. {
  40. return height;
  41. }
  42. const char* getTitle() const noexcept
  43. {
  44. return title;
  45. }
  46. uintptr_t getTransientWinId() const noexcept
  47. {
  48. return transientWinId;
  49. }
  50. bool isVisible() const noexcept
  51. {
  52. return visible;
  53. }
  54. bool isRunning() noexcept
  55. {
  56. return visible;
  57. }
  58. virtual void idle() {}
  59. virtual void setSize(uint w, uint h)
  60. {
  61. width = w;
  62. height = h;
  63. }
  64. virtual void setTitle(const char* const t)
  65. {
  66. title = t;
  67. }
  68. virtual void setTransientWinId(const uintptr_t winId)
  69. {
  70. transientWinId = winId;
  71. }
  72. virtual void setVisible(const bool yesNo)
  73. {
  74. visible = yesNo;
  75. }
  76. void terminateAndWaitForProcess()
  77. {
  78. }
  79. private:
  80. uint width;
  81. uint height;
  82. DISTRHO_NAMESPACE::String title;
  83. uintptr_t transientWinId;
  84. bool visible;
  85. };
  86. // -----------------------------------------------------------------------
  87. END_NAMESPACE_DGL
  88. #endif // DISTRHO_VSTGUI_HPP_INCLUDED