Browse Source

Fix mini variant param message for non-english locales

Signed-off-by: falkTX <falktx@falktx.com>
tags/23.02
falkTX 2 years ago
parent
commit
daf8d467f7
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
2 changed files with 10 additions and 2 deletions
  1. +5
    -1
      src/CardinalPlugin.cpp
  2. +5
    -1
      src/CardinalRemote.cpp

+ 5
- 1
src/CardinalPlugin.cpp 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,);


+ 5
- 1
src/CardinalRemote.cpp 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);


Loading…
Cancel
Save