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
3.1KB

  1. /*
  2. LV2 ControlInputPort change request extension
  3. Copyright 2020 Filipe Coelho <falktx@falktx.com>
  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. @file control-input-port-change-request.h
  17. C header for the LV2 ControlInputPort change request extension <http://kx.studio/ns/lv2ext/control-input-port-change-request>.
  18. */
  19. #ifndef LV2_CONTROL_INPUT_PORT_CHANGE_REQUEST_H
  20. #define LV2_CONTROL_INPUT_PORT_CHANGE_REQUEST_H
  21. #include "lv2.h"
  22. #define LV2_CONTROL_INPUT_PORT_CHANGE_REQUEST_URI "http://kx.studio/ns/lv2ext/control-input-port-change-request"
  23. #define LV2_CONTROL_INPUT_PORT_CHANGE_REQUEST_PREFIX LV2_CONTROL_INPUT_PORT_CHANGE_REQUEST_URI "#"
  24. #include <stdint.h>
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #else
  28. #include <stdbool.h>
  29. #endif
  30. /** A status code for LV2_CONTROL_INPUT_PORT_CHANGE_REQUEST_URI functions. */
  31. typedef enum {
  32. LV2_CONTROL_INPUT_PORT_CHANGE_SUCCESS = 0, /**< Completed successfully. */
  33. LV2_CONTROL_INPUT_PORT_CHANGE_ERR_UNKNOWN = 1, /**< Unknown error. */
  34. LV2_CONTROL_INPUT_PORT_CHANGE_ERR_INVALID_INDEX = 2 /**< Failed due to invalid port index. */
  35. } LV2_ControlInputPort_Change_Status;
  36. /**
  37. * Opaque handle for LV2_CONTROL_INPUT_PORT_CHANGE_REQUEST_URI feature.
  38. */
  39. typedef void* LV2_ControlInputPort_Change_Request_Handle;
  40. /**
  41. * On instantiation, host must supply LV2_CONTROL_INPUT_PORT_CHANGE_REQUEST_URI feature.
  42. * LV2_Feature::data must be pointer to LV2_ControlInputPort_Change_Request.
  43. */
  44. typedef struct _LV2_ControlInputPort_Change_Request {
  45. /**
  46. * Opaque host data.
  47. */
  48. LV2_ControlInputPort_Change_Request_Handle handle;
  49. /**
  50. * request_change()
  51. *
  52. * Ask the host to change a plugin's control input port value.
  53. * Parameter handle MUST be the 'handle' member of this struct.
  54. * Parameter index is port index to change.
  55. * Parameter value is the requested value to change the control port input to.
  56. *
  57. * Returns status of the request.
  58. * The host may decline this request, if e.g. it is currently automating this port.
  59. *
  60. * The plugin MUST call this function during run().
  61. */
  62. LV2_ControlInputPort_Change_Status (*request_change)(LV2_ControlInputPort_Change_Request_Handle handle,
  63. uint32_t index,
  64. float value);
  65. } LV2_ControlInputPort_Change_Request;
  66. #ifdef __cplusplus
  67. } /* extern "C" */
  68. #endif
  69. #endif /* LV2_CONTROL_INPUT_PORT_CHANGE_REQUEST_H */