From dd092c74aa28f626108f6d3a52c565cb9047d32d Mon Sep 17 00:00:00 2001 From: falkTX Date: Thu, 7 Sep 2023 11:10:34 +0200 Subject: [PATCH] Fix some wine bridge details Signed-off-by: falkTX --- source/backend/plugin/CarlaPluginBridge.cpp | 42 ++++++++++--------- .../frontend/pluginlist/pluginlistdialog.cpp | 2 + 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/source/backend/plugin/CarlaPluginBridge.cpp b/source/backend/plugin/CarlaPluginBridge.cpp index 9dda057ee..499bf1871 100644 --- a/source/backend/plugin/CarlaPluginBridge.cpp +++ b/source/backend/plugin/CarlaPluginBridge.cpp @@ -324,7 +324,7 @@ protected: if (fWinePrefix.isNotEmpty()) { carla_setenv("WINEDEBUG", "-all"); - carla_setenv("WINEPREFIX", fWinePrefix.toRawUTF8()); + carla_setenv("WINEPREFIX", fWinePrefix.buffer()); if (options.wine.rtPrio) { @@ -341,7 +341,7 @@ protected: carla_setenv("WINE_SVR_RT", strBuf); carla_stdout("Using WINEPREFIX '%s', with base RT prio %i and server RT prio %i", - fWinePrefix.toRawUTF8(), options.wine.baseRtPrio, options.wine.serverRtPrio); + fWinePrefix.buffer(), options.wine.baseRtPrio, options.wine.serverRtPrio); } else { @@ -353,7 +353,7 @@ protected: carla_unsetenv("WINE_RT_PRIO"); carla_unsetenv("WINE_SVR_RT"); - carla_stdout("Using WINEPREFIX '%s', without RT priorities", fWinePrefix.toRawUTF8()); + carla_stdout("Using WINEPREFIX '%s', without RT priorities", fWinePrefix.buffer()); } } #endif @@ -430,7 +430,7 @@ private: String fLabel; String fShmIds; #ifndef CARLA_OS_WIN - String fWinePrefix; + CarlaString fWinePrefix; #endif CarlaScopedPointer fProcess; @@ -2538,15 +2538,15 @@ public: if (fBinaryType == BINARY_WIN32 || fBinaryType == BINARY_WIN64) { const StringArray driveLetterSplit(StringArray::fromTokens(realBigValueFilePath, ":/", "")); - carla_stdout("big value save path BEFORE => %s", realBigValueFilePath.toRawUTF8()); + carla_stdout("big value save path BEFORE => '%s' | using wineprefix '%s'", realBigValueFilePath.toRawUTF8(), fWinePrefix.buffer()); - realBigValueFilePath = fWinePrefix; + realBigValueFilePath = fWinePrefix.buffer(); realBigValueFilePath += "/drive_"; realBigValueFilePath += driveLetterSplit[0].toLowerCase(); realBigValueFilePath += driveLetterSplit[1]; realBigValueFilePath = realBigValueFilePath.replace("\\", "/"); - carla_stdout("big value save path AFTER => %s", realBigValueFilePath.toRawUTF8()); + carla_stdout("big value save path AFTER => '%s'", realBigValueFilePath.toRawUTF8()); } #endif @@ -2579,15 +2579,15 @@ public: if (fBinaryType == BINARY_WIN32 || fBinaryType == BINARY_WIN64) { const StringArray driveLetterSplit(StringArray::fromTokens(realChunkFilePath, ":/", "")); - carla_stdout("chunk save path BEFORE => %s", realChunkFilePath.toRawUTF8()); + carla_stdout("chunk save path BEFORE => '%s' | using wineprefix '%s'", realChunkFilePath.toRawUTF8(), fWinePrefix.buffer()); - realChunkFilePath = fWinePrefix; + realChunkFilePath = fWinePrefix.buffer(); realChunkFilePath += "/drive_"; realChunkFilePath += driveLetterSplit[0].toLowerCase(); realChunkFilePath += driveLetterSplit[1]; realChunkFilePath = realChunkFilePath.replace("\\", "/"); - carla_stdout("chunk save path AFTER => %s", realChunkFilePath.toRawUTF8()); + carla_stdout("chunk save path AFTER => '%s'", realChunkFilePath.toRawUTF8()); } #endif @@ -2764,20 +2764,24 @@ public: { const EngineOptions& engineOptions(pData->engine->getOptions()); + water::String winePrefix; + if (engineOptions.wine.autoPrefix) - fWinePrefix = findWinePrefix(pData->filename); + winePrefix = findWinePrefix(pData->filename); - if (fWinePrefix.isEmpty()) + if (winePrefix.isEmpty()) { const char* const envWinePrefix = std::getenv("WINEPREFIX"); if (envWinePrefix != nullptr && envWinePrefix[0] != '\0') - fWinePrefix = envWinePrefix; + winePrefix = envWinePrefix; else if (engineOptions.wine.fallbackPrefix != nullptr && engineOptions.wine.fallbackPrefix[0] != '\0') - fWinePrefix = engineOptions.wine.fallbackPrefix; + winePrefix = engineOptions.wine.fallbackPrefix; else - fWinePrefix = File::getSpecialLocation(File::userHomeDirectory).getFullPathName() + "/.wine"; + winePrefix = File::getSpecialLocation(File::userHomeDirectory).getFullPathName() + "/.wine"; } + + fWinePrefix = winePrefix.toRawUTF8(); } #endif @@ -2794,9 +2798,9 @@ public: std::strncpy(shmIdsStr+6*3, &fShmNonRtServerControl.filename[fShmNonRtServerControl.filename.length()-6], 6); fBridgeThread.setData( -#ifndef CARLA_OS_WIN - fWinePrefix.toRawUTF8(), -#endif + #ifndef CARLA_OS_WIN + fWinePrefix, + #endif binaryArchName, bridgeBinary, label, shmIdsStr); } @@ -2917,7 +2921,7 @@ private: BridgeNonRtServerControl fShmNonRtServerControl; #ifndef CARLA_OS_WIN - String fWinePrefix; + CarlaString fWinePrefix; #endif class ReceivingParamText { diff --git a/source/frontend/pluginlist/pluginlistdialog.cpp b/source/frontend/pluginlist/pluginlistdialog.cpp index 970e51f14..6d94e41eb 100644 --- a/source/frontend/pluginlist/pluginlistdialog.cpp +++ b/source/frontend/pluginlist/pluginlistdialog.cpp @@ -341,6 +341,7 @@ struct PluginPaths { { vst2 += ":" + winePrefix + "/drive_c/Program Files/VstPlugins"; vst2 += ":" + winePrefix + "/drive_c/Program Files/Steinberg/VstPlugins"; + vst2 += ":" + winePrefix + "/drive_c/Program Files/Common Files/VST2"; vst3 += ":" + winePrefix + "/drive_c/Program Files/Common Files/VST3"; clap += ":" + winePrefix + "/drive_c/Program Files/Common Files/CLAP"; @@ -349,6 +350,7 @@ struct PluginPaths { { vst2 += ":" + winePrefix + "/drive_c/Program Files (x86)/VstPlugins"; vst2 += ":" + winePrefix + "/drive_c/Program Files (x86)/Steinberg/VstPlugins"; + vst2 += ":" + winePrefix + "/drive_c/Program Files (x86)/Common Files/VST2"; vst3 += ":" + winePrefix + "/drive_c/Program Files (x86)/Common Files/VST3"; clap += ":" + winePrefix + "/drive_c/Program Files (x86)/Common Files/CLAP"; }