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.

message.h 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. * travesty, pure C VST3-compatible interface
  3. * Copyright (C) 2021-2022 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. #ifndef __cplusplus
  24. struct v3_funknown;
  25. #endif
  26. v3_result (V3_API* set_int)(void* self, const char* id, int64_t value);
  27. v3_result (V3_API* get_int)(void* self, const char* id, int64_t* value);
  28. v3_result (V3_API* set_float)(void* self, const char* id, double value);
  29. v3_result (V3_API* get_float)(void* self, const char* id, double* value);
  30. v3_result (V3_API* set_string)(void* self, const char* id, const int16_t* string);
  31. v3_result (V3_API* get_string)(void* self, const char* id, int16_t* string, uint32_t size);
  32. v3_result (V3_API* set_binary)(void* self, const char* id, const void* data, uint32_t size);
  33. v3_result (V3_API* get_binary)(void* self, const char* id, const void** data, uint32_t* size);
  34. };
  35. static constexpr const v3_tuid v3_attribute_list_iid =
  36. V3_ID(0x1E5F0AEB, 0xCC7F4533, 0xA2544011, 0x38AD5EE4);
  37. /**
  38. * message
  39. */
  40. struct v3_message {
  41. #ifndef __cplusplus
  42. struct v3_funknown;
  43. #endif
  44. const char* (V3_API* get_message_id)(void* self);
  45. void (V3_API* set_message_id)(void* self, const char* id);
  46. v3_attribute_list** (V3_API* get_attributes)(void* self);
  47. };
  48. static constexpr const v3_tuid v3_message_iid =
  49. V3_ID(0x936F033B, 0xC6C047DB, 0xBB0882F8, 0x13C1E613);
  50. /**
  51. * connection point
  52. */
  53. struct v3_connection_point {
  54. #ifndef __cplusplus
  55. struct v3_funknown;
  56. #endif
  57. v3_result (V3_API* connect)(void* self, struct v3_connection_point** other);
  58. v3_result (V3_API* disconnect)(void* self, struct v3_connection_point** other);
  59. v3_result (V3_API* notify)(void* self, struct v3_message** message);
  60. };
  61. static constexpr const v3_tuid v3_connection_point_iid =
  62. V3_ID(0x70A4156F, 0x6E6E4026, 0x989148BF, 0xAA60D8D1);
  63. #ifdef __cplusplus
  64. /**
  65. * C++ variants
  66. */
  67. struct v3_attribute_list_cpp : v3_funknown {
  68. v3_attribute_list attrlist;
  69. };
  70. struct v3_message_cpp : v3_funknown {
  71. v3_message msg;
  72. };
  73. struct v3_connection_point_cpp : v3_funknown {
  74. v3_connection_point point;
  75. };
  76. #endif
  77. #include "align_pop.h"