Fully implement IComponentHandler2

This commit is contained in:
Robbert van der Helm
2021-01-04 21:56:14 +01:00
parent 0ed9438ffb
commit 9983f81875
5 changed files with 48 additions and 16 deletions
@@ -360,6 +360,7 @@ tresult PLUGIN_API Vst3PluginProxyImpl::setComponentHandler(
// Automatically converted smart pointers for when the plugin performs a
// callback later
component_handler_2 = component_handler;
unit_handler = component_handler;
return bridge.send_message(YaEditController::SetComponentHandler{
@@ -244,6 +244,8 @@ class Vst3PluginProxyImpl : public Vst3PluginProxy {
// The following pointers are cast from `component_handler` if
// `IEditController::setComponentHandler()` has been called
Steinberg::FUnknownPtr<Steinberg::Vst::IComponentHandler2>
component_handler_2;
Steinberg::FUnknownPtr<Steinberg::Vst::IUnitHandler> unit_handler;
private:
+26 -1
View File
@@ -72,11 +72,36 @@ Vst3PluginBridge::Vst3PluginBridge()
.component_handler->endEdit(request.id);
},
[&](const YaComponentHandler::RestartComponent& request)
-> YaComponentHandler::EndEdit::Response {
-> YaComponentHandler::RestartComponent::Response {
return plugin_proxies.at(request.owner_instance_id)
.get()
.component_handler->restartComponent(request.flags);
},
[&](const YaComponentHandler2::SetDirty& request)
-> YaComponentHandler2::SetDirty::Response {
return plugin_proxies.at(request.owner_instance_id)
.get()
.component_handler_2->setDirty(request.state);
},
[&](const YaComponentHandler2::RequestOpenEditor& request)
-> YaComponentHandler2::RequestOpenEditor::Response {
return plugin_proxies.at(request.owner_instance_id)
.get()
.component_handler_2->requestOpenEditor(
request.name.c_str());
},
[&](const YaComponentHandler2::StartGroupEdit& request)
-> YaComponentHandler2::StartGroupEdit::Response {
return plugin_proxies.at(request.owner_instance_id)
.get()
.component_handler_2->startGroupEdit();
},
[&](const YaComponentHandler2::FinishGroupEdit& request)
-> YaComponentHandler2::FinishGroupEdit::Response {
return plugin_proxies.at(request.owner_instance_id)
.get()
.component_handler_2->finishGroupEdit();
},
[&](YaConnectionPoint::Notify& request)
-> YaConnectionPoint::Notify::Response {
return plugin_proxies.at(request.instance_id)