diff --git a/source/backend/CarlaStandaloneNSM.cpp b/source/backend/CarlaStandaloneNSM.cpp index 0e4dc9f7e..3b19cedf7 100644 --- a/source/backend/CarlaStandaloneNSM.cpp +++ b/source/backend/CarlaStandaloneNSM.cpp @@ -419,7 +419,7 @@ protected: const CarlaPluginInfo* const pluginInfo(carla_get_plugin_info(i)); CARLA_SAFE_ASSERT_CONTINUE(pluginInfo != nullptr); - /*const*/ CarlaString pluginNameId(fClientNameId + "/" + CarlaString(pluginInfo->name).toBasic() + "/"); + /*const*/ CarlaString pluginNameId(fClientNameId + "/" + CarlaString(pluginInfo->name).replace('/','_') + "/"); for (uint32_t j=0, paramCount = carla_get_parameter_count(i); j < paramCount; ++j) { @@ -442,7 +442,7 @@ protected: continue; const char* const dir = paramData->type == CB::PARAMETER_INPUT ? "in" : "out"; - const CarlaString paramNameId = pluginNameId + CarlaString(paramInfo->name).toBasic(); + const CarlaString paramNameId = pluginNameId + CarlaString(paramInfo->name).replace('/','_'); const float defNorm = paramRanges->getNormalizedValue(paramRanges->def); diff --git a/source/utils/CarlaString.hpp b/source/utils/CarlaString.hpp index 152bccd0c..5f8294b7e 100644 --- a/source/utils/CarlaString.hpp +++ b/source/utils/CarlaString.hpp @@ -472,29 +472,33 @@ public: /* * Replace all occurrences of character 'before' with character 'after'. */ - void replace(const char before, const char after) noexcept + CarlaString& replace(const char before, const char after) noexcept { - CARLA_SAFE_ASSERT_RETURN(before != '\0' && after != '\0',); + CARLA_SAFE_ASSERT_RETURN(before != '\0' && after != '\0', *this); for (std::size_t i=0; i < fBufferLen; ++i) { if (fBuffer[i] == before) fBuffer[i] = after; } + + return *this; } /* * Truncate the string to size 'n'. */ - void truncate(const std::size_t n) noexcept + CarlaString& truncate(const std::size_t n) noexcept { if (n >= fBufferLen) - return; + return *this; for (std::size_t i=n; i < fBufferLen; ++i) fBuffer[i] = '\0'; fBufferLen = n; + + return *this; } /* @@ -522,7 +526,7 @@ public: /* * Convert to all ascii characters to lowercase. */ - void toLower() noexcept + CarlaString& toLower() noexcept { static const char kCharDiff('a' - 'A'); @@ -531,12 +535,14 @@ public: if (fBuffer[i] >= 'A' && fBuffer[i] <= 'Z') fBuffer[i] = static_cast(fBuffer[i] + kCharDiff); } + + return *this; } /* * Convert to all ascii characters to uppercase. */ - void toUpper() noexcept + CarlaString& toUpper() noexcept { static const char kCharDiff('a' - 'A'); @@ -545,6 +551,8 @@ public: if (fBuffer[i] >= 'a' && fBuffer[i] <= 'z') fBuffer[i] = static_cast(fBuffer[i] - kCharDiff); } + + return *this; } /*