diff --git a/source/modules/distrho/src/DistrhoPluginCarla.cpp b/source/modules/distrho/src/DistrhoPluginCarla.cpp index 3b50cd3e4..a0d5bb769 100644 --- a/source/modules/distrho/src/DistrhoPluginCarla.cpp +++ b/source/modules/distrho/src/DistrhoPluginCarla.cpp @@ -183,7 +183,8 @@ class PluginCarla : public NativePluginClass public: PluginCarla(const NativeHostDescriptor* const host) : NativePluginClass(host), - fPlugin(this, writeMidiCallback) + fPlugin(this, writeMidiCallback), + fScalePointsCache(nullptr) { #if DISTRHO_PLUGIN_HAS_UI fUiPtr = nullptr; @@ -199,6 +200,12 @@ public: fUiPtr = nullptr; } #endif + + if (fScalePointsCache != nullptr) + { + delete[] fScalePointsCache; + fScalePointsCache = nullptr; + } } protected: @@ -248,6 +255,32 @@ protected: param.ranges.max = ranges.max; } + { + const ParameterEnumerationValues& enumValues(fPlugin.getParameterEnumValues(index)); + + if (const uint32_t scalePointCount = enumValues.count) + { + NativeParameterScalePoint* const scalePoints = new NativeParameterScalePoint[scalePointCount]; + + for (uint32_t i=0; i(param.hints|::NATIVE_PARAMETER_USES_SCALEPOINTS); + } + else if (fScalePointsCache != nullptr) + { + delete[] fScalePointsCache; + fScalePointsCache = nullptr; + } + } + return ¶m; } @@ -448,6 +481,7 @@ protected: private: PluginExporter fPlugin; + mutable NativeParameterScalePoint* fScalePointsCache; #if DISTRHO_PLUGIN_HAS_UI // UI diff --git a/source/native-plugins/external b/source/native-plugins/external index ad2d6be37..5d5dc0b39 160000 --- a/source/native-plugins/external +++ b/source/native-plugins/external @@ -1 +1 @@ -Subproject commit ad2d6be378be8ec978b5221bdc5646103db98e9c +Subproject commit 5d5dc0b39e87a7fabd678e6d698c66d6e03e30ce