From d58c20417836b1969736aa0f7788eff516629f90 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Fri, 27 Jan 2023 21:03:43 +0100 Subject: [PATCH] Update to CLAP 1.1.7 Factories got moved to a new `factory` directory. --- CHANGELOG.md | 4 ++++ README.md | 2 +- meson.build | 3 +-- src/common/logging/clap.cpp | 8 ++++---- src/common/logging/clap.h | 8 ++++---- src/common/serialization/clap.h | 6 +++--- .../clap/{ => factory}/plugin-factory.h | 14 +++++++++----- .../clap-impls/plugin-factory-proxy.cpp | 4 ++-- .../bridges/clap-impls/plugin-factory-proxy.h | 4 ++-- src/plugin/bridges/clap.cpp | 4 ++-- src/wine-host/bridges/clap-impls/host-proxy.h | 2 +- src/wine-host/bridges/clap.cpp | 18 +++++++++--------- src/wine-host/bridges/clap.h | 2 +- subprojects/clap.wrap | 4 ++-- subprojects/packagefiles/clap/meson.build | 2 +- 15 files changed, 46 insertions(+), 39 deletions(-) rename src/common/serialization/clap/{ => factory}/plugin-factory.h (90%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0050c8a0..10102ca9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,10 @@ Versioning](https://semver.org/spec/v2.0.0.html). version comparison function considers `8.0` to be a lower version than `8.0rc2`. +### Packaging notes + +- The CLAP dependency has been updated to target version 1.1.7. + ## [5.0.3] - 2022-12-23 ### Changed diff --git a/README.md b/README.md index 2702209f..b8be38e3 100644 --- a/README.md +++ b/README.md @@ -808,7 +808,7 @@ The following dependencies are included in the repository as a Meson wrap: - Version 3.7.7 of the [VST3 SDK](https://github.com/robbert-vdh/vst3sdk) with some [patches](https://github.com/robbert-vdh/yabridge/blob/master/tools/patch-vst3-sdk.sh) to allow Winelib compilation -- Version 1.1.4 of the [CLAP headers](https://github.com/free-audio/clap). +- Version 1.1.7 of the [CLAP headers](https://github.com/free-audio/clap). The project can then be compiled with the command below. You can remove or change the unity size argument if building takes up too much RAM, or you can diff --git a/meson.build b/meson.build index 87679f76..500c9904 100644 --- a/meson.build +++ b/meson.build @@ -278,8 +278,7 @@ wine_threads_dep = declare_dependency(link_args : '-lpthread') wine_uuid_dep = declare_dependency(link_args : '-luuid') if with_clap - # 1.1.3 should be API compatible with 1.1.4 - clap_dep = dependency('clap', version : '>=1.1.3') + clap_dep = dependency('clap', version : '==1.1.7') endif # We need to build the VST3 SDK dependencies in tree because Meson won't let us diff --git a/src/common/logging/clap.cpp b/src/common/logging/clap.cpp index b2d71b0f..7a07c430 100644 --- a/src/common/logging/clap.cpp +++ b/src/common/logging/clap.cpp @@ -54,14 +54,14 @@ void ClapLogger::log_on_main_thread(size_t instance_id) { } bool ClapLogger::log_request(bool is_host_plugin, - const clap::plugin_factory::List&) { + const clap::factory::plugin_factory::List&) { return log_request_base(is_host_plugin, [&](auto& message) { message << "clap_plugin_factory::list()"; }); } bool ClapLogger::log_request(bool is_host_plugin, - const clap::plugin_factory::Create& request) { + const clap::factory::plugin_factory::Create& request) { return log_request_base(is_host_plugin, [&](auto& message) { message << "clap_plugin_factory::create(host = , " "plugin_id = \"" @@ -769,7 +769,7 @@ void ClapLogger::log_response(bool is_host_plugin, const Ack&) { void ClapLogger::log_response( bool is_host_plugin, - const clap::plugin_factory::ListResponse& response) { + const clap::factory::plugin_factory::ListResponse& response) { log_response_base(is_host_plugin, [&](auto& message) { if (response.descriptors) { message << "bridge_.send_main_thread_message(clap::plugin_factory::Create{ + const clap::factory::plugin_factory::CreateResponse response = + self->bridge_.send_main_thread_message(clap::factory::plugin_factory::Create{ .host = *host, .plugin_id = plugin_id}); if (response.instance_id) { // This plugin proxy is tied to the instance ID created on the Wine diff --git a/src/plugin/bridges/clap-impls/plugin-factory-proxy.h b/src/plugin/bridges/clap-impls/plugin-factory-proxy.h index e9463ddd..3d8b89df 100644 --- a/src/plugin/bridges/clap-impls/plugin-factory-proxy.h +++ b/src/plugin/bridges/clap-impls/plugin-factory-proxy.h @@ -18,7 +18,7 @@ #include -#include +#include #include "../../common/serialization/clap/plugin.h" @@ -44,7 +44,7 @@ class clap_plugin_factory_proxy { /** * Construct the plugin factory proxy based on the plugin descriptors - * retrieved from a `clap::plugin_factory::ListReponse`. + * retrieved from a `clap::factory::plugin_factory::ListReponse`. */ clap_plugin_factory_proxy( ClapPluginBridge& bridge, diff --git a/src/plugin/bridges/clap.cpp b/src/plugin/bridges/clap.cpp index 6c2bf11d..767a08ed 100644 --- a/src/plugin/bridges/clap.cpp +++ b/src/plugin/bridges/clap.cpp @@ -332,8 +332,8 @@ const void* ClapPluginBridge::get_factory(const char* factory_id) { if (!plugin_factory_) { // If the plugin does not support this factory type, then we'll also // return a null poitner - const clap::plugin_factory::ListResponse response = - send_main_thread_message(clap::plugin_factory::List{}); + const clap::factory::plugin_factory::ListResponse response = + send_main_thread_message(clap::factory::plugin_factory::List{}); if (!response.descriptors) { return nullptr; } diff --git a/src/wine-host/bridges/clap-impls/host-proxy.h b/src/wine-host/bridges/clap-impls/host-proxy.h index 62ef62de..5f7abdeb 100644 --- a/src/wine-host/bridges/clap-impls/host-proxy.h +++ b/src/wine-host/bridges/clap-impls/host-proxy.h @@ -37,7 +37,7 @@ #include -#include "../../common/serialization/clap/plugin-factory.h" +#include "../../common/serialization/clap/factory/plugin-factory.h" // Forward declaration to avoid circular includes class ClapBridge; diff --git a/src/wine-host/bridges/clap.cpp b/src/wine-host/bridges/clap.cpp index 2c06f0a2..9e67a68a 100644 --- a/src/wine-host/bridges/clap.cpp +++ b/src/wine-host/bridges/clap.cpp @@ -19,7 +19,7 @@ #include #include -#include +#include // Generated inside of the build directory #include @@ -183,15 +183,15 @@ void ClapBridge::run() { // variant without it. return {}; }, - [&](const clap::plugin_factory::List&) - -> clap::plugin_factory::List::Response { + [&](const clap::factory::plugin_factory::List&) + -> clap::factory::plugin_factory::List::Response { return main_context_ .run_in_context([&]() { plugin_factory_ = static_cast( entry_->get_factory(CLAP_PLUGIN_FACTORY_ID)); if (!plugin_factory_) { - return clap::plugin_factory::ListResponse{ + return clap::factory::plugin_factory::ListResponse{ .descriptors = std::nullopt}; } @@ -214,13 +214,13 @@ void ClapBridge::run() { descriptors.push_back(*descriptor); } - return clap::plugin_factory::ListResponse{ + return clap::factory::plugin_factory::ListResponse{ .descriptors = descriptors}; }) .get(); }, - [&](clap::plugin_factory::Create& request) - -> clap::plugin_factory::Create::Response { + [&](clap::factory::plugin_factory::Create& request) + -> clap::factory::plugin_factory::Create::Response { return main_context_ .run_in_context([&]() { // This assertion should never be hit, but you can never @@ -241,10 +241,10 @@ void ClapBridge::run() { if (plugin) { register_plugin_instance(plugin, std::move(host_proxy)); - return clap::plugin_factory::CreateResponse{ + return clap::factory::plugin_factory::CreateResponse{ .instance_id = instance_id}; } else { - return clap::plugin_factory::CreateResponse{ + return clap::factory::plugin_factory::CreateResponse{ .instance_id = std::nullopt}; } }) diff --git a/src/wine-host/bridges/clap.h b/src/wine-host/bridges/clap.h index 86e2317c..7ccf9d62 100644 --- a/src/wine-host/bridges/clap.h +++ b/src/wine-host/bridges/clap.h @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include "../../common/audio-shm.h" diff --git a/subprojects/clap.wrap b/subprojects/clap.wrap index 9fa53abd..647ad6ec 100644 --- a/subprojects/clap.wrap +++ b/subprojects/clap.wrap @@ -1,7 +1,7 @@ [wrap-git] url = https://github.com/free-audio/clap.git -# This is tag 1.1.4 -revision = 650ad6a6b0215b3f964c49a004667ad876689dfd +# This is tag 1.1.7 +revision = 065d685d4e9657f0344f350eef748be2b4d8e318 depth = 1 patch_directory = clap diff --git a/subprojects/packagefiles/clap/meson.build b/subprojects/packagefiles/clap/meson.build index 6a1d45d4..f0794563 100644 --- a/subprojects/packagefiles/clap/meson.build +++ b/subprojects/packagefiles/clap/meson.build @@ -1,3 +1,3 @@ -project('clap', 'cpp', version : '1.1.4') +project('clap', 'cpp', version : '1.1.7') clap_dep = declare_dependency(include_directories : include_directories('include'))