Implement IComponent::terminate()

This commit is contained in:
Robbert van der Helm
2020-12-12 16:11:48 +01:00
parent d80ba10f06
commit 68084bc555
6 changed files with 37 additions and 5 deletions
+4 -2
View File
@@ -68,8 +68,10 @@ 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<YaComponent::Create, YaComponent::Destroy, WantsPluginFactory>;
using ControlRequest = std::variant<YaComponent::Create,
YaComponent::Destroy,
YaComponent::Terminate,
WantsPluginFactory>;
template <typename S>
void serialize(S& s, ControlRequest& payload) {
+17 -1
View File
@@ -79,7 +79,7 @@ class YaComponent : public Steinberg::Vst::IComponent {
/**
* Message to request the Wine plugin host to instantiate a new IComponent
* to pass through a call to `IPluginFactory::createInstance(cid,
* to pass through a call to `IComponent::createInstance(cid,
* IComponent::iid,
* ...)`.
*/
@@ -126,6 +126,22 @@ class YaComponent : public Steinberg::Vst::IComponent {
// From `IPluginBase`
virtual tresult PLUGIN_API initialize(FUnknown* context) override = 0;
/**
* Message to pass through a call to `IComponent::terminate()` to the Wine
* plugin host.
*/
struct Terminate {
using Response = UniversalTResult;
native_size_t instance_id;
template <typename S>
void serialize(S& s) {
s.value8b(instance_id);
}
};
virtual tresult PLUGIN_API terminate() override = 0;
// From `IComponent`