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.

87 lines
2.9KB

  1. /*
  2. Copyright 2007-2016 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" ///< http://lv2plug.in/ns/ext/resize-port
  24. #define LV2_RESIZE_PORT_PREFIX LV2_RESIZE_PORT_URI "#" ///< http://lv2plug.in/ns/ext/resize-port#
  25. #define LV2_RESIZE_PORT__asLargeAs LV2_RESIZE_PORT_PREFIX "asLargeAs" ///< http://lv2plug.in/ns/ext/port#asLargeAs
  26. #define LV2_RESIZE_PORT__minimumSize LV2_RESIZE_PORT_PREFIX "minimumSize" ///< http://lv2plug.in/ns/ext/port#minimumSize
  27. #define LV2_RESIZE_PORT__resize LV2_RESIZE_PORT_PREFIX "resize" ///< http://lv2plug.in/ns/ext/port#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. /** Opaque data for resize method. */
  40. typedef void* LV2_Resize_Port_Feature_Data;
  41. /** Host feature to allow plugins to resize their port buffers. */
  42. typedef struct {
  43. /** Opaque data for resize method. */
  44. LV2_Resize_Port_Feature_Data data;
  45. /**
  46. Resize a port buffer to at least `size` bytes.
  47. This function MAY return an error, in which case the port buffer was not
  48. resized and the port is still connected to the same location. Plugins
  49. MUST gracefully handle this situation.
  50. This function is in the audio threading class.
  51. The host MUST preserve the contents of the port buffer when resizing.
  52. Plugins MAY resize a port many times in a single run callback. Hosts
  53. SHOULD make this as inexpensive as possible.
  54. */
  55. LV2_Resize_Port_Status (*resize)(LV2_Resize_Port_Feature_Data data,
  56. uint32_t index,
  57. size_t size);
  58. } LV2_Resize_Port_Resize;
  59. #ifdef __cplusplus
  60. } /* extern "C" */
  61. #endif
  62. #endif /* LV2_RESIZE_PORT_H */
  63. /**
  64. @}
  65. */