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.

94 lines
2.5KB

  1. /*
  2. * DISTRHO Ildaeil Plugin
  3. * Copyright (C) 2021 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 3 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 LICENSE file.
  16. */
  17. #include "DistrhoUI.hpp"
  18. #include "ResizeHandle.hpp"
  19. START_NAMESPACE_DISTRHO
  20. // -----------------------------------------------------------------------------------------------------------
  21. class IldaeilUI : public UI
  22. {
  23. void* fContext;
  24. ResizeHandle fResizeHandle;
  25. public:
  26. IldaeilUI()
  27. : UI(1280, 720),
  28. fContext(getPluginInstancePointer()),
  29. fResizeHandle(this)
  30. {
  31. }
  32. ~IldaeilUI() override
  33. {
  34. }
  35. void onImGuiDisplay() override
  36. {
  37. float width = getWidth();
  38. float height = getHeight();
  39. float margin = 20.0f;
  40. ImGui::SetNextWindowPos(ImVec2(margin, margin));
  41. ImGui::SetNextWindowSize(ImVec2(width - 2 * margin, height - 2 * margin));
  42. if (ImGui::Begin("Plugin List"))
  43. {
  44. }
  45. ImGui::End();
  46. }
  47. void uiIdle() override
  48. {
  49. }
  50. protected:
  51. /* --------------------------------------------------------------------------------------------------------
  52. * DSP/Plugin Callbacks */
  53. /**
  54. A parameter has changed on the plugin side.
  55. This is called by the host to inform the UI about parameter changes.
  56. */
  57. void parameterChanged(uint32_t index, float value) override
  58. {
  59. }
  60. // -------------------------------------------------------------------------------------------------------
  61. private:
  62. /**
  63. Set our UI class as non-copyable and add a leak detector just in case.
  64. */
  65. DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(IldaeilUI)
  66. };
  67. /* ------------------------------------------------------------------------------------------------------------
  68. * UI entry point, called by DPF to create a new UI instance. */
  69. UI* createUI()
  70. {
  71. return new IldaeilUI();
  72. }
  73. // -----------------------------------------------------------------------------------------------------------
  74. END_NAMESPACE_DISTRHO