Bundle associated messages with their interfaces

Once we start implementing all of the control messages/callbacks things
could quickly get out of hand otherwise.
This commit is contained in:
Robbert van der Helm
2020-12-08 11:24:05 +01:00
parent 5e85517130
commit ed743e6f22
5 changed files with 23 additions and 20 deletions
+3 -16
View File
@@ -38,20 +38,8 @@
// TODO: If this approach works, maybe we can also refactor the VST2 handling to
// do this since it's a bit safer and easier to read
/**
* Request the Wine plugin host to instantiate a new IComponent to pass through
* a call to `IPluginFactory::createInstance(cid, IComponent::iid, ...)`.
*/
struct CreateInstaneIComponent {
using Response = YaComponent&;
Steinberg::TUID cid;
template <typename S>
void serialize(S& s) {
s.container1b(cid);
}
};
// All messages for creating objects and calling interfaces on them are defined
// as part of the interfaces and implementations in `vst3/`
/**
* Marker struct to indicate the other side (the plugin) should send a copy of
@@ -80,8 +68,7 @@ struct WantsPluginFactory {
* encodes the information we request or the operation we want to perform. A
* request of type `ControlRequest(T)` should send back a `T::Response`.
*/
using ControlRequest =
std::variant<CreateInstaneIComponent, WantsPluginFactory>;
using ControlRequest = std::variant<YaComponent::Create, WantsPluginFactory>;
template <typename S>
void serialize(S& s, ControlRequest& payload) {