diff --git a/src/common/serialization/clap/host.h b/src/common/serialization/clap/host.h index 2f23fa6c..844baaf1 100644 --- a/src/common/serialization/clap/host.h +++ b/src/common/serialization/clap/host.h @@ -71,5 +71,20 @@ struct Host { } }; +/** + * Extensions supported by the host. This can only be queried in + * `clap_plugin::init()` so it cannot be part of `Host`. We'll create make these + * same extensions available to the bridged CLAP plugins using proxies. + */ +struct SupportedHostExtensions { + // Don't forget to add new extensions to the log output + // TODO: Support extensions + + template + void serialize(S& s) { + // s.value1b(extension_name); + } +}; + } // namespace host } // namespace clap diff --git a/src/common/serialization/clap/plugin.h b/src/common/serialization/clap/plugin.h index 4083f307..24d8a83b 100644 --- a/src/common/serialization/clap/plugin.h +++ b/src/common/serialization/clap/plugin.h @@ -25,6 +25,7 @@ #include "../../bitsery/ext/in-place-optional.h" #include "../common.h" +#include "host.h" // Serialization messages for `clap/plugin.h` @@ -105,6 +106,51 @@ struct Descriptor { mutable clap_plugin_descriptor_t clap_descriptor; }; +/** + * Extensions supported by the plugin. Queried after `clap_plugin::init()`. + */ +struct SupportedPluginExtensions { + // Don't forget to add new extensions to the log output + // TODO: Support extensions + + template + void serialize(S& s) { + // s.value1b(extension_name); + } +}; + +/** + * The response to the `clap::plugin::Init` message defined below. + */ +struct InitResponse { + bool result; + SupportedPluginExtensions supported_plugin_extensions; + + template + void serialize(S& s) { + s.value1b(result); + s.object(supported_plugin_extensions); + } +}; + +/** + * Message struct for `clap_plugin::init()`. This is where we set the supported + * host extensions on the Wine side, and query the plugin's supported extensions + * so we can proxy them. + */ +struct Init { + using Response = InitResponse; + + native_size_t instance_id; + clap::host::SupportedHostExtensions supported_host_extensions; + + template + void serialize(S& s) { + s.value8b(instance_id); + s.boject(supported_host_extensions); + } +}; + /** * Message struct for `clap_plugin::destroy()`. The Wine plugin host should * clean up the plugin, and everything is also cleaned up on the plugin side