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.

86 lines
2.2KB

  1. /*
  2. * DISTRHO Plugin Toolkit (DPT)
  3. * Copyright (C) 2012-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 Lesser General Public
  7. * License as published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU Lesser General Public License for more details.
  13. *
  14. * For a full copy of the license see the LGPL.txt file
  15. */
  16. #ifndef __DISTRHO_UI_QT_HPP__
  17. #define __DISTRHO_UI_QT_HPP__
  18. #include "DistrhoUI.hpp"
  19. #include <QtCore/Qt>
  20. #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
  21. # include <QtWidgets/QWidget>
  22. #else
  23. # include <QtGui/QWidget>
  24. #endif
  25. START_NAMESPACE_DISTRHO
  26. // -------------------------------------------------
  27. // Qt UI
  28. class QtUI : public UI,
  29. public QWidget
  30. {
  31. public:
  32. QtUI();
  33. virtual ~QtUI();
  34. protected:
  35. // ---------------------------------------------
  36. // Information
  37. virtual bool d_resizable() { return false; }
  38. virtual uint d_minimumWidth() { return 100; }
  39. virtual uint d_minimumHeight() { return 100; }
  40. // ---------------------------------------------
  41. // DSP Callbacks
  42. virtual void d_parameterChanged(uint32_t index, float value) = 0;
  43. #if DISTRHO_PLUGIN_WANT_PROGRAMS
  44. virtual void d_programChanged(uint32_t index) = 0;
  45. #endif
  46. #if DISTRHO_PLUGIN_WANT_STATE
  47. virtual void d_stateChanged(const char* key, const char* value) = 0;
  48. #endif
  49. #if DISTRHO_PLUGIN_IS_SYNTH
  50. virtual void d_noteReceived(bool onOff, uint8_t channel, uint8_t note, uint8_t velocity) = 0;
  51. #endif
  52. // ---------------------------------------------
  53. // UI Callbacks
  54. virtual void d_uiIdle() {}
  55. // ---------------------------------------------
  56. // UI Helpers
  57. void setSize(unsigned int width, unsigned int height);
  58. private:
  59. friend class UIInternal;
  60. unsigned int d_width() const { return width(); }
  61. unsigned int d_height() const { return height(); }
  62. };
  63. // -------------------------------------------------
  64. END_NAMESPACE_DISTRHO
  65. #endif // __DISTRHO_UI_QT_HPP__