From 86aaf2fa3a3d39f17058ed68f05ba9f74f6f87b7 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Sat, 26 Dec 2020 00:10:39 +0100 Subject: [PATCH] Implement IEditController2::openAboutBox With this IEditController2 has been fully implemented. --- README.md | 5 ++--- src/common/logging/vst3.cpp | 9 +++++++++ src/common/logging/vst3.h | 1 + src/common/serialization/vst3.h | 1 + .../vst3/plugin/edit-controller-2.h | 19 +++++++++++++++++++ .../bridges/vst3-impls/plugin-proxy.cpp | 5 ++--- src/wine-host/bridges/vst3.cpp | 5 +++++ 7 files changed, 39 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7cbf6ed4..e1d45aa4 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,8 @@ This branch is still very far removed from being in a usable state. Below is an incomplete list of things that still have to be done before this can be used: - Interfaces left to implement: - - `IEditController2` - - All other mandatory interfaces - - All other optional interfaces + - All other mandatory and optional VST 3.0 interfaces + - All interfaces introduced after that - Fully implemented: see [this document](https://github.com/robbert-vdh/yabridge/tree/feature/vst3/src/common/serialization/vst3/README.md) - Update yabridgectl to handle buth VST2 and VST3 plugins. diff --git a/src/common/logging/vst3.cpp b/src/common/logging/vst3.cpp index 17240ff4..83dd5c88 100644 --- a/src/common/logging/vst3.cpp +++ b/src/common/logging/vst3.cpp @@ -271,6 +271,15 @@ bool Vst3Logger::log_request(bool is_host_vst, }); } +bool Vst3Logger::log_request(bool is_host_vst, + const YaEditController2::OpenAboutBox& request) { + return log_request_base(is_host_vst, [&](auto& message) { + message << request.instance_id + << ": IEditController2::openAboutBox(onlyCheck = " + << (request.only_check ? "true" : "false") << ")"; + }); +} + bool Vst3Logger::log_request( bool is_host_vst, const YaPlugView::IsPlatformTypeSupported& request) { diff --git a/src/common/logging/vst3.h b/src/common/logging/vst3.h index 385e5135..9077f66a 100644 --- a/src/common/logging/vst3.h +++ b/src/common/logging/vst3.h @@ -90,6 +90,7 @@ class Vst3Logger { bool log_request(bool is_host_vst, const YaEditController::CreateView&); bool log_request(bool is_host_vst, const YaEditController2::SetKnobMode&); bool log_request(bool is_host_vst, const YaEditController2::OpenHelp&); + bool log_request(bool is_host_vst, const YaEditController2::OpenAboutBox&); bool log_request(bool is_host_vst, const YaPlugView::IsPlatformTypeSupported&); bool log_request(bool is_host_vst, const YaPlugView::Attached&); diff --git a/src/common/serialization/vst3.h b/src/common/serialization/vst3.h index 8f72ca2d..87d4551a 100644 --- a/src/common/serialization/vst3.h +++ b/src/common/serialization/vst3.h @@ -83,6 +83,7 @@ using ControlRequest = std::variant + void serialize(S& s) { + s.value8b(instance_id); + s.value1b(only_check); + } + }; + virtual tresult PLUGIN_API openAboutBox(TBool onlyCheck) override = 0; protected: diff --git a/src/plugin/bridges/vst3-impls/plugin-proxy.cpp b/src/plugin/bridges/vst3-impls/plugin-proxy.cpp index a2b773c3..de7c1deb 100644 --- a/src/plugin/bridges/vst3-impls/plugin-proxy.cpp +++ b/src/plugin/bridges/vst3-impls/plugin-proxy.cpp @@ -404,9 +404,8 @@ tresult PLUGIN_API Vst3PluginProxyImpl::openHelp(TBool onlyCheck) { } tresult PLUGIN_API Vst3PluginProxyImpl::openAboutBox(TBool onlyCheck) { - // TODO: Implement - bridge.logger.log("TODO: IEditController2::openAboutBox()"); - return Steinberg::kNotImplemented; + return bridge.send_message(YaEditController2::OpenAboutBox{ + .instance_id = instance_id(), .only_check = onlyCheck}); } tresult PLUGIN_API Vst3PluginProxyImpl::initialize(FUnknown* context) { diff --git a/src/wine-host/bridges/vst3.cpp b/src/wine-host/bridges/vst3.cpp index 8dae153e..5f86f1c1 100644 --- a/src/wine-host/bridges/vst3.cpp +++ b/src/wine-host/bridges/vst3.cpp @@ -346,6 +346,11 @@ void Vst3Bridge::run() { return object_instances[request.instance_id] .edit_controller_2->openHelp(request.only_check); }, + [&](const YaEditController2::OpenAboutBox& request) + -> YaEditController2::OpenAboutBox::Response { + return object_instances[request.instance_id] + .edit_controller_2->openAboutBox(request.only_check); + }, [&](const YaPlugView::IsPlatformTypeSupported& request) -> YaPlugView::IsPlatformTypeSupported::Response { // The host will of course want to pass an X11 window ID for the