Use the new approach for creating plugin factory

Directly serializing and deserializing into objects was and more
boilerplate heavy (since we now need two implementations even though we
only use one), and also much less flexible because we can't wrap
payloads in structs or provide optional values that way.
This commit is contained in:
Robbert van der Helm
2020-12-12 21:51:06 +01:00
parent 1b30000147
commit 39984ad442
14 changed files with 151 additions and 204 deletions
+1 -12
View File
@@ -52,17 +52,6 @@ struct WantsConfiguration {
void serialize(S&) {}
};
/**
* Marker struct to indicate the other side (the Wine plugin host) should send a
* copy of the hosted Windows VST3 plugin's `IPluginFactory{,2,3}` interface.
*/
struct WantsPluginFactory {
using Response = YaPluginFactory&;
template <typename S>
void serialize(S&) {}
};
/**
* When we send a control message from the plugin to the Wine VST host, this
* encodes the information we request or the operation we want to perform. A
@@ -71,7 +60,7 @@ struct WantsPluginFactory {
using ControlRequest = std::variant<YaComponent::Construct,
YaComponent::Destruct,
YaComponent::Terminate,
WantsPluginFactory>;
YaPluginFactory::Construct>;
template <typename S>
void serialize(S& s, ControlRequest& payload) {