mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-10 04:30:12 +02:00
Fully implement IComponentHandler2
This commit is contained in:
@@ -172,6 +172,10 @@ using CallbackRequest = std::variant<WantsConfiguration,
|
|||||||
YaComponentHandler::PerformEdit,
|
YaComponentHandler::PerformEdit,
|
||||||
YaComponentHandler::EndEdit,
|
YaComponentHandler::EndEdit,
|
||||||
YaComponentHandler::RestartComponent,
|
YaComponentHandler::RestartComponent,
|
||||||
|
YaComponentHandler2::SetDirty,
|
||||||
|
YaComponentHandler2::RequestOpenEditor,
|
||||||
|
YaComponentHandler2::StartGroupEdit,
|
||||||
|
YaComponentHandler2::FinishGroupEdit,
|
||||||
// Used when the host uses proxy objects,
|
// Used when the host uses proxy objects,
|
||||||
// and we have to route
|
// and we have to route
|
||||||
// `IConnectionPoint::notify` calls through
|
// `IConnectionPoint::notify` calls through
|
||||||
|
|||||||
@@ -360,6 +360,7 @@ tresult PLUGIN_API Vst3PluginProxyImpl::setComponentHandler(
|
|||||||
|
|
||||||
// Automatically converted smart pointers for when the plugin performs a
|
// Automatically converted smart pointers for when the plugin performs a
|
||||||
// callback later
|
// callback later
|
||||||
|
component_handler_2 = component_handler;
|
||||||
unit_handler = component_handler;
|
unit_handler = component_handler;
|
||||||
|
|
||||||
return bridge.send_message(YaEditController::SetComponentHandler{
|
return bridge.send_message(YaEditController::SetComponentHandler{
|
||||||
|
|||||||
@@ -244,6 +244,8 @@ class Vst3PluginProxyImpl : public Vst3PluginProxy {
|
|||||||
// The following pointers are cast from `component_handler` if
|
// The following pointers are cast from `component_handler` if
|
||||||
// `IEditController::setComponentHandler()` has been called
|
// `IEditController::setComponentHandler()` has been called
|
||||||
|
|
||||||
|
Steinberg::FUnknownPtr<Steinberg::Vst::IComponentHandler2>
|
||||||
|
component_handler_2;
|
||||||
Steinberg::FUnknownPtr<Steinberg::Vst::IUnitHandler> unit_handler;
|
Steinberg::FUnknownPtr<Steinberg::Vst::IUnitHandler> unit_handler;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -72,11 +72,36 @@ Vst3PluginBridge::Vst3PluginBridge()
|
|||||||
.component_handler->endEdit(request.id);
|
.component_handler->endEdit(request.id);
|
||||||
},
|
},
|
||||||
[&](const YaComponentHandler::RestartComponent& request)
|
[&](const YaComponentHandler::RestartComponent& request)
|
||||||
-> YaComponentHandler::EndEdit::Response {
|
-> YaComponentHandler::RestartComponent::Response {
|
||||||
return plugin_proxies.at(request.owner_instance_id)
|
return plugin_proxies.at(request.owner_instance_id)
|
||||||
.get()
|
.get()
|
||||||
.component_handler->restartComponent(request.flags);
|
.component_handler->restartComponent(request.flags);
|
||||||
},
|
},
|
||||||
|
[&](const YaComponentHandler2::SetDirty& request)
|
||||||
|
-> YaComponentHandler2::SetDirty::Response {
|
||||||
|
return plugin_proxies.at(request.owner_instance_id)
|
||||||
|
.get()
|
||||||
|
.component_handler_2->setDirty(request.state);
|
||||||
|
},
|
||||||
|
[&](const YaComponentHandler2::RequestOpenEditor& request)
|
||||||
|
-> YaComponentHandler2::RequestOpenEditor::Response {
|
||||||
|
return plugin_proxies.at(request.owner_instance_id)
|
||||||
|
.get()
|
||||||
|
.component_handler_2->requestOpenEditor(
|
||||||
|
request.name.c_str());
|
||||||
|
},
|
||||||
|
[&](const YaComponentHandler2::StartGroupEdit& request)
|
||||||
|
-> YaComponentHandler2::StartGroupEdit::Response {
|
||||||
|
return plugin_proxies.at(request.owner_instance_id)
|
||||||
|
.get()
|
||||||
|
.component_handler_2->startGroupEdit();
|
||||||
|
},
|
||||||
|
[&](const YaComponentHandler2::FinishGroupEdit& request)
|
||||||
|
-> YaComponentHandler2::FinishGroupEdit::Response {
|
||||||
|
return plugin_proxies.at(request.owner_instance_id)
|
||||||
|
.get()
|
||||||
|
.component_handler_2->finishGroupEdit();
|
||||||
|
},
|
||||||
[&](YaConnectionPoint::Notify& request)
|
[&](YaConnectionPoint::Notify& request)
|
||||||
-> YaConnectionPoint::Notify::Response {
|
-> YaConnectionPoint::Notify::Response {
|
||||||
return plugin_proxies.at(request.instance_id)
|
return plugin_proxies.at(request.instance_id)
|
||||||
|
|||||||
@@ -64,31 +64,31 @@ Vst3ComponentHandlerProxyImpl::restartComponent(int32 flags) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tresult PLUGIN_API Vst3ComponentHandlerProxyImpl::setDirty(TBool state) {
|
tresult PLUGIN_API Vst3ComponentHandlerProxyImpl::setDirty(TBool state) {
|
||||||
// TODO: Implement
|
return bridge.send_message(YaComponentHandler2::SetDirty{
|
||||||
std::cerr << "TODO: Implement IComponentHandler2::setDirty()" << std::endl;
|
.owner_instance_id = owner_instance_id(), .state = state});
|
||||||
return Steinberg::kNotImplemented;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tresult PLUGIN_API
|
tresult PLUGIN_API
|
||||||
Vst3ComponentHandlerProxyImpl::requestOpenEditor(Steinberg::FIDString name) {
|
Vst3ComponentHandlerProxyImpl::requestOpenEditor(Steinberg::FIDString name) {
|
||||||
// TODO: Implement
|
if (name) {
|
||||||
std::cerr << "TODO: Implement IComponentHandler2::requestOpenEditor()"
|
return bridge.send_message(YaComponentHandler2::RequestOpenEditor{
|
||||||
<< std::endl;
|
.owner_instance_id = owner_instance_id(), .name = name});
|
||||||
return Steinberg::kNotImplemented;
|
} else {
|
||||||
|
std::cerr << "WARNING: Null pointer passed to "
|
||||||
|
"IComponentHandler2::requestOpenEditor()"
|
||||||
|
<< std::endl;
|
||||||
|
return Steinberg::kInvalidArgument;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tresult PLUGIN_API Vst3ComponentHandlerProxyImpl::startGroupEdit() {
|
tresult PLUGIN_API Vst3ComponentHandlerProxyImpl::startGroupEdit() {
|
||||||
// TODO: Implement
|
return bridge.send_message(YaComponentHandler2::StartGroupEdit{
|
||||||
std::cerr << "TODO: Implement IComponentHandler2::startGroupEdit()"
|
.owner_instance_id = owner_instance_id()});
|
||||||
<< std::endl;
|
|
||||||
return Steinberg::kNotImplemented;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tresult PLUGIN_API Vst3ComponentHandlerProxyImpl::finishGroupEdit() {
|
tresult PLUGIN_API Vst3ComponentHandlerProxyImpl::finishGroupEdit() {
|
||||||
// TODO: Implement
|
return bridge.send_message(YaComponentHandler2::FinishGroupEdit{
|
||||||
std::cerr << "TODO: Implement IComponentHandler2::finishGroupEdit()"
|
.owner_instance_id = owner_instance_id()});
|
||||||
<< std::endl;
|
|
||||||
return Steinberg::kNotImplemented;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tresult PLUGIN_API Vst3ComponentHandlerProxyImpl::notifyUnitSelection(
|
tresult PLUGIN_API Vst3ComponentHandlerProxyImpl::notifyUnitSelection(
|
||||||
|
|||||||
Reference in New Issue
Block a user