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.

92 lines
2.3KB

  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_H__
  17. #define __DISTRHO_UI_H__
  18. #include "DistrhoUtils.h"
  19. START_NAMESPACE_DISTRHO
  20. // -------------------------------------------------
  21. struct UIPrivateData;
  22. class UI
  23. {
  24. public:
  25. UI();
  26. virtual ~UI();
  27. // ---------------------------------------------
  28. // Host DSP State
  29. double d_sampleRate() const;
  30. void d_setParameterValue(uint32_t index, float value);
  31. #if DISTRHO_PLUGIN_WANT_STATE
  32. void d_setState(const char* key, const char* value);
  33. #endif
  34. // Host UI State
  35. void d_uiEditParameter(uint32_t index, bool started);
  36. #if DISTRHO_PLUGIN_IS_SYNTH
  37. void d_uiSendNote(bool onOff, uint8_t channel, uint8_t note, uint8_t velocity);
  38. #endif
  39. void d_uiResize(int width, int height);
  40. // ---------------------------------------------
  41. protected:
  42. // Information
  43. virtual int d_width() = 0;
  44. virtual int d_height() = 0;
  45. // DSP Callbacks
  46. virtual void d_parameterChanged(uint32_t index, float value) = 0;
  47. #if DISTRHO_PLUGIN_WANT_PROGRAMS
  48. virtual void d_programChanged(uint32_t index) = 0;
  49. #endif
  50. #if DISTRHO_PLUGIN_WANT_STATE
  51. virtual void d_stateChanged(const char* key, const char* value) = 0;
  52. #endif
  53. #if DISTRHO_PLUGIN_IS_SYNTH
  54. virtual void d_uiNoteReceived(bool onOff, uint8_t channel, uint8_t note, uint8_t velocity);
  55. #endif
  56. // UI Callbacks
  57. virtual void d_uiIdle() = 0;
  58. // ---------------------------------------------
  59. private:
  60. UIPrivateData* data;
  61. friend class UIInternal;
  62. #ifdef DISTRHO_UI_QT4
  63. friend class Qt4UI;
  64. #else
  65. friend class OpenGLUI;
  66. friend class OpenGLExtUI;
  67. #endif
  68. };
  69. UI* createUI();
  70. // -------------------------------------------------
  71. END_NAMESPACE_DISTRHO
  72. #endif // __DISTRHO_UI_H__