From 7f45300366ee3c101cd6986f833ac7f32b42051a Mon Sep 17 00:00:00 2001 From: falkTX Date: Fri, 29 Sep 2023 19:29:33 +0200 Subject: [PATCH] Fix last commit, also fix non-english locales for clap Signed-off-by: falkTX --- distrho/src/DistrhoPluginCLAP.cpp | 10 ++++++++++ distrho/src/DistrhoPluginVST3.cpp | 1 + 2 files changed, 11 insertions(+) diff --git a/distrho/src/DistrhoPluginCLAP.cpp b/distrho/src/DistrhoPluginCLAP.cpp index 1d366205..7ee7dc25 100644 --- a/distrho/src/DistrhoPluginCLAP.cpp +++ b/distrho/src/DistrhoPluginCLAP.cpp @@ -1214,9 +1214,14 @@ public: } if (isInteger) + { *value = std::atoi(display); + } else + { + const ScopedSafeLocale ssl; *value = std::atof(display); + } return true; } @@ -1673,9 +1678,14 @@ public: continue; if (fPlugin.getParameterHints(j) & kParameterIsInteger) + { fvalue = std::atoi(value.buffer()); + } else + { + const ScopedSafeLocale ssl; fvalue = std::atof(value.buffer()); + } fCachedParameters.values[j] = fvalue; #if DISTRHO_PLUGIN_HAS_UI diff --git a/distrho/src/DistrhoPluginVST3.cpp b/distrho/src/DistrhoPluginVST3.cpp index ae1a51dd..9dcbd58c 100644 --- a/distrho/src/DistrhoPluginVST3.cpp +++ b/distrho/src/DistrhoPluginVST3.cpp @@ -962,6 +962,7 @@ public: if (read == 0) return empty ? V3_INVALID_ARG : V3_OK; + empty = false; for (int32_t i = 0; i < read; ++i) { // found terminator, stop here