Collection of tools useful for audio production
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.

93 lines
2.3KB

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