From b3406189e7f87fa4e7ab802379882dbb13425095 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Fri, 8 Jan 2021 17:47:10 +0100 Subject: [PATCH] Add messages for IXmlRepresentationController --- .../plugin/xml-representation-controller.h | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/src/common/serialization/vst3/plugin/xml-representation-controller.h b/src/common/serialization/vst3/plugin/xml-representation-controller.h index b983ceea..fb6e223f 100644 --- a/src/common/serialization/vst3/plugin/xml-representation-controller.h +++ b/src/common/serialization/vst3/plugin/xml-representation-controller.h @@ -68,6 +68,41 @@ class YaXmlRepresentationController inline bool supported() const { return arguments.supported; } + /** + * The response code and written state for a call to + * `IXmlRepresentationController::getXmlRepresentationStream(info, + * &stream)`. + */ + struct GetXmlRepresentationStreamResponse { + UniversalTResult result; + VectorStream stream; + + template + void serialize(S& s) { + s.object(result); + s.object(stream); + } + }; + + /** + * Message to pass through a call to + * `IXmlRepresentationController::getXmlRepresentationStream(info, &stream)` + * to the Wine plugin host. + */ + struct GetXmlRepresentationStream { + using Response = GetXmlRepresentationStreamResponse; + + native_size_t instance_id; + + Steinberg::Vst::RepresentationInfo info; + + template + void serialize(S& s) { + s.value8b(instance_id); + s.object(info); + } + }; + virtual tresult PLUGIN_API getXmlRepresentationStream(Steinberg::Vst::RepresentationInfo& info /*in*/, Steinberg::IBStream* stream /*out*/) = 0; @@ -77,3 +112,15 @@ class YaXmlRepresentationController }; #pragma GCC diagnostic pop + +namespace Steinberg { +namespace Vst { +template +void serialize(S& s, RepresentationInfo& info) { + s.text1b(info.vendor); + s.text1b(info.name); + s.text1b(info.version); + s.text1b(info.host); +} +} // namespace Vst +} // namespace Steinberg