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.

105 lines
3.2KB

  1. /* -*- Mode: C ; c-basic-offset: 2 -*- */
  2. /*****************************************************************************
  3. *
  4. * This work is in public domain.
  5. *
  6. * This file is distributed in the hope that it will be useful,
  7. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9. *
  10. * If you have questions, contact Nedko Arnaudov <nedko@arnaudov.name> or
  11. * ask in #lad channel, FreeNode IRC network.
  12. *
  13. *****************************************************************************/
  14. #ifndef LV2_EXTERNAL_UI_H__5AFE09A5_0FB7_47AF_924E_2AF0F8DE8873__INCLUDED
  15. #define LV2_EXTERNAL_UI_H__5AFE09A5_0FB7_47AF_924E_2AF0F8DE8873__INCLUDED
  16. /** UI extension suitable for out-of-process UIs */
  17. #define LV2_EXTERNAL_UI_URI "http://nedko.arnaudov.name/lv2/external_ui/"
  18. /** This extension used to be defined by a lv2plug.in URI */
  19. #define LV2_EXTERNAL_UI_DEPRECATED_URI "http://lv2plug.in/ns/extensions/ui#external"
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. #if 0
  24. } /* Adjust editor indent */
  25. #endif
  26. /**
  27. * When LV2_EXTERNAL_UI_URI UI is instantiated, the returned
  28. * LV2UI_Widget handle must be cast to pointer to struct lv2_external_ui.
  29. * UI is created in invisible state.
  30. */
  31. struct lv2_external_ui
  32. {
  33. /**
  34. * Host calls this function regulary. UI library implementing the
  35. * callback may do IPC or redraw the UI.
  36. *
  37. * @param _this_ the UI context
  38. */
  39. void (* run)(struct lv2_external_ui * _this_);
  40. /**
  41. * Host calls this function to make the plugin UI visible.
  42. *
  43. * @param _this_ the UI context
  44. */
  45. void (* show)(struct lv2_external_ui * _this_);
  46. /**
  47. * Host calls this function to make the plugin UI invisible again.
  48. *
  49. * @param _this_ the UI context
  50. */
  51. void (* hide)(struct lv2_external_ui * _this_);
  52. };
  53. #define LV2_EXTERNAL_UI_RUN(ptr) (ptr)->run(ptr)
  54. #define LV2_EXTERNAL_UI_SHOW(ptr) (ptr)->show(ptr)
  55. #define LV2_EXTERNAL_UI_HIDE(ptr) (ptr)->hide(ptr)
  56. /**
  57. * On UI instantiation, host must supply LV2_EXTERNAL_UI_URI
  58. * feature. LV2_Feature::data must be pointer to struct lv2_external_ui_host. */
  59. struct lv2_external_ui_host
  60. {
  61. /**
  62. * Callback that plugin UI will call
  63. * when UI (GUI window) is closed by user.
  64. * This callback wil; be called during execution of lv2_external_ui::run()
  65. * (i.e. not from background thread).
  66. *
  67. * After this callback is called, UI is defunct. Host must call
  68. * LV2UI_Descriptor::cleanup(). If host wants to make the UI visible
  69. * again UI must be reinstantiated.
  70. *
  71. * @param controller Host context associated with plugin UI, as
  72. * supplied to LV2UI_Descriptor::instantiate()
  73. */
  74. void (* ui_closed)(LV2UI_Controller controller);
  75. /**
  76. * Optional (may be NULL) "user friendly" identifier which the UI
  77. * may display to allow a user to easily associate this particular
  78. * UI instance with the correct plugin instance as it is represented
  79. * by the host (e.g. "track 1" or "channel 4").
  80. *
  81. * If supplied by host, the string will be referenced only during
  82. * LV2UI_Descriptor::instantiate()
  83. */
  84. const char * plugin_human_id;
  85. };
  86. #if 0
  87. { /* Adjust editor indent */
  88. #endif
  89. #ifdef __cplusplus
  90. } /* extern "C" */
  91. #endif
  92. #endif /* #ifndef LV2_EXTERNAL_UI_H__5AFE09A5_0FB7_47AF_924E_2AF0F8DE8873__INCLUDED */