From 7eaf104d3d4455c230a1e4da712ab34e280582e6 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 26 Jul 2025 14:35:54 +0200 Subject: [PATCH] Cleanup use of CarlaString Signed-off-by: falkTX --- source/backend/engine/CarlaEngine.cpp | 61 +++++++++-------- source/backend/engine/CarlaEngineBridge.cpp | 11 ++- source/backend/engine/CarlaEngineNative.cpp | 3 +- source/backend/plugin/CarlaPlugin.cpp | 19 +++--- source/backend/plugin/CarlaPluginBridge.cpp | 44 ++++++------ .../backend/plugin/CarlaPluginFluidSynth.cpp | 25 ++----- source/backend/plugin/CarlaPluginJack.cpp | 8 +-- .../backend/plugin/CarlaPluginLADSPADSSI.cpp | 11 ++- source/backend/plugin/CarlaPluginNative.cpp | 25 ++----- source/backend/plugin/CarlaPluginSFZero.cpp | 21 +----- source/backend/utils/PluginDiscovery.cpp | 8 +-- source/bridges-plugin/CarlaBridgePlugin.cpp | 9 ++- .../bridges-plugin/CarlaBridgeSingleLV2.cpp | 38 ++++------- source/utils/CarlaBackendUtils.hpp | 28 +++----- source/utils/CarlaBridgeUtils.hpp | 29 +++----- source/utils/CarlaStateUtils.cpp | 67 +++++++------------ source/utils/CarlaStateUtils.hpp | 18 +---- 17 files changed, 148 insertions(+), 277 deletions(-) diff --git a/source/backend/engine/CarlaEngine.cpp b/source/backend/engine/CarlaEngine.cpp index 100599b95..b6413f2f5 100644 --- a/source/backend/engine/CarlaEngine.cpp +++ b/source/backend/engine/CarlaEngine.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2011-2024 Filipe Coelho +// SPDX-FileCopyrightText: 2011-2025 Filipe Coelho // SPDX-License-Identifier: GPL-2.0-or-later /* TODO: @@ -46,7 +46,6 @@ using water::Array; using water::CharPointer_UTF8; using water::File; using water::MemoryOutputStream; -using water::String; using water::StringArray; using water::XmlDocument; using water::XmlElement; @@ -2367,8 +2366,8 @@ void CarlaEngine::saveProjectInternal(water::MemoryOutputStream& outStream) cons outSettings << " " << bool2str(options.preferUiBridges) << "\n"; outSettings << " " << bool2str(options.uisAlwaysOnTop) << "\n"; - outSettings << " " << String(options.maxParameters) << "\n"; - outSettings << " " << String(options.uiBridgesTimeout) << "\n"; + outSettings << " " << water::String(options.maxParameters) << "\n"; + outSettings << " " << water::String(options.uiBridgesTimeout) << "\n"; if (isPlugin) { @@ -2585,12 +2584,12 @@ void CarlaEngine::saveProjectInternal(water::MemoryOutputStream& outStream) cons outStream << "\n"; } -static String findBinaryInCustomPath(const char* const searchPath, const char* const binary) +static water::String findBinaryInCustomPath(const char* const searchPath, const char* const binary) { const StringArray searchPaths(StringArray::fromTokens(searchPath, CARLA_OS_SPLIT_STR, "")); // try direct filename first - String jbinary(binary); + water::String jbinary(binary); // adjust for current platform #ifdef CARLA_OS_WIN @@ -2601,7 +2600,7 @@ static String findBinaryInCustomPath(const char* const searchPath, const char* c jbinary = jbinary.substring(2).replaceCharacter('\\', '/'); #endif - String filename = File(jbinary.toRawUTF8()).getFileName(); + water::String filename = File(jbinary.toRawUTF8()).getFileName(); int searchFlags = File::findFiles|File::ignoreHiddenFiles; @@ -2613,7 +2612,7 @@ static String findBinaryInCustomPath(const char* const searchPath, const char* c #endif std::vector results; - for (const String *it=searchPaths.begin(), *end=searchPaths.end(); it != end; ++it) + for (const water::String *it=searchPaths.begin(), *end=searchPaths.end(); it != end; ++it) { const File path(it->toRawUTF8()); @@ -2636,9 +2635,9 @@ static String findBinaryInCustomPath(const char* const searchPath, const char* c filename = File(jbinary.toRawUTF8()).getFileNameWithoutExtension() + ".so"; #endif else - return String(); + return {}; - for (const String *it=searchPaths.begin(), *end=searchPaths.end(); it != end; ++it) + for (const water::String *it=searchPaths.begin(), *end=searchPaths.end(); it != end; ++it) { const File path(it->toRawUTF8()); @@ -2649,7 +2648,7 @@ static String findBinaryInCustomPath(const char* const searchPath, const char* c return results.front().getFullPathName(); } - return String(); + return {}; } bool CarlaEngine::loadProjectInternal(water::XmlDocument& xmlDoc, const bool alwaysLoadConnections) @@ -2659,7 +2658,7 @@ bool CarlaEngine::loadProjectInternal(water::XmlDocument& xmlDoc, const bool alw CarlaScopedPointer xmlElement(xmlDoc.getDocumentElement(true)); CARLA_SAFE_ASSERT_RETURN_ERR(xmlElement != nullptr, "Failed to parse project file"); - const String& xmlType(xmlElement->getTagName()); + const water::String& xmlType(xmlElement->getTagName()); const bool isPreset(xmlType.equalsIgnoreCase("carla-preset")); if (! (xmlType.equalsIgnoreCase("carla-project") || isPreset)) @@ -2713,8 +2712,8 @@ bool CarlaEngine::loadProjectInternal(water::XmlDocument& xmlDoc, const bool alw { for (XmlElement* settElem = elem->getFirstChildElement(); settElem != nullptr; settElem = settElem->getNextElement()) { - const String& tag(settElem->getTagName()); - const String text(settElem->getAllSubText().trim()); + const water::String& tag(settElem->getTagName()); + const water::String text(settElem->getAllSubText().trim()); /** some settings might be incorrect or require extra work, so we call setOption rather than modifying them direly */ @@ -2847,7 +2846,7 @@ bool CarlaEngine::loadProjectInternal(water::XmlDocument& xmlDoc, const bool alw { if (XmlElement* const bpmElem = elem->getChildByName("BeatsPerMinute")) { - const String bpmText(bpmElem->getAllSubText().trim()); + const water::String bpmText(bpmElem->getAllSubText().trim()); const double bpm = bpmText.getDoubleValue(); // some sane limits @@ -2868,7 +2867,7 @@ bool CarlaEngine::loadProjectInternal(water::XmlDocument& xmlDoc, const bool alw // and we handle plugins for (XmlElement* elem = xmlElement->getFirstChildElement(); elem != nullptr; elem = elem->getNextElement()) { - const String& tagName(elem->getTagName()); + const water::String& tagName(elem->getTagName()); if (isPreset || tagName == "Plugin") { @@ -2906,7 +2905,7 @@ bool CarlaEngine::loadProjectInternal(water::XmlDocument& xmlDoc, const bool alw return false; } - String lsState; + water::String lsState; lsState << "0.35\n"; lsState << "18 0 Chromatic\n"; lsState << "18 1 Drum Kits\n"; @@ -3046,7 +3045,7 @@ bool CarlaEngine::loadProjectInternal(water::XmlDocument& xmlDoc, const bool alw carla_stderr("Plugin binary '%s' doesn't exist on this filesystem, let's look for it...", stateSave.binary); - String result = findBinaryInCustomPath(searchPath, stateSave.binary); + water::String result = findBinaryInCustomPath(searchPath, stateSave.binary); if (result.isEmpty()) { @@ -3198,12 +3197,12 @@ bool CarlaEngine::loadProjectInternal(water::XmlDocument& xmlDoc, const bool alw if (XmlElement* const elemPositions = elemPatchbay->getChildByName("Positions")) { - String name; + water::String name; PatchbayPosition ppos = { nullptr, -1, 0, 0, 0, 0, false }; for (XmlElement* patchElem = elemPositions->getFirstChildElement(); patchElem != nullptr; patchElem = patchElem->getNextElement()) { - const String& patchTag(patchElem->getTagName()); + const water::String& patchTag(patchElem->getTagName()); if (patchTag != "Position") continue; @@ -3211,7 +3210,7 @@ bool CarlaEngine::loadProjectInternal(water::XmlDocument& xmlDoc, const bool alw XmlElement* const patchName = patchElem->getChildByName("Name"); CARLA_SAFE_ASSERT_CONTINUE(patchName != nullptr); - const String nameText(patchName->getAllSubText().trim()); + const water::String nameText(patchName->getAllSubText().trim()); name = xmlSafeString(nameText, false); ppos.name = name.toRawUTF8(); @@ -3256,12 +3255,12 @@ bool CarlaEngine::loadProjectInternal(water::XmlDocument& xmlDoc, const bool alw { if (XmlElement* const elemPositions = elemPatchbay->getChildByName("Positions")) { - String name; + water::String name; PatchbayPosition ppos = { nullptr, -1, 0, 0, 0, 0, false }; for (XmlElement* patchElem = elemPositions->getFirstChildElement(); patchElem != nullptr; patchElem = patchElem->getNextElement()) { - const String& patchTag(patchElem->getTagName()); + const water::String& patchTag(patchElem->getTagName()); if (patchTag != "Position") continue; @@ -3269,7 +3268,7 @@ bool CarlaEngine::loadProjectInternal(water::XmlDocument& xmlDoc, const bool alw XmlElement* const patchName = patchElem->getChildByName("Name"); CARLA_SAFE_ASSERT_CONTINUE(patchName != nullptr); - const String nameText(patchName->getAllSubText().trim()); + const water::String nameText(patchName->getAllSubText().trim()); name = xmlSafeString(nameText, false); ppos.name = name.toRawUTF8(); @@ -3327,7 +3326,7 @@ bool CarlaEngine::loadProjectInternal(water::XmlDocument& xmlDoc, const bool alw for (XmlElement* patchElem = elem->getFirstChildElement(); patchElem != nullptr; patchElem = patchElem->getNextElement()) { - const String& patchTag(patchElem->getTagName()); + const water::String& patchTag(patchElem->getTagName()); if (patchTag != "Connection") continue; @@ -3337,8 +3336,8 @@ bool CarlaEngine::loadProjectInternal(water::XmlDocument& xmlDoc, const bool alw for (XmlElement* connElem = patchElem->getFirstChildElement(); connElem != nullptr; connElem = connElem->getNextElement()) { - const String& tag(connElem->getTagName()); - const String text(connElem->getAllSubText().trim()); + const water::String& tag(connElem->getTagName()); + const water::String text(connElem->getAllSubText().trim()); /**/ if (tag == "Source") sourcePort = xmlSafeString(text, false); @@ -3401,7 +3400,7 @@ bool CarlaEngine::loadProjectInternal(water::XmlDocument& xmlDoc, const bool alw for (XmlElement* elem = xmlElement->getFirstChildElement(); elem != nullptr; elem = elem->getNextElement()) { - const String& tagName(elem->getTagName()); + const water::String& tagName(elem->getTagName()); // check if we want to load patchbay-mode connections into an external (multi-client) graph if (tagName == "Patchbay") @@ -3427,7 +3426,7 @@ bool CarlaEngine::loadProjectInternal(water::XmlDocument& xmlDoc, const bool alw for (XmlElement* patchElem = elem->getFirstChildElement(); patchElem != nullptr; patchElem = patchElem->getNextElement()) { - const String& patchTag(patchElem->getTagName()); + const water::String& patchTag(patchElem->getTagName()); if (patchTag != "Connection") continue; @@ -3437,8 +3436,8 @@ bool CarlaEngine::loadProjectInternal(water::XmlDocument& xmlDoc, const bool alw for (XmlElement* connElem = patchElem->getFirstChildElement(); connElem != nullptr; connElem = connElem->getNextElement()) { - const String& tag(connElem->getTagName()); - const String text(connElem->getAllSubText().trim()); + const water::String& tag(connElem->getTagName()); + const water::String text(connElem->getAllSubText().trim()); /**/ if (tag == "Source") sourcePort = xmlSafeString(text, false); diff --git a/source/backend/engine/CarlaEngineBridge.cpp b/source/backend/engine/CarlaEngineBridge.cpp index d5031525e..bc5264637 100644 --- a/source/backend/engine/CarlaEngineBridge.cpp +++ b/source/backend/engine/CarlaEngineBridge.cpp @@ -34,7 +34,6 @@ using water::File; using water::MemoryBlock; -using water::String; CARLA_BACKEND_START_NAMESPACE @@ -926,7 +925,7 @@ public: CARLA_SAFE_ASSERT_BREAK(bigValueFilePathTry.text[0] != '\0'); if (! plugin->isEnabled()) break; - String bigValueFilePath(bigValueFilePathTry.text); + water::String bigValueFilePath(bigValueFilePathTry.text); #ifdef CARLA_OS_WIN // check if running under Wine @@ -967,7 +966,7 @@ public: CARLA_SAFE_ASSERT_BREAK(chunkFilePathTry.text[0] != '\0'); if (! plugin->isEnabled()) break; - String chunkFilePath(chunkFilePathTry.text); + water::String chunkFilePath(chunkFilePathTry.text); #ifdef CARLA_OS_WIN // check if running under Wine @@ -978,7 +977,7 @@ public: File chunkFile(chunkFilePath.toRawUTF8()); CARLA_SAFE_ASSERT_BREAK(chunkFile.existsAsFile()); - String chunkDataBase64(chunkFile.loadFileAsString()); + water::String chunkDataBase64(chunkFile.loadFileAsString()); chunkFile.deleteFile(); CARLA_SAFE_ASSERT_BREAK(chunkDataBase64.isNotEmpty()); @@ -1105,7 +1104,7 @@ public: { if (valueLen > maxLocalValueLen) { - String filePath(File::getSpecialLocation(File::tempDirectory).getFullPathName()); + water::String filePath(File::getSpecialLocation(File::tempDirectory).getFullPathName()); filePath += CARLA_OS_SEP_STR ".CarlaCustomData_"; filePath += fShmAudioPool.getFilenameSuffix(); @@ -1143,7 +1142,7 @@ public: CarlaString dataBase64 = CarlaString::asBase64(data, dataSize); CARLA_SAFE_ASSERT_BREAK(dataBase64.length() > 0); - String filePath(File::getSpecialLocation(File::tempDirectory).getFullPathName()); + water::String filePath(File::getSpecialLocation(File::tempDirectory).getFullPathName()); filePath += CARLA_OS_SEP_STR ".CarlaChunk_"; filePath += fShmAudioPool.getFilenameSuffix(); diff --git a/source/backend/engine/CarlaEngineNative.cpp b/source/backend/engine/CarlaEngineNative.cpp index c5dc0a726..5c4a9b589 100644 --- a/source/backend/engine/CarlaEngineNative.cpp +++ b/source/backend/engine/CarlaEngineNative.cpp @@ -38,7 +38,6 @@ using water::File; using water::MemoryOutputStream; -using water::String; using water::XmlDocument; using water::XmlElement; @@ -1520,7 +1519,7 @@ protected: pData->runner.start(); fOptionsForced = true; - const String state(data); + const water::String state(data); XmlDocument xml(state); loadProjectInternal(xml, true); diff --git a/source/backend/plugin/CarlaPlugin.cpp b/source/backend/plugin/CarlaPlugin.cpp index 3e5677f60..962126412 100644 --- a/source/backend/plugin/CarlaPlugin.cpp +++ b/source/backend/plugin/CarlaPlugin.cpp @@ -24,7 +24,6 @@ using water::CharPointer_UTF8; using water::File; using water::MemoryOutputStream; using water::Result; -using water::String; using water::XmlDocument; using water::XmlElement; @@ -1126,8 +1125,8 @@ bool CarlaPlugin::exportAsLV2(const char* const lv2path) for (uint32_t i=1; iaudioIn.count; ++i) { - const String portIndexNum(portIndex++); - const String portIndexLabel(i+1); + const water::String portIndexNum(portIndex++); + const water::String portIndexLabel(i+1); mainStream << " lv2:port [\n"; mainStream << " a lv2:InputPort, lv2:AudioPort ;\n"; @@ -1193,8 +1192,8 @@ bool CarlaPlugin::exportAsLV2(const char* const lv2path) for (uint32_t i=0; iaudioOut.count; ++i) { - const String portIndexNum(portIndex++); - const String portIndexLabel(i+1); + const water::String portIndexNum(portIndex++); + const water::String portIndexLabel(i+1); mainStream << " lv2:port [\n"; mainStream << " a lv2:OutputPort, lv2:AudioPort ;\n"; @@ -1216,7 +1215,7 @@ bool CarlaPlugin::exportAsLV2(const char* const lv2path) const ParameterData& paramData(pData->param.data[i]); const ParameterRanges& paramRanges(pData->param.ranges[i]); - const String portIndexNum(portIndex++); + const water::String portIndexNum(portIndex++); mainStream << " lv2:port [\n"; diff --git a/source/backend/plugin/CarlaPluginBridge.cpp b/source/backend/plugin/CarlaPluginBridge.cpp index 744ec0513..257543b76 100644 --- a/source/backend/plugin/CarlaPluginBridge.cpp +++ b/source/backend/plugin/CarlaPluginBridge.cpp @@ -27,8 +27,6 @@ using water::ChildProcess; using water::File; -using water::String; -using water::StringArray; CARLA_BACKEND_START_NAMESPACE @@ -40,17 +38,17 @@ static const ExternalMidiNote kExternalMidiNoteFallback = { -1, 0, 0 }; // -------------------------------------------------------------------------------------------------------------------- #ifndef CARLA_OS_WIN -static String findWinePrefix(const String filename, const int recursionLimit = 10) +static water::String findWinePrefix(const water::String filename, const int recursionLimit = 10) { if (recursionLimit == 0 || filename.length() < 5 || ! filename.contains("/")) - return ""; + return {}; - const String path(filename.upToLastOccurrenceOf("/", false, false)); + const water::String path(filename.upToLastOccurrenceOf("/", false, false)); - if (File(String(path + "/dosdevices").toRawUTF8()).isDirectory()) + if (File(water::String(path + "/dosdevices").toRawUTF8()).isDirectory()) return path; - return findWinePrefix(path, recursionLimit-1); + return findWinePrefix(path, recursionLimit - 1); } #endif @@ -172,18 +170,18 @@ protected: const EngineOptions& options(kEngine->getOptions()); - String filename(kPlugin->getFilename()); + water::String filename(kPlugin->getFilename()); if (filename.isEmpty()) filename = "(none)"; - StringArray arguments; + water::StringArray arguments; #ifndef CARLA_OS_WIN // start with "wine" if needed if (fBridgeBinary.endsWithIgnoreCase(".exe")) { - String wineCMD; + water::String wineCMD; if (options.wine.executable != nullptr && options.wine.executable[0] != '\0') { @@ -191,7 +189,7 @@ protected: if (fBridgeBinary.endsWithIgnoreCase("64.exe") && options.wine.executable[0] == CARLA_OS_SEP - && File(String(wineCMD + "64").toRawUTF8()).existsAsFile()) + && File(water::String(wineCMD + "64").toRawUTF8()).existsAsFile()) wineCMD += "64"; } else @@ -227,7 +225,7 @@ protected: arguments.add(fLabel); // uniqueId - arguments.add(String(static_cast(kPlugin->getUniqueId()))); + arguments.add(water::String(static_cast(kPlugin->getUniqueId()))); bool started; @@ -412,10 +410,10 @@ private: CarlaEngine* const kEngine; CarlaPlugin* const kPlugin; - String fBinaryArchName; - String fBridgeBinary; - String fLabel; - String fShmIds; + water::String fBinaryArchName; + water::String fBridgeBinary; + water::String fLabel; + water::String fShmIds; #ifndef CARLA_OS_WIN CarlaString fWinePrefix; #endif @@ -978,7 +976,7 @@ public: { if (valueLen > maxLocalValueLen) { - String filePath(File::getSpecialLocation(File::tempDirectory).getFullPathName()); + water::String filePath(File::getSpecialLocation(File::tempDirectory).getFullPathName()); filePath += CARLA_OS_SEP_STR ".CarlaCustomData_"; filePath += fShmAudioPool.getFilenameSuffix(); @@ -1016,7 +1014,7 @@ public: CarlaString dataBase64(CarlaString::asBase64(data, dataSize)); CARLA_SAFE_ASSERT_RETURN(dataBase64.length() > 0,); - String filePath(File::getSpecialLocation(File::tempDirectory).getFullPathName()); + water::String filePath(File::getSpecialLocation(File::tempDirectory).getFullPathName()); filePath += CARLA_OS_SEP_STR ".CarlaChunk_"; filePath += fShmAudioPool.getFilenameSuffix(); @@ -2518,13 +2516,13 @@ public: { const BridgeTextReader bigValueFilePath(fShmNonRtServerControl); - String realBigValueFilePath(bigValueFilePath.text); + water::String realBigValueFilePath(bigValueFilePath.text); #ifndef CARLA_OS_WIN // Using Wine, fix temp dir if (fBinaryType == BINARY_WIN32 || fBinaryType == BINARY_WIN64) { - const StringArray driveLetterSplit(StringArray::fromTokens(realBigValueFilePath, ":/", "")); + const water::StringArray driveLetterSplit(water::StringArray::fromTokens(realBigValueFilePath, ":/", "")); carla_stdout("big value save path BEFORE => '%s' | using wineprefix '%s'", realBigValueFilePath.toRawUTF8(), fWinePrefix.buffer()); realBigValueFilePath = fWinePrefix.buffer(); @@ -2559,13 +2557,13 @@ public: // chunkFilePath const BridgeTextReader chunkFilePath(fShmNonRtServerControl); - String realChunkFilePath(chunkFilePath.text); + water::String realChunkFilePath(chunkFilePath.text); #ifndef CARLA_OS_WIN // Using Wine, fix temp dir if (fBinaryType == BINARY_WIN32 || fBinaryType == BINARY_WIN64) { - const StringArray driveLetterSplit(StringArray::fromTokens(realChunkFilePath, ":/", "")); + const water::StringArray driveLetterSplit(water::StringArray::fromTokens(realChunkFilePath, ":/", "")); carla_stdout("chunk save path BEFORE => '%s' | using wineprefix '%s'", realChunkFilePath.toRawUTF8(), fWinePrefix.buffer()); realChunkFilePath = fWinePrefix.buffer(); @@ -3227,7 +3225,7 @@ private: CarlaString dataBase64(CarlaString::asBase64(data, dataSize)); CARLA_SAFE_ASSERT_RETURN(dataBase64.length() > 0, true); - String filePath(File::getSpecialLocation(File::tempDirectory).getFullPathName()); + water::String filePath(File::getSpecialLocation(File::tempDirectory).getFullPathName()); filePath += CARLA_OS_SEP_STR ".CarlaChunk_"; filePath += fShmAudioPool.getFilenameSuffix(); diff --git a/source/backend/plugin/CarlaPluginFluidSynth.cpp b/source/backend/plugin/CarlaPluginFluidSynth.cpp index cfcf00710..05fc21133 100644 --- a/source/backend/plugin/CarlaPluginFluidSynth.cpp +++ b/source/backend/plugin/CarlaPluginFluidSynth.cpp @@ -1,19 +1,5 @@ -/* - * Carla FluidSynth Plugin - * Copyright (C) 2011-2020 Filipe Coelho - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * For a full copy of the GNU General Public License see the doc/GPL.txt file. - */ +// SPDX-FileCopyrightText: 2011-2025 Filipe Coelho +// SPDX-License-Identifier: GPL-2.0-or-later #include "CarlaPluginInternal.hpp" #include "CarlaEngine.hpp" @@ -29,9 +15,6 @@ #define FLUID_DEFAULT_POLYPHONY 64 -using water::String; -using water::StringArray; - CARLA_BACKEND_START_NAMESPACE // ------------------------------------------------------------------------------------------------------------------- @@ -519,12 +502,12 @@ public: if (std::strcmp(key, "midiPrograms") != 0) return carla_stderr2("CarlaPluginFluidSynth::setCustomData(\"%s\", \"%s\", \"%s\", %s) - type is not string", type, key, value, bool2str(sendGui)); - StringArray midiProgramList(StringArray::fromTokens(value, ":", "")); + water::StringArray midiProgramList(water::StringArray::fromTokens(value, ":", "")); if (midiProgramList.size() == MAX_MIDI_CHANNELS) { uint8_t channel = 0; - for (String *it=midiProgramList.begin(), *end=midiProgramList.end(); it != end; ++it) + for (water::String *it=midiProgramList.begin(), *end=midiProgramList.end(); it != end; ++it) { const int index(it->getIntValue()); diff --git a/source/backend/plugin/CarlaPluginJack.cpp b/source/backend/plugin/CarlaPluginJack.cpp index eb779d7af..d09a2c61d 100644 --- a/source/backend/plugin/CarlaPluginJack.cpp +++ b/source/backend/plugin/CarlaPluginJack.cpp @@ -36,8 +36,6 @@ using water::ChildProcess; using water::File; -using water::String; -using water::StringArray; CARLA_BACKEND_START_NAMESPACE @@ -333,15 +331,15 @@ protected: carla_stderr("CarlaPluginJackThread::run() - already running"); } - String name(kPlugin->getName()); - String filename(kPlugin->getFilename()); + water::String name(kPlugin->getName()); + water::String filename(kPlugin->getFilename()); if (name.isEmpty()) name = "(none)"; CARLA_SAFE_ASSERT_RETURN(filename.isNotEmpty(),); - StringArray arguments; + water::StringArray arguments; // binary arguments.addTokens(filename, true); diff --git a/source/backend/plugin/CarlaPluginLADSPADSSI.cpp b/source/backend/plugin/CarlaPluginLADSPADSSI.cpp index a186f076c..2f7961dc2 100644 --- a/source/backend/plugin/CarlaPluginLADSPADSSI.cpp +++ b/source/backend/plugin/CarlaPluginLADSPADSSI.cpp @@ -18,9 +18,6 @@ using water::ChildProcess; #endif -using water::String; -using water::StringArray; - #define CARLA_PLUGIN_DSSI_OSC_CHECK_OSC_TYPES(/* argc, types, */ argcToCompare, typesToCompare) \ /* check argument count */ \ if (argc != argcToCompare) \ @@ -121,8 +118,8 @@ public: return; } - String name(kPlugin->getName()); - String filename(kPlugin->getFilename()); + water::String name(kPlugin->getName()); + water::String filename(kPlugin->getFilename()); if (name.isEmpty()) name = "(none)"; @@ -130,13 +127,13 @@ public: if (filename.isEmpty()) filename = "\"\""; - StringArray arguments; + water::StringArray arguments; // binary arguments.add(fBinary.buffer()); // osc-url - arguments.add(String(kEngine->getOscServerPathUDP()) + String("/") + String(kPlugin->getId())); + arguments.add(String(kEngine->getOscServerPathUDP()) + water::String("/") + water::String(kPlugin->getId())); // filename arguments.add(filename); diff --git a/source/backend/plugin/CarlaPluginNative.cpp b/source/backend/plugin/CarlaPluginNative.cpp index 72ca45bc5..1405040ac 100644 --- a/source/backend/plugin/CarlaPluginNative.cpp +++ b/source/backend/plugin/CarlaPluginNative.cpp @@ -1,19 +1,5 @@ -/* - * Carla Native Plugin - * Copyright (C) 2012-2022 Filipe Coelho - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * For a full copy of the GNU General Public License see the doc/GPL.txt file. - */ +// SPDX-FileCopyrightText: 2011-2025 Filipe Coelho +// SPDX-License-Identifier: GPL-2.0-or-later #include "CarlaPluginInternal.hpp" #include "CarlaEngine.hpp" @@ -25,9 +11,6 @@ #include "water/misc/Time.h" #include "water/text/StringArray.h" -using water::String; -using water::StringArray; - // ----------------------------------------------------------------------- // used in carla-base.cpp @@ -819,12 +802,12 @@ public: } else if (std::strcmp(key, "midiPrograms") == 0 && fDescriptor->set_midi_program != nullptr) { - StringArray midiProgramList(StringArray::fromTokens(value, ":", "")); + water::StringArray midiProgramList(water::StringArray::fromTokens(value, ":", "")); if (midiProgramList.size() == MAX_MIDI_CHANNELS) { uint8_t channel = 0; - for (String *it=midiProgramList.begin(), *end=midiProgramList.end(); it != end; ++it) + for (water::String *it=midiProgramList.begin(), *end=midiProgramList.end(); it != end; ++it) { const int index(it->getIntValue()); diff --git a/source/backend/plugin/CarlaPluginSFZero.cpp b/source/backend/plugin/CarlaPluginSFZero.cpp index 426a53774..7fca69550 100644 --- a/source/backend/plugin/CarlaPluginSFZero.cpp +++ b/source/backend/plugin/CarlaPluginSFZero.cpp @@ -1,19 +1,5 @@ -/* - * Carla SFZero Plugin - * Copyright (C) 2018-2023 Filipe Coelho - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * For a full copy of the GNU General Public License see the doc/GPL.txt file. - */ +// SPDX-FileCopyrightText: 2011-2025 Filipe Coelho +// SPDX-License-Identifier: GPL-2.0-or-later #include "CarlaPluginInternal.hpp" #include "CarlaEngine.hpp" @@ -35,7 +21,6 @@ using water::AudioSampleBuffer; using water::File; using water::MidiMessage; -using water::String; // ----------------------------------------------------------------------- @@ -713,7 +698,7 @@ public: // --------------------------------------------------------------- - const String basename(File(filename).getFileNameWithoutExtension()); + const water::String basename(File(filename).getFileNameWithoutExtension()); CarlaString label2(label != nullptr ? label : basename.toRawUTF8()); diff --git a/source/backend/utils/PluginDiscovery.cpp b/source/backend/utils/PluginDiscovery.cpp index 7350aaa29..445af5b9a 100644 --- a/source/backend/utils/PluginDiscovery.cpp +++ b/source/backend/utils/PluginDiscovery.cpp @@ -69,8 +69,8 @@ struct CarlaPluginDiscoveryOptions { #if !defined(BUILD_BRIDGE_ALTERNATIVE_ARCH) && !defined(CARLA_OS_WIN) struct { bool autoPrefix; - CarlaString executable; - CarlaString fallbackPrefix; + String executable; + String fallbackPrefix; } wine; #endif @@ -382,12 +382,12 @@ private: uint fBinaryIndex; const uint fBinaryCount; const std::vector fBinaries; - const CarlaString fDiscoveryTool; + const String fDiscoveryTool; uint32_t fLastMessageTime; CarlaPluginDiscoveryInfo fNextInfo; - CarlaString fNextSha1Sum; + String fNextSha1Sum; char* fNextLabel; char* fNextMaker; char* fNextName; diff --git a/source/bridges-plugin/CarlaBridgePlugin.cpp b/source/bridges-plugin/CarlaBridgePlugin.cpp index abc950475..0b137af62 100644 --- a/source/bridges-plugin/CarlaBridgePlugin.cpp +++ b/source/bridges-plugin/CarlaBridgePlugin.cpp @@ -52,7 +52,6 @@ using CARLA_BACKEND_NAMESPACE::runMainLoopOnce; using water::CharPointer_UTF8; using water::File; -using water::String; // ------------------------------------------------------------------------- @@ -113,7 +112,7 @@ static void initSignalHandler() // ------------------------------------------------------------------------- static CarlaHostHandle gHostHandle; -static CarlaString gProjectFilename; +static String gProjectFilename; static void gIdle() { @@ -419,7 +418,7 @@ int main(int argc, char* argv[]) // --------------------------------------------------------------------- // Set client name - CarlaString clientName; + String clientName; if (name != nullptr) { @@ -431,7 +430,7 @@ int main(int argc, char* argv[]) CARLA_SAFE_ASSERT_RETURN(label != nullptr && label[0] != '\0', 1); // LV2 URI is not usable as client name, create a usable name from URI - CarlaString label2(label); + String label2(label); // truncate until last valid char for (std::size_t i=label2.length()-1; i != 0; --i) @@ -545,7 +544,7 @@ int main(int argc, char* argv[]) { if (sched_setscheduler(0, SCHED_RR|SCHED_RESET_ON_FORK, &sparam) < 0) { - CarlaString error(std::strerror(errno)); + String error(std::strerror(errno)); carla_stderr("Failed to set high priority, error %i: %s", errno, error.buffer()); } } diff --git a/source/bridges-plugin/CarlaBridgeSingleLV2.cpp b/source/bridges-plugin/CarlaBridgeSingleLV2.cpp index 77af3202e..512e065db 100644 --- a/source/bridges-plugin/CarlaBridgeSingleLV2.cpp +++ b/source/bridges-plugin/CarlaBridgeSingleLV2.cpp @@ -1,19 +1,5 @@ -/* - * Carla LV2 Single Plugin - * Copyright (C) 2017-2024 Filipe Coelho - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * For a full copy of the GNU General Public License see the doc/GPL.txt file. - */ +// SPDX-FileCopyrightText: 2011-2025 Filipe Coelho +// SPDX-License-Identifier: GPL-2.0-or-later #ifndef BUILD_BRIDGE # error This file should not be compiled if not building bridge @@ -57,10 +43,10 @@ public: return; // xxxxx - CarlaString binaryDir(bundlePath); + String binaryDir(bundlePath); binaryDir += CARLA_OS_SEP_STR "bin" CARLA_OS_SEP_STR; - CarlaString resourceDir(bundlePath); + String resourceDir(bundlePath); resourceDir += CARLA_OS_SEP_STR "res" CARLA_OS_SEP_STR; pData->bufferSize = fBufferSize; @@ -79,8 +65,8 @@ public: if (pData->options.binaryDir != nullptr) delete[] pData->options.binaryDir; - pData->options.binaryDir = binaryDir.dup(); - pData->options.resourceDir = resourceDir.dup(); + pData->options.binaryDir = carla_strdup(binaryDir); + pData->options.resourceDir = carla_strdup(resourceDir); setCallback(_engine_callback, this); @@ -695,17 +681,17 @@ const LV2_Descriptor* lv2_descriptor(uint32_t index) if (index != 0) return nullptr; - static CarlaString ret; + static String ret; if (ret.isEmpty()) { using namespace water; const File file(File::getSpecialLocation(File::currentExecutableFile).withFileExtension("ttl")); #ifdef CARLA_OS_WIN - ret = String("file:///" + file.getFullPathName()).toRawUTF8(); + ret = water::String("file:///" + file.getFullPathName()).toRawUTF8(); ret.replace('\\','/'); #else - ret = String("file://" + file.getFullPathName()).toRawUTF8(); + ret = water::String("file://" + file.getFullPathName()).toRawUTF8(); #endif } @@ -730,16 +716,16 @@ const LV2UI_Descriptor* lv2ui_descriptor(uint32_t index) { carla_debug("lv2ui_descriptor(%i)", index); - static CarlaString ret; + static String ret; { using namespace water; const File file(File::getSpecialLocation(File::currentExecutableFile).getSiblingFile("ext-ui")); #ifdef CARLA_OS_WIN - ret = String("file:///" + file.getFullPathName()).toRawUTF8(); + ret = water::String("file:///" + file.getFullPathName()).toRawUTF8(); ret.replace('\\','/'); #else - ret = String("file://" + file.getFullPathName()).toRawUTF8(); + ret = water::String("file://" + file.getFullPathName()).toRawUTF8(); #endif } diff --git a/source/utils/CarlaBackendUtils.hpp b/source/utils/CarlaBackendUtils.hpp index a5b9b5425..59d0c3325 100644 --- a/source/utils/CarlaBackendUtils.hpp +++ b/source/utils/CarlaBackendUtils.hpp @@ -1,26 +1,14 @@ -/* - * Carla Backend utils - * Copyright (C) 2011-2024 Filipe Coelho - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * For a full copy of the GNU General Public License see the doc/GPL.txt file. - */ +// SPDX-FileCopyrightText: 2011-2025 Filipe Coelho +// SPDX-License-Identifier: GPL-2.0-or-later #ifndef CARLA_BACKEND_UTILS_HPP_INCLUDED #define CARLA_BACKEND_UTILS_HPP_INCLUDED #include "CarlaBackend.h" #include "CarlaNative.h" -#include "CarlaString.hpp" +#include "CarlaUtils.hpp" + +#include "distrho/extra/String.hpp" CARLA_BACKEND_START_NAMESPACE @@ -613,7 +601,7 @@ BinaryType getBinaryTypeFromString(const char* const ctype) noexcept CARLA_SAFE_ASSERT_RETURN(ctype != nullptr && ctype[0] != '\0', BINARY_NONE); carla_debug("CarlaBackend::getBinaryTypeFromString(\"%s\")", ctype); - CarlaString stype(ctype); + String stype(ctype); if (stype.isEmpty()) return BINARY_NONE; @@ -758,7 +746,7 @@ PluginType getPluginTypeFromString(const char* const ctype) noexcept CARLA_SAFE_ASSERT_RETURN(ctype != nullptr && ctype[0] != '\0', PLUGIN_NONE); carla_debug("CarlaBackend::getPluginTypeFromString(\"%s\")", ctype); - CarlaString stype(ctype); + String stype(ctype); if (stype.isEmpty()) return PLUGIN_NONE; @@ -808,7 +796,7 @@ PluginCategory getPluginCategoryFromName(const char* const name) noexcept CARLA_SAFE_ASSERT_RETURN(name != nullptr && name[0] != '\0', PLUGIN_CATEGORY_NONE); carla_debug("CarlaBackend::getPluginCategoryFromName(\"%s\")", name); - CarlaString sname(name); + String sname(name); if (sname.isEmpty()) return PLUGIN_CATEGORY_NONE; diff --git a/source/utils/CarlaBridgeUtils.hpp b/source/utils/CarlaBridgeUtils.hpp index ad9aafe96..420250ce3 100644 --- a/source/utils/CarlaBridgeUtils.hpp +++ b/source/utils/CarlaBridgeUtils.hpp @@ -1,19 +1,5 @@ -/* - * Carla Bridge utils - * Copyright (C) 2013-2023 Filipe Coelho - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * For a full copy of the GNU General Public License see the doc/GPL.txt file. - */ +// SPDX-FileCopyrightText: 2011-2025 Filipe Coelho +// SPDX-License-Identifier: GPL-2.0-or-later #ifndef CARLA_BRIDGE_UTILS_HPP_INCLUDED #define CARLA_BRIDGE_UTILS_HPP_INCLUDED @@ -21,7 +7,8 @@ #include "CarlaBridgeDefines.hpp" #include "CarlaMutex.hpp" #include "CarlaRingBuffer.hpp" -#include "CarlaString.hpp" + +#include "distrho/extra/String.hpp" // ------------------------------------------------------------------------------------------------------------------- @@ -243,7 +230,7 @@ struct BridgeNonRtServerData { struct CARLA_API BridgeAudioPool { float* data; std::size_t dataSize; - CarlaString filename; + String filename; char shm[64]; bool isServer; @@ -265,7 +252,7 @@ struct CARLA_API BridgeAudioPool { struct CARLA_API BridgeRtClientControl : public CarlaRingBufferControl { BridgeRtClientData* data; - CarlaString filename; + String filename; bool needsSemDestroy; // client only char shm[64]; bool isServer; @@ -305,7 +292,7 @@ struct CARLA_API BridgeRtClientControl : public CarlaRingBufferControl { BridgeNonRtClientData* data; - CarlaString filename; + String filename; CarlaMutex mutex; char shm[64]; bool isServer; @@ -334,7 +321,7 @@ struct CARLA_API BridgeNonRtClientControl : public CarlaRingBufferControl { BridgeNonRtServerData* data; - CarlaString filename; + String filename; CarlaMutex mutex; char shm[64]; bool isServer; diff --git a/source/utils/CarlaStateUtils.cpp b/source/utils/CarlaStateUtils.cpp index 8a87da853..39b98cfaa 100644 --- a/source/utils/CarlaStateUtils.cpp +++ b/source/utils/CarlaStateUtils.cpp @@ -1,19 +1,5 @@ -/* - * Carla State utils - * Copyright (C) 2012-2024 Filipe Coelho - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * For a full copy of the GNU General Public License see the doc/GPL.txt file. - */ +// SPDX-FileCopyrightText: 2011-2025 Filipe Coelho +// SPDX-License-Identifier: GPL-2.0-or-later #include "CarlaStateUtils.hpp" @@ -27,7 +13,6 @@ #include using water::MemoryOutputStream; -using water::String; using water::XmlElement; CARLA_BACKEND_START_NAMESPACE @@ -35,7 +20,7 @@ CARLA_BACKEND_START_NAMESPACE // ----------------------------------------------------------------------- // getNewLineSplittedString -static void getNewLineSplittedString(MemoryOutputStream& stream, const String& string) +static void getNewLineSplittedString(MemoryOutputStream& stream, const water::String& string) { static const int kLineWidth = 120; @@ -109,7 +94,7 @@ static const char* xmlSafeStringCharDup(const char* const cstring, const bool to } */ -static const char* xmlSafeStringCharDup(const String& string, const bool toXml) +static const char* xmlSafeStringCharDup(const water::String& string, const bool toXml) { return carla_strdup(xmlSafeString(string, toXml).toRawUTF8()); } @@ -292,7 +277,7 @@ bool CarlaStateSave::fillFromXmlElement(const XmlElement* const xmlElement) for (XmlElement* elem = xmlElement->getFirstChildElement(); elem != nullptr; elem = elem->getNextElement()) { - const String& tagName(elem->getTagName()); + const water::String& tagName(elem->getTagName()); // --------------------------------------------------------------- // Info @@ -301,8 +286,8 @@ bool CarlaStateSave::fillFromXmlElement(const XmlElement* const xmlElement) { for (XmlElement* xmlInfo = elem->getFirstChildElement(); xmlInfo != nullptr; xmlInfo = xmlInfo->getNextElement()) { - const String& tag(xmlInfo->getTagName()); - const String text(xmlInfo->getAllSubText().trim()); + const water::String& tag(xmlInfo->getTagName()); + const water::String text(xmlInfo->getAllSubText().trim()); /**/ if (tag == "Type") type = xmlSafeStringCharDup(text, false); @@ -324,8 +309,8 @@ bool CarlaStateSave::fillFromXmlElement(const XmlElement* const xmlElement) { for (XmlElement* xmlData = elem->getFirstChildElement(); xmlData != nullptr; xmlData = xmlData->getNextElement()) { - const String& tag(xmlData->getTagName()); - const String text(xmlData->getAllSubText().trim()); + const water::String& tag(xmlData->getTagName()); + const water::String text(xmlData->getAllSubText().trim()); // ------------------------------------------------------- // Internal Data @@ -414,8 +399,8 @@ bool CarlaStateSave::fillFromXmlElement(const XmlElement* const xmlElement) for (XmlElement* xmlSubData = xmlData->getFirstChildElement(); xmlSubData != nullptr; xmlSubData = xmlSubData->getNextElement()) { - const String& pTag(xmlSubData->getTagName()); - const String pText(xmlSubData->getAllSubText().trim()); + const water::String& pTag(xmlSubData->getTagName()); + const water::String pText(xmlSubData->getAllSubText().trim()); /**/ if (pTag == "Index") { @@ -487,7 +472,7 @@ bool CarlaStateSave::fillFromXmlElement(const XmlElement* const xmlElement) // find type first for (XmlElement* xmlSubData = xmlData->getFirstChildElement(); xmlSubData != nullptr; xmlSubData = xmlSubData->getNextElement()) { - const String& cTag(xmlSubData->getTagName()); + const water::String& cTag(xmlSubData->getTagName()); if (cTag != "Type") continue; @@ -506,8 +491,8 @@ bool CarlaStateSave::fillFromXmlElement(const XmlElement* const xmlElement) // now fill in key and value, knowing what the type is for (XmlElement* xmlSubData = xmlData->getFirstChildElement(); xmlSubData != nullptr; xmlSubData = xmlSubData->getNextElement()) { - const String& cTag(xmlSubData->getTagName()); - String cText(xmlSubData->getAllSubText()); + const water::String& cTag(xmlSubData->getTagName()); + water::String cText(xmlSubData->getAllSubText()); /**/ if (cTag == "Key") { @@ -563,7 +548,7 @@ void CarlaStateSave::dumpToMemoryStream(MemoryOutputStream& content) const MemoryOutputStream infoXml; infoXml << " \n"; - infoXml << " " << String(type != nullptr ? type : "") << "\n"; + infoXml << " " << water::String(type != nullptr ? type : "") << "\n"; infoXml << " " << xmlSafeString(name, true) << "\n"; switch (pluginType) @@ -633,22 +618,22 @@ void CarlaStateSave::dumpToMemoryStream(MemoryOutputStream& content) const dataXml << " " << (active ? "Yes" : "No") << "\n"; if (carla_isNotEqual(dryWet, 1.0f)) - dataXml << " " << String(dryWet, 7) << "\n"; + dataXml << " " << water::String(dryWet, 7) << "\n"; if (carla_isNotEqual(volume, 1.0f)) - dataXml << " " << String(volume, 7) << "\n"; + dataXml << " " << water::String(volume, 7) << "\n"; if (carla_isNotEqual(balanceLeft, -1.0f)) - dataXml << " " << String(balanceLeft, 7) << "\n"; + dataXml << " " << water::String(balanceLeft, 7) << "\n"; if (carla_isNotEqual(balanceRight, 1.0f)) - dataXml << " " << String(balanceRight, 7) << "\n"; + dataXml << " " << water::String(balanceRight, 7) << "\n"; if (carla_isNotEqual(panning, 0.0f)) - dataXml << " " << String(panning, 7) << "\n"; + dataXml << " " << water::String(panning, 7) << "\n"; if (ctrlChannel < 0) dataXml << " N\n"; else dataXml << " " << int(ctrlChannel+1) << "\n"; - dataXml << " 0x" << String::toHexString(static_cast(options)) << "\n"; + dataXml << " 0x" << water::String::toHexString(static_cast(options)) << "\n"; content << dataXml; } @@ -663,7 +648,7 @@ void CarlaStateSave::dumpToMemoryStream(MemoryOutputStream& content) const parameterXml << "\n"; parameterXml << " \n"; - parameterXml << " " << String(stateParameter->index) << "\n"; + parameterXml << " " << water::String(stateParameter->index) << "\n"; parameterXml << " " << xmlSafeString(stateParameter->name, true) << "\n"; if (stateParameter->symbol != nullptr && stateParameter->symbol[0] != '\0') @@ -682,8 +667,8 @@ void CarlaStateSave::dumpToMemoryStream(MemoryOutputStream& content) const if (stateParameter->mappedRangeValid) { - parameterXml << " " << String(stateParameter->mappedMinimum, 15) << "\n"; - parameterXml << " " << String(stateParameter->mappedMaximum, 15) << "\n"; + parameterXml << " " << water::String(stateParameter->mappedMinimum, 15) << "\n"; + parameterXml << " " << water::String(stateParameter->mappedMaximum, 15) << "\n"; } // backwards compatibility for older carla versions @@ -693,7 +678,7 @@ void CarlaStateSave::dumpToMemoryStream(MemoryOutputStream& content) const #endif if (! stateParameter->dummy) - parameterXml << " " << String(stateParameter->value, 15) << "\n"; + parameterXml << " " << water::String(stateParameter->value, 15) << "\n"; parameterXml << " \n"; @@ -703,7 +688,7 @@ void CarlaStateSave::dumpToMemoryStream(MemoryOutputStream& content) const if (currentProgramIndex >= 0 && currentProgramName != nullptr && currentProgramName[0] != '\0') { // ignore 'default' program - if (currentProgramIndex > 0 || ! String(currentProgramName).equalsIgnoreCase("default")) + if (currentProgramIndex > 0 || ! water::String(currentProgramName).equalsIgnoreCase("default")) { MemoryOutputStream programXml; diff --git a/source/utils/CarlaStateUtils.hpp b/source/utils/CarlaStateUtils.hpp index 2fc74bd3c..a420635ac 100644 --- a/source/utils/CarlaStateUtils.hpp +++ b/source/utils/CarlaStateUtils.hpp @@ -1,19 +1,5 @@ -/* - * Carla State utils - * Copyright (C) 2012-2023 Filipe Coelho - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * For a full copy of the GNU General Public License see the doc/GPL.txt file. - */ +// SPDX-FileCopyrightText: 2011-2025 Filipe Coelho +// SPDX-License-Identifier: GPL-2.0-or-later #ifndef CARLA_STATE_UTILS_HPP_INCLUDED #define CARLA_STATE_UTILS_HPP_INCLUDED