Fix mini variant param message for non-english locales

Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
falkTX 2022-12-30 15:52:52 +00:00
parent c883a9db68
commit daf8d467f7
No known key found for this signature in database
GPG key ID: CDBAA37ABC74FBA0
2 changed files with 10 additions and 2 deletions

View file

@ -44,6 +44,7 @@
#include "DistrhoPluginUtils.hpp"
#include "PluginContext.hpp"
#include "extra/Base64.hpp"
#include "extra/ScopedSafeLocale.hpp"
#ifdef DISTRHO_OS_WASM
# include <emscripten/emscripten.h>
@ -841,7 +842,10 @@ protected:
long long moduleId = 0;
int paramId = 0;
float paramValue = 0.f;
std::sscanf(value, "%lld:%d:%f", &moduleId, &paramId, &paramValue);
{
const ScopedSafeLocale cssl;
std::sscanf(value, "%lld:%d:%f", &moduleId, &paramId, &paramValue);
}
rack::engine::Module* const module = context->engine->getModule(moduleId);
DISTRHO_SAFE_ASSERT_RETURN(module != nullptr,);

View file

@ -26,6 +26,7 @@
#include "CardinalRemote.hpp"
#include "PluginContext.hpp"
#include "extra/Base64.hpp"
#include "extra/ScopedSafeLocale.hpp"
#if defined(STATIC_BUILD) || CARDINAL_VARIANT_MINI
# undef HAVE_LIBLO
@ -139,7 +140,10 @@ void sendParamChangeToRemote(RemoteDetails* const remote, int64_t moduleId, int
{
#if CARDINAL_VARIANT_MINI
char paramBuf[512] = {};
std::snprintf(paramBuf, sizeof(paramBuf), "%lld:%d:%f", (long long)moduleId, paramId, value);
{
const ScopedSafeLocale cssl;
std::snprintf(paramBuf, sizeof(paramBuf), "%lld:%d:%f", (long long)moduleId, paramId, value);
}
static_cast<CardinalBaseUI*>(remote->handle)->setState("param", paramBuf);
#elif defined(HAVE_LIBLO)
const lo_address addr = lo_address_new_with_proto(LO_UDP, REMOTE_HOST, CARDINAL_DEFAULT_REMOTE_HOST_PORT);