Implement IUnitHandler::notifyUnitSelection

This commit is contained in:
Robbert van der Helm
2020-12-26 14:26:00 +01:00
parent 934aea3860
commit bf40e10780
9 changed files with 54 additions and 8 deletions
@@ -28,8 +28,8 @@ class YaPluginFactoryImpl : public YaPluginFactory {
void** obj) override;
tresult PLUGIN_API setHostContext(Steinberg::FUnknown* context) override;
// The following pointers are cast from `host_context` if `setHostContext()`
// has been called
// The following pointers are cast from `host_context` if
// `IPluginFactory3::setHostContext()` has been called
Steinberg::FUnknownPtr<Steinberg::Vst::IHostApplication> host_application;
@@ -357,6 +357,10 @@ tresult PLUGIN_API Vst3PluginProxyImpl::setComponentHandler(
// this component handler
component_handler = handler;
// Automatically converted smart pointers for when the plugin performs a
// callback later
unit_handler = component_handler;
return bridge.send_message(YaEditController::SetComponentHandler{
.instance_id = instance_id(),
.component_handler_proxy_args =
+7 -2
View File
@@ -152,11 +152,16 @@ class Vst3PluginProxyImpl : public Vst3PluginProxy {
*/
Vst3PlugViewProxyImpl* last_created_plug_view = nullptr;
// The following pointers are cast from `host_context` if `setHostContext()`
// has been called
// The following pointers are cast from `host_context` if
// `IPluginBase::initialize()` has been called
Steinberg::FUnknownPtr<Steinberg::Vst::IHostApplication> host_application;
// The following pointers are cast from `component_handler` if
// `IEditController::setComponentHandler()` has been called
Steinberg::FUnknownPtr<Steinberg::Vst::IUnitHandler> unit_handler;
private:
Vst3PluginBridge& bridge;
+6
View File
@@ -145,6 +145,12 @@ Vst3PluginBridge::Vst3PluginBridge()
return plug_view->plug_frame->resizeView(plug_view,
&request.new_size);
},
[&](const YaUnitHandler::NotifyUnitSelection& request)
-> YaUnitHandler::NotifyUnitSelection::Response {
return plugin_proxies.at(request.owner_instance_id)
.get()
.unit_handler->notifyUnitSelection(request.unit_id);
},
});
});
}