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.

85 lines
2.6KB

  1. /*
  2. Copyright 2007-2012 David Robillard <http://drobilla.net>
  3. Permission to use, copy, modify, and/or distribute this software for any
  4. purpose with or without fee is hereby granted, provided that the above
  5. copyright notice and this permission notice appear in all copies.
  6. THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  7. WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  8. MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  9. ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  10. WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  11. ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  12. OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  13. */
  14. /**
  15. @defgroup resize-port Resize Port
  16. Dynamically sized LV2 port buffers.
  17. @{
  18. */
  19. #ifndef LV2_RESIZE_PORT_H
  20. #define LV2_RESIZE_PORT_H
  21. #include <stddef.h>
  22. #include <stdint.h>
  23. #define LV2_RESIZE_PORT_URI "http://lv2plug.in/ns/ext/resize-port"
  24. #define LV2_RESIZE_PORT_PREFIX LV2_RESIZE_PORT_URI "#"
  25. #define LV2_RESIZE_PORT__asLargeAs LV2_RESIZE_PORT_PREFIX "asLargeAs"
  26. #define LV2_RESIZE_PORT__minimumSize LV2_RESIZE_PORT_PREFIX "minimumSize"
  27. #define LV2_RESIZE_PORT__resize LV2_RESIZE_PORT_PREFIX "resize"
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #else
  31. # include <stdbool.h>
  32. #endif
  33. /** A status code for state functions. */
  34. typedef enum {
  35. LV2_RESIZE_PORT_SUCCESS = 0, /**< Completed successfully. */
  36. LV2_RESIZE_PORT_ERR_UNKNOWN = 1, /**< Unknown error. */
  37. LV2_RESIZE_PORT_ERR_NO_SPACE = 2 /**< Insufficient space. */
  38. } LV2_Resize_Port_Status;
  39. typedef void* LV2_Resize_Port_Feature_Data;
  40. /** Host feature to allow plugins to resize their port buffers. */
  41. typedef struct {
  42. LV2_Resize_Port_Feature_Data data;
  43. /**
  44. Resize a port buffer to at least `size` bytes.
  45. This function MAY return an error, in which case the port buffer was not
  46. resized and the port is still connected to the same location. Plugins
  47. MUST gracefully handle this situation.
  48. This function is in the audio threading class.
  49. The host MUST preserve the contents of the port buffer when resizing.
  50. Plugins MAY resize a port many times in a single run callback. Hosts
  51. SHOULD make this as inexpensive as possible.
  52. */
  53. LV2_Resize_Port_Status (*resize)(LV2_Resize_Port_Feature_Data data,
  54. uint32_t index,
  55. size_t size);
  56. } LV2_Resize_Port_Resize;
  57. #ifdef __cplusplus
  58. } /* extern "C" */
  59. #endif
  60. #endif /* LV2_RESIZE_PORT_H */
  61. /**
  62. @}
  63. */