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.

106 lines
3.2KB

  1. /*
  2. Copyright 2012 David Robillard <http://drobilla.net>
  3. Copyright 2016 Robin Gareus <robin@gareus.org>
  4. Permission to use, copy, modify, and/or distribute this software for any
  5. purpose with or without fee is hereby granted, provided that the above
  6. copyright notice and this permission notice appear in all copies.
  7. THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  8. WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  9. MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  10. ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  11. WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  12. ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  13. OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  14. */
  15. /**
  16. @defgroup inlinedisplay Inline-Display
  17. Support for displaying a miniaturized, non-interactive view
  18. in the host's mixer strip.
  19. @{
  20. */
  21. #ifndef LV2_INLINE_DISPLAY_H
  22. #define LV2_INLINE_DISPLAY_H
  23. #include <stdint.h>
  24. #include "lv2.h"
  25. #define LV2_INLINEDISPLAY_URI "http://harrisonconsoles.com/lv2/inlinedisplay"
  26. #define LV2_INLINEDISPLAY_PREFIX LV2_INLINEDISPLAY_URI "#"
  27. #define LV2_INLINEDISPLAY__interface LV2_INLINEDISPLAY_PREFIX "interface"
  28. #define LV2_INLINEDISPLAY__queue_draw LV2_INLINEDISPLAY_PREFIX "queue_draw"
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32. /** Opaque handle for LV2_Inline_Display::queue_draw() */
  33. typedef void* LV2_Inline_Display_Handle;
  34. /** raw image pixmap format is ARGB32,
  35. * the data pointer is owned by the plugin and must be valid
  36. * from the first call to render until cleanup.
  37. */
  38. typedef struct {
  39. unsigned char *data;
  40. int width;
  41. int height;
  42. int stride;
  43. } LV2_Inline_Display_Image_Surface;
  44. /** a LV2 Feature provided by the Host to the plugin
  45. *
  46. * This allows a the plugin during in realtime context to
  47. * invalidate the currently displayed data and request from
  48. * the host to call render() as soon as feasible.
  49. */
  50. typedef struct {
  51. /** Opaque host data */
  52. LV2_Inline_Display_Handle handle;
  53. /** Request from run() that the host should call render() at a later
  54. * time to update the inline display
  55. */
  56. void (*queue_draw)(LV2_Inline_Display_Handle handle);
  57. } LV2_Inline_Display;
  58. /**
  59. * Plugin Inline-Display Interface.
  60. */
  61. typedef struct {
  62. /**
  63. * The render method. This is called by the host in the main GUI thread
  64. * (non realtime, the context with access to graphics drawing APIs).
  65. *
  66. * The data pointer is owned by the plugin and must be valid
  67. * from the first call to render until cleanup.
  68. *
  69. * The host specifies a maxium available area for the plugin to draw.
  70. * the returned Image Surface contains the actual area which
  71. * the plugin allocated.
  72. *
  73. * @param instance The LV2 instance
  74. * @param w the max available width
  75. * @param h the max available height
  76. * @return pointer to a LV2_Inline_Display_Image_Surface or NULL
  77. */
  78. const LV2_Inline_Display_Image_Surface* (*render)(
  79. LV2_Handle instance,
  80. uint32_t w, uint32_t h);
  81. } LV2_Inline_Display_Interface;
  82. #ifdef __cplusplus
  83. } /* extern "C" */
  84. #endif
  85. #endif /* LV2_INLINE_DISPLAY_H */
  86. /**
  87. @}
  88. */