mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-08 20:40:11 +02:00
Implement IUnitHandler::notifyUnitSelection
This commit is contained in:
@@ -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 =
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user