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.

DistrhoUIQt.hpp 2.3KB

11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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() override;
  34. // ---------------------------------------------
  35. // UI Helpers
  36. void setSize(unsigned int width, unsigned int height);
  37. protected:
  38. // ---------------------------------------------
  39. // Information
  40. virtual bool d_resizable() const { return false; }
  41. virtual uint d_minimumWidth() const { return 100; }
  42. virtual uint d_minimumHeight() const { return 100; }
  43. // ---------------------------------------------
  44. // DSP Callbacks
  45. virtual void d_parameterChanged(uint32_t index, float value) override = 0;
  46. #if DISTRHO_PLUGIN_WANT_PROGRAMS
  47. virtual void d_programChanged(uint32_t index) override = 0;
  48. #endif
  49. #if DISTRHO_PLUGIN_WANT_STATE
  50. virtual void d_stateChanged(const char* key, const char* value) override = 0;
  51. #endif
  52. #if DISTRHO_PLUGIN_IS_SYNTH
  53. virtual void d_noteReceived(bool onOff, uint8_t channel, uint8_t note, uint8_t velocity) override = 0;
  54. #endif
  55. // ---------------------------------------------
  56. // UI Callbacks
  57. virtual void d_uiIdle() override {}
  58. private:
  59. friend class UIInternal;
  60. unsigned int d_width() const override { return width(); }
  61. unsigned int d_height() const override { return height(); }
  62. };
  63. // -------------------------------------------------
  64. END_NAMESPACE_DISTRHO
  65. #endif // __DISTRHO_UI_QT_HPP__