message.h (2895B)
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 17 #pragma once 18 19 #include "base.h" 20 21 #include "align_push.h" 22 23 /** 24 * attribute list 25 */ 26 27 struct v3_attribute_list { 28 #ifndef __cplusplus 29 struct v3_funknown; 30 #endif 31 v3_result (V3_API* set_int)(void* self, const char* id, int64_t value); 32 v3_result (V3_API* get_int)(void* self, const char* id, int64_t* value); 33 v3_result (V3_API* set_float)(void* self, const char* id, double value); 34 v3_result (V3_API* get_float)(void* self, const char* id, double* value); 35 v3_result (V3_API* set_string)(void* self, const char* id, const int16_t* string); 36 v3_result (V3_API* get_string)(void* self, const char* id, int16_t* string, uint32_t size); 37 v3_result (V3_API* set_binary)(void* self, const char* id, const void* data, uint32_t size); 38 v3_result (V3_API* get_binary)(void* self, const char* id, const void** data, uint32_t* size); 39 }; 40 41 static constexpr const v3_tuid v3_attribute_list_iid = 42 V3_ID(0x1E5F0AEB, 0xCC7F4533, 0xA2544011, 0x38AD5EE4); 43 44 /** 45 * message 46 */ 47 48 struct v3_message { 49 #ifndef __cplusplus 50 struct v3_funknown; 51 #endif 52 const char* (V3_API* get_message_id)(void* self); 53 void (V3_API* set_message_id)(void* self, const char* id); 54 v3_attribute_list** (V3_API* get_attributes)(void* self); 55 }; 56 57 static constexpr const v3_tuid v3_message_iid = 58 V3_ID(0x936F033B, 0xC6C047DB, 0xBB0882F8, 0x13C1E613); 59 60 /** 61 * connection point 62 */ 63 64 struct v3_connection_point { 65 #ifndef __cplusplus 66 struct v3_funknown; 67 #endif 68 v3_result (V3_API* connect)(void* self, struct v3_connection_point** other); 69 v3_result (V3_API* disconnect)(void* self, struct v3_connection_point** other); 70 v3_result (V3_API* notify)(void* self, struct v3_message** message); 71 }; 72 73 static constexpr const v3_tuid v3_connection_point_iid = 74 V3_ID(0x70A4156F, 0x6E6E4026, 0x989148BF, 0xAA60D8D1); 75 76 #ifdef __cplusplus 77 78 /** 79 * C++ variants 80 */ 81 82 struct v3_attribute_list_cpp : v3_funknown { 83 v3_attribute_list attrlist; 84 }; 85 86 struct v3_message_cpp : v3_funknown { 87 v3_message msg; 88 }; 89 90 struct v3_connection_point_cpp : v3_funknown { 91 v3_connection_point point; 92 }; 93 94 #endif 95 96 #include "align_pop.h"