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.

94 lines
2.7KB

  1. /*
  2. * travesty, pure C VST3-compatible interface
  3. * Copyright (C) 2021 Filipe Coelho <falktx@falktx.com>
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for any purpose with
  6. * or without fee is hereby granted, provided that the above copyright notice and this
  7. * permission notice appear in all copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
  10. * TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN
  11. * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  12. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
  13. * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  14. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #pragma once
  17. #include "base.h"
  18. #include "align_push.h"
  19. /**
  20. * attribute list
  21. */
  22. struct v3_attribute_list {
  23. struct v3_funknown;
  24. v3_result (V3_API* set_int)(void* self, const char* id, int64_t value);
  25. v3_result (V3_API* get_int)(void* self, const char* id, int64_t* value);
  26. v3_result (V3_API* set_float)(void* self, const char* id, double value);
  27. v3_result (V3_API* get_float)(void* self, const char* id, double* value);
  28. v3_result (V3_API* set_string)(void* self, const char* id, const int16_t* string);
  29. v3_result (V3_API* get_string)(void* self, const char* id, int16_t* string, uint32_t size);
  30. v3_result (V3_API* set_binary)(void* self, const char* id, const void* data, uint32_t size);
  31. v3_result (V3_API* get_binary)(void* self, const char* id, const void** data, uint32_t* size);
  32. };
  33. static constexpr const v3_tuid v3_attribute_list_iid =
  34. V3_ID(0x1E5F0AEB, 0xCC7F4533, 0xA2544011, 0x38AD5EE4);
  35. /**
  36. * message
  37. */
  38. struct v3_message {
  39. struct v3_funknown;
  40. const char* (V3_API* get_message_id)(void* self);
  41. void (V3_API* set_message_id)(void* self, const char* id);
  42. v3_attribute_list** (V3_API* get_attributes)(void* self);
  43. };
  44. static constexpr const v3_tuid v3_message_iid =
  45. V3_ID(0x936F033B, 0xC6C047DB, 0xBB0882F8, 0x13C1E613);
  46. /**
  47. * connection point
  48. */
  49. struct v3_connection_point {
  50. struct v3_funknown;
  51. v3_result (V3_API* connect)(void* self, struct v3_connection_point** other);
  52. v3_result (V3_API* disconnect)(void* self, struct v3_connection_point** other);
  53. v3_result (V3_API* notify)(void* self, struct v3_message** message);
  54. };
  55. static constexpr const v3_tuid v3_connection_point_iid =
  56. V3_ID(0x70A4156F, 0x6E6E4026, 0x989148BF, 0xAA60D8D1);
  57. #ifdef __cplusplus
  58. /**
  59. * C++ variants
  60. */
  61. struct v3_attribute_list_cpp : v3_funknown {
  62. v3_attribute_list attrlist;
  63. };
  64. struct v3_message_cpp : v3_funknown {
  65. v3_message msg;
  66. };
  67. struct v3_connection_point_cpp : v3_funknown {
  68. v3_connection_point point;
  69. };
  70. #endif
  71. #include "align_pop.h"