From 367f6ee4b479713d0062e772c7c5cd71a9667ed5 Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Mon, 1 Nov 2021 00:12:41 +0100 Subject: [PATCH] jsfx: use fx.desc as a better plugin name --- source/backend/plugin/CarlaPluginJSFX.cpp | 3 +-- source/backend/utils/CachedPlugins.cpp | 3 ++- source/discovery/carla-discovery.cpp | 4 +--- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/source/backend/plugin/CarlaPluginJSFX.cpp b/source/backend/plugin/CarlaPluginJSFX.cpp index b6b080b55..34766be08 100644 --- a/source/backend/plugin/CarlaPluginJSFX.cpp +++ b/source/backend/plugin/CarlaPluginJSFX.cpp @@ -931,8 +931,7 @@ public: } else { - String baseName = File(fFilename).getFileNameWithoutExtension(); - pData->name = pData->engine->getUniquePluginName(baseName.toRawUTF8()); + pData->name = carla_strdup(fEffect->desc); } pData->filename = carla_strdup(fFilename.c_str()); diff --git a/source/backend/utils/CachedPlugins.cpp b/source/backend/utils/CachedPlugins.cpp index 933c12a18..be2ce6480 100644 --- a/source/backend/utils/CachedPlugins.cpp +++ b/source/backend/utils/CachedPlugins.cpp @@ -673,7 +673,6 @@ static const CarlaCachedPluginInfo* get_cached_plugin_jsfx(const CarlaJsfxUnit& static CarlaString name, label; const water::File unitFilePath = unit.getFilePath(); - name = unitFilePath.getFileNameWithoutExtension().toRawUTF8(); label = unit.getFileId().toRawUTF8(); { @@ -692,6 +691,8 @@ static const CarlaCachedPluginInfo* get_cached_plugin_jsfx(const CarlaJsfxUnit& info.valid = true; + name = effect.desc; + // NOTE: count can be -1 in case of "none" info.audioIns = (effect.numInputs == -1) ? 0 : (uint32_t)effect.numInputs; info.audioOuts = (effect.numOutputs == -1) ? 0 : (uint32_t)effect.numOutputs; diff --git a/source/discovery/carla-discovery.cpp b/source/discovery/carla-discovery.cpp index e2248ba27..351f36931 100644 --- a/source/discovery/carla-discovery.cpp +++ b/source/discovery/carla-discovery.cpp @@ -1704,8 +1704,6 @@ static void do_jsfx_check(const char* const filename, bool doInit) return; } - water::String baseName = water::File(filename).getFileNameWithoutExtension(); - // NOTE: count can be -1 in case of "none" uint32_t audioIns = (effect.numInputs == -1) ? 0 : (uint32_t)effect.numInputs; uint32_t audioOuts = (effect.numOutputs == -1) ? 0 : (uint32_t)effect.numOutputs; @@ -1723,7 +1721,7 @@ static void do_jsfx_check(const char* const filename, bool doInit) DISCOVERY_OUT("init", "-----------"); DISCOVERY_OUT("build", BINARY_NATIVE); DISCOVERY_OUT("hints", hints); - DISCOVERY_OUT("name", baseName.toRawUTF8()); + DISCOVERY_OUT("name", effect.desc); DISCOVERY_OUT("label", filename); DISCOVERY_OUT("audio.ins", audioIns); DISCOVERY_OUT("audio.outs", audioOuts);