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.

resize-port.h 2.4KB

12 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. #ifndef LV2_RESIZE_PORT_H
  15. #define LV2_RESIZE_PORT_H
  16. #include <stddef.h>
  17. #include <stdint.h>
  18. #define LV2_RESIZE_PORT_URI "http://lv2plug.in/ns/ext/resize-port"
  19. #define LV2_RESIZE_PORT_PREFIX LV2_RESIZE_PORT_URI "#"
  20. #define LV2_RESIZE_PORT__asLargeAs LV2_RESIZE_PORT_PREFIX "asLargeAs"
  21. #define LV2_RESIZE_PORT__minimumSize LV2_RESIZE_PORT_PREFIX "minimumSize"
  22. #define LV2_RESIZE_PORT__resize LV2_RESIZE_PORT_PREFIX "resize"
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #else
  26. # include <stdbool.h>
  27. #endif
  28. /** A status code for state functions. */
  29. typedef enum {
  30. LV2_RESIZE_PORT_SUCCESS = 0, /**< Completed successfully. */
  31. LV2_RESIZE_PORT_ERR_UNKNOWN = 1, /**< Unknown error. */
  32. LV2_RESIZE_PORT_ERR_NO_SPACE = 2 /**< Insufficient space. */
  33. } LV2_Resize_Port_Status;
  34. typedef void* LV2_Resize_Port_Feature_Data;
  35. typedef struct {
  36. LV2_Resize_Port_Feature_Data data;
  37. /**
  38. Resize a port buffer to at least @a size bytes.
  39. This function MAY return an error, in which case the port buffer was not
  40. resized and the port is still connected to the same location. Plugins
  41. MUST gracefully handle this situation.
  42. This function is in the audio threading class.
  43. The host MUST preserve the contents of the port buffer when resizing.
  44. Plugins MAY resize a port many times in a single run callback. Hosts
  45. SHOULD make this as inexpensive as possible.
  46. */
  47. LV2_Resize_Port_Status (*resize)(LV2_Resize_Port_Feature_Data data,
  48. uint32_t index,
  49. size_t size);
  50. } LV2_Resize_Port_Resize;
  51. #ifdef __cplusplus
  52. } /* extern "C" */
  53. #endif
  54. #endif /* LV2_RESIZE_PORT_H */