Implement IEditController::setComponentHandler()

This commit is contained in:
Robbert van der Helm
2020-12-19 15:04:27 +01:00
parent 132ba0baeb
commit bf3d802f36
8 changed files with 122 additions and 12 deletions
+18 -3
View File
@@ -315,9 +315,24 @@ Vst3PluginProxyImpl::setParamNormalized(Steinberg::Vst::ParamID id,
tresult PLUGIN_API Vst3PluginProxyImpl::setComponentHandler(
Steinberg::Vst::IComponentHandler* handler) {
// TODO: Implement
bridge.logger.log("TODO IEditController::setComponentHandler()");
return Steinberg::kNotImplemented;
std::optional<Vst3ComponentHandlerProxy::ConstructArgs>
component_handler_proxy_args = std::nullopt;
if (handler) {
// We'll store the pointer for when the plugin later makes a callback to
// this component handler
component_handler = handler;
component_handler_proxy_args = Vst3ComponentHandlerProxy::ConstructArgs(
host_application_context, instance_id());
} else {
bridge.logger.log(
"Null pointer passed to 'IEditController::setComponentHandler'");
}
return bridge.send_message(YaEditController::SetComponentHandler{
.instance_id = instance_id(),
.component_handler_proxy_args =
std::move(component_handler_proxy_args)});
}
Steinberg::IPlugView* PLUGIN_API
@@ -133,4 +133,12 @@ class Vst3PluginProxyImpl : public Vst3PluginProxy {
*/
Steinberg::FUnknownPtr<Steinberg::Vst::IHostApplication>
host_application_context;
/**
* The component handler the host passed to us during
* `IEditController::setComponentHandler()`. When the plugin makes a
* callback on a component handler proxy object, we'll pass the call through
* to this object.
*/
Steinberg::IPtr<Steinberg::Vst::IComponentHandler> component_handler;
};