From 69102eeafe175e9be41e9db2fe6781768dbc3db7 Mon Sep 17 00:00:00 2001 From: Penelope Clairmont Date: Sat, 15 Jan 2022 13:53:32 +0000 Subject: [PATCH 1/3] makePresetsFile(): plugin parameters should be indexed by j, not i --- LV2/juce_LV2_FileCreator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LV2/juce_LV2_FileCreator.cpp b/LV2/juce_LV2_FileCreator.cpp index 7fee2f19..c55a3f72 100644 --- a/LV2/juce_LV2_FileCreator.cpp +++ b/LV2/juce_LV2_FileCreator.cpp @@ -515,9 +515,9 @@ class JuceLV2FileCreator preset += " [\n"; } - String const paramName = params[i]->getName(1000); + String const paramName = params[j]->getName(1000); preset += " lv2:symbol \"" + nameToSymbol(paramName, j) + "\" ;\n"; - preset += " pset:value " + String::formatted("%f", safeParamValue(params[i]->getValue())) + " ;\n"; + preset += " pset:value " + String::formatted("%f", safeParamValue(params[j]->getValue())) + " ;\n"; if (j + 1 == params.size()) { From a55101104ff12a3c241c1d1839ba908264a0cc6d Mon Sep 17 00:00:00 2001 From: Penelope Clairmont Date: Tue, 17 May 2022 21:33:25 +0100 Subject: [PATCH 2/3] Improve the behaviour of cp commands in camomile plugin generation script Two improvements: * All uses of the `-r` option have been changed to `-R` because this is portable across Linux and OSX. * When copying the contents of the plugin dir to the build dir, specify `-L` so that the user can have symbolic links in the plugin dir pointing to patches stored elsewhere. With `-L`, the patches will be copied, not the links. --- Plugins/camomile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Plugins/camomile b/Plugins/camomile index d53ffefb..a68abe9c 100755 --- a/Plugins/camomile +++ b/Plugins/camomile @@ -82,7 +82,7 @@ generate_plugin_lv2_mac() { mkdir "$plugin_output_dir/$plugin_name.lv2/Contents" mkdir "$plugin_output_dir/$plugin_name.lv2/Contents/Resources" cp -f "$ThisPath/$CamomileLV2.$AppleLV2Extension" "$plugin_output_dir/$plugin_name.lv2/$plugin_name.$AppleLV2Extension" - cp -rf "$plugin_input_dir"/* "$plugin_output_dir/$plugin_name.lv2/Contents/Resources" + cp -RfL "$plugin_input_dir"/* "$plugin_output_dir/$plugin_name.lv2/Contents/Resources" for subfile in $(find "$plugin_output_dir/$plugin_name.lv2") do xattr -d com.apple.quarantine "$subfile" @@ -181,8 +181,8 @@ generate_plugin_au_mac() { rm -rf "$plugin_output_dir/$plugin_name.$AppleAuExtension" fi - cp -rf "$ThisPath/$camo_name.$AppleAuExtension" $plugin_output_dir/$plugin_name.$AppleAuExtension - cp -rf "$plugin_input_dir"/* "$plugin_output_dir/$plugin_name.$AppleAuExtension/Contents/Resources" + cp -Rf "$ThisPath/$camo_name.$AppleAuExtension" $plugin_output_dir/$plugin_name.$AppleAuExtension + cp -RfL "$plugin_input_dir"/* "$plugin_output_dir/$plugin_name.$AppleAuExtension/Contents/Resources" xattr -d com.apple.quarantine "$plugin_output_dir/$plugin_name.$AppleAuExtension" for subfile in $(find "$plugin_output_dir/$plugin_name.$AppleAuExtension/Contents") do @@ -235,8 +235,8 @@ generate_plugin_vst3_mac() { rm -rf "$plugin_output_dir/$plugin_name.$AppleVst3Extension" fi - cp -rf "$ThisPath/$camo_name.$AppleVst3Extension" "$plugin_output_dir/$plugin_name.$AppleVst3Extension" - cp -rf "$plugin_input_dir"/* "$plugin_output_dir/$plugin_name.$AppleVst3Extension/Contents/Resources" + cp -Rf "$ThisPath/$camo_name.$AppleVst3Extension" "$plugin_output_dir/$plugin_name.$AppleVst3Extension" + cp -RfL "$plugin_input_dir"/* "$plugin_output_dir/$plugin_name.$AppleVst3Extension/Contents/Resources" xattr -d com.apple.quarantine "$plugin_output_dir/$plugin_name.$AppleVst3Extension" for subfile in $(find "$plugin_output_dir/$plugin_name.$AppleVst3Extension/Contents") do @@ -274,7 +274,7 @@ generate_plugin_lv2_linux() { mkdir "$plugin_output_dir/$plugin_name.lv2" cp -f "$ThisPath/$CamomileLV2.$LinuxLV2Extension" "$plugin_output_dir/$plugin_name.lv2/$plugin_name.$LinuxLV2Extension" - cp -rf "$plugin_input_dir"/* "$plugin_output_dir/$plugin_name.lv2" + cp -RfL "$plugin_input_dir"/* "$plugin_output_dir/$plugin_name.lv2" LD_LIBRARY_PATH=$PWD "$ThisPath/lv2_file_generator" "$plugin_output_dir/$plugin_name.lv2/$plugin_name.$LinuxLV2Extension" $plugin_name mv -f "$PWD/manifest.ttl" "$plugin_output_dir/$plugin_name.lv2/manifest.ttl" @@ -324,8 +324,8 @@ generate_plugin_vst3_linux() { rm -rf $plugin_bundle fi - cp -rf "$ThisPath/$camo_name.$LinuxVst3Extension" $plugin_bundle - cp -rf "$plugin_input_dir"/* "$plugin_bundle/Contents/x86_64-linux" + cp -Rf "$ThisPath/$camo_name.$LinuxVst3Extension" $plugin_bundle + cp -RfL "$plugin_input_dir"/* "$plugin_bundle/Contents/x86_64-linux" mv -f "$plugin_bundle/Contents/x86_64-linux/$camo_name.so" "$plugin_bundle/Contents/x86_64-linux/$plugin_name.so" post_log "$plugin_output_dir/$plugin_name.$LinuxVst3Extension" else From 27a4a14b7e82f7735b693b712d8f9b22eba9ffef Mon Sep 17 00:00:00 2001 From: Penelope Clairmont Date: Fri, 21 Jan 2022 21:08:57 +0000 Subject: [PATCH 3/3] CMakeLists.txt: fix hang when >1 Camomile LV2 plugin is loaded (issue #286) This issue was ultimately caused by an object buried in the JUCE code having an inappropriate scope - GCC made the object a "unique global symbol", which means there is only one instance across the current process. When multiple plugins were loaded, they all shared this instance, but did not share other relevant objects (from the JUCE code), causing havoc. The fix is to ban GCC from marking symbols as "unique global". Also set the C++ standard to be C++20 for the Camomile_LV2 meta-plugin, in line with the other meta-plugins. --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a57ef157..bddb1b0a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -130,7 +130,11 @@ target_sources(CamomileFx PRIVATE ${CamomileSources} ${CamomilePdSources}) add_library(Camomile_LV2 SHARED ${CamomileLV2Sources}) target_link_libraries(Camomile_LV2 PRIVATE CamomileFx) -set_target_properties(Camomile_LV2 PROPERTIES PREFIX "") +set_target_properties(Camomile_LV2 PROPERTIES PREFIX "" CXX_STANDARD 20) + +if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") + target_compile_options(Camomile_LV2 PRIVATE "-fno-gnu-unique") +endif() set(CAMOMILE_COMPILE_DEFINITIONS JUCE_APP_CONFIG_HEADER="${SOURCES_DIRECTORY}/PluginConfig.h"