Browse Source

Fix VST3 usage with non-english locales

Signed-off-by: falkTX <falktx@falktx.com>
pull/432/head
falkTX 1 year ago
parent
commit
50a55c6ef4
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
2 changed files with 19 additions and 3 deletions
  1. +1
    -1
      distrho/extra/Runner.hpp
  2. +18
    -2
      distrho/src/DistrhoPluginVST3.cpp

+ 1
- 1
distrho/extra/Runner.hpp View File

@@ -114,7 +114,7 @@ public:
} }


/* /*
* Start the thread.
* Start the runner.
*/ */
bool startRunner(const uint timeIntervalMilliseconds = 0) noexcept bool startRunner(const uint timeIntervalMilliseconds = 0) noexcept
{ {


+ 18
- 2
distrho/src/DistrhoPluginVST3.cpp View File

@@ -1097,9 +1097,14 @@ public:
continue; continue;


if (fPlugin.getParameterHints(j) & kParameterIsInteger) if (fPlugin.getParameterHints(j) & kParameterIsInteger)
{
fvalue = std::atoi(value.buffer()); fvalue = std::atoi(value.buffer());
}
else else
{
const ScopedSafeLocale ssl;
fvalue = std::atof(value.buffer()); fvalue = std::atof(value.buffer());
}


fCachedParameterValues[kVst3InternalParameterBaseCount + j] = fvalue; fCachedParameterValues[kVst3InternalParameterBaseCount + j] = fvalue;
#if DISTRHO_PLUGIN_HAS_UI #if DISTRHO_PLUGIN_HAS_UI
@@ -1835,12 +1840,18 @@ public:
*output = static_cast<double>(std::atoi(ScopedUTF8String(input))) / DPF_VST3_MAX_BUFFER_SIZE; *output = static_cast<double>(std::atoi(ScopedUTF8String(input))) / DPF_VST3_MAX_BUFFER_SIZE;
return V3_OK; return V3_OK;
case kVst3InternalParameterSampleRate: case kVst3InternalParameterSampleRate:
*output = std::atof(ScopedUTF8String(input)) / DPF_VST3_MAX_SAMPLE_RATE;
{
const ScopedSafeLocale ssl;
*output = std::atof(ScopedUTF8String(input)) / DPF_VST3_MAX_SAMPLE_RATE;
}
return V3_OK; return V3_OK;
#endif #endif
#if DISTRHO_PLUGIN_WANT_LATENCY #if DISTRHO_PLUGIN_WANT_LATENCY
case kVst3InternalParameterLatency: case kVst3InternalParameterLatency:
*output = std::atof(ScopedUTF8String(input)) / DPF_VST3_MAX_LATENCY;
{
const ScopedSafeLocale ssl;
*output = std::atof(ScopedUTF8String(input)) / DPF_VST3_MAX_LATENCY;
}
return V3_OK; return V3_OK;
#endif #endif
#if DISTRHO_PLUGIN_WANT_PROGRAMS #if DISTRHO_PLUGIN_WANT_PROGRAMS
@@ -1885,9 +1896,14 @@ public:


float value; float value;
if (fPlugin.getParameterHints(index) & kParameterIsInteger) if (fPlugin.getParameterHints(index) & kParameterIsInteger)
{
value = std::atoi(input8); value = std::atoi(input8);
}
else else
{
const ScopedSafeLocale ssl;
value = std::atof(input8); value = std::atof(input8);
}


*output = ranges.getNormalizedValue(value); *output = ranges.getNormalizedValue(value);
return V3_OK; return V3_OK;


Loading…
Cancel
Save