mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 20:10:13 +02:00
Implement IEditController::setComponentHandler()
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user