Fully implement IUnitHandler2

This commit is contained in:
Robbert van der Helm
2021-01-10 23:54:43 +01:00
parent 73f3db88e0
commit 5855ffbe85
5 changed files with 12 additions and 4 deletions
+2 -1
View File
@@ -200,7 +200,8 @@ using CallbackRequest = std::variant<Vst3ContextMenuProxy::Destruct,
YaHostApplication::GetName,
YaPlugFrame::ResizeView,
YaUnitHandler::NotifyUnitSelection,
YaUnitHandler::NotifyProgramListChange>;
YaUnitHandler::NotifyProgramListChange,
YaUnitHandler2::NotifyUnitByBusChange>;
template <typename S>
void serialize(S& s, CallbackRequest& payload) {
@@ -450,6 +450,7 @@ tresult PLUGIN_API Vst3PluginProxyImpl::setComponentHandler(
component_handler_2 = component_handler;
component_handler_3 = component_handler;
unit_handler = component_handler;
unit_handler_2 = component_handler;
return bridge.send_message(YaEditController::SetComponentHandler{
.instance_id = instance_id(),
@@ -327,6 +327,7 @@ class Vst3PluginProxyImpl : public Vst3PluginProxy {
Steinberg::FUnknownPtr<Steinberg::Vst::IComponentHandler3>
component_handler_3;
Steinberg::FUnknownPtr<Steinberg::Vst::IUnitHandler> unit_handler;
Steinberg::FUnknownPtr<Steinberg::Vst::IUnitHandler2> unit_handler_2;
private:
Vst3PluginBridge& bridge;
+6
View File
@@ -267,6 +267,12 @@ Vst3PluginBridge::Vst3PluginBridge()
.unit_handler->notifyProgramListChange(
request.list_id, request.program_index);
},
[&](const YaUnitHandler2::NotifyUnitByBusChange& request)
-> YaUnitHandler2::NotifyUnitByBusChange::Response {
return plugin_proxies.at(request.owner_instance_id)
.get()
.unit_handler_2->notifyUnitByBusChange();
},
});
});
}
@@ -130,7 +130,6 @@ tresult PLUGIN_API Vst3ComponentHandlerProxyImpl::notifyProgramListChange(
}
tresult PLUGIN_API Vst3ComponentHandlerProxyImpl::notifyUnitByBusChange() {
// TODO: Implement
std::cerr << "TODO: IUnitHandler2::notifyUnitSelection()" << std::endl;
return Steinberg::kNotImplemented;
return bridge.send_message(YaUnitHandler2::NotifyUnitByBusChange{
.owner_instance_id = owner_instance_id()});
}