diff --git a/source/backend/plugin/CarlaPluginDSSI.cpp b/source/backend/plugin/CarlaPluginDSSI.cpp index 6064d1ccc..3896de032 100644 --- a/source/backend/plugin/CarlaPluginDSSI.cpp +++ b/source/backend/plugin/CarlaPluginDSSI.cpp @@ -903,14 +903,16 @@ public: else max = 1.0f; - if (min > max) + if (LADSPA_IS_HINT_SAMPLE_RATE(portRangeHints.HintDescriptor)) { - carla_stderr2("WARNING - Broken plugin parameter '%s': min > max", paramName); - min = max - 0.1f; + min *= sampleRate; + max *= sampleRate; + pData->param.data[j].hints |= PARAMETER_USES_SAMPLERATE; } - else if (carla_isEqual(min, max)) + + if (min >= max) { - carla_stderr2("WARNING - Broken plugin parameter '%s': min == max", paramName); + carla_stderr2("WARNING - Broken plugin parameter '%s': min >= max", paramName); max = min + 0.1f; } @@ -922,14 +924,6 @@ public: else if (def > max) def = max; - if (LADSPA_IS_HINT_SAMPLE_RATE(portRangeHints.HintDescriptor)) - { - min *= sampleRate; - max *= sampleRate; - def *= sampleRate; - pData->param.data[j].hints |= PARAMETER_USES_SAMPLERATE; - } - if (LADSPA_IS_HINT_TOGGLED(portRangeHints.HintDescriptor)) { step = max - min; diff --git a/source/backend/plugin/CarlaPluginLADSPA.cpp b/source/backend/plugin/CarlaPluginLADSPA.cpp index 863c377a5..2bc68f75f 100644 --- a/source/backend/plugin/CarlaPluginLADSPA.cpp +++ b/source/backend/plugin/CarlaPluginLADSPA.cpp @@ -609,14 +609,16 @@ public: else max = 1.0f; - if (min > max) + if (LADSPA_IS_HINT_SAMPLE_RATE(portRangeHints.HintDescriptor)) { - carla_stderr2("WARNING - Broken plugin parameter '%s': min > max", paramName); - min = max - 0.1f; + min *= sampleRate; + max *= sampleRate; + pData->param.data[j].hints |= PARAMETER_USES_SAMPLERATE; } - else if (carla_isEqual(min, max)) + + if (min >= max) { - carla_stderr2("WARNING - Broken plugin parameter '%s': min == max", paramName); + carla_stderr2("WARNING - Broken plugin parameter '%s': min >= max", paramName); max = min + 0.1f; } @@ -631,14 +633,6 @@ public: else if (def > max) def = max; - if (LADSPA_IS_HINT_SAMPLE_RATE(portRangeHints.HintDescriptor)) - { - min *= sampleRate; - max *= sampleRate; - def *= sampleRate; - pData->param.data[j].hints |= PARAMETER_USES_SAMPLERATE; - } - if (LADSPA_IS_HINT_TOGGLED(portRangeHints.HintDescriptor)) { step = max - min; diff --git a/source/backend/plugin/CarlaPluginLV2.cpp b/source/backend/plugin/CarlaPluginLV2.cpp index cc08850fb..2bc36f1b3 100644 --- a/source/backend/plugin/CarlaPluginLV2.cpp +++ b/source/backend/plugin/CarlaPluginLV2.cpp @@ -2079,8 +2079,12 @@ public: else max = 1.0f; - if (min > max) - max = min; + if (LV2_IS_PORT_SAMPLE_RATE(portProps)) + { + min *= sampleRate; + max *= sampleRate; + pData->param.data[j].hints |= PARAMETER_USES_SAMPLERATE; + } // stupid hack for ir.lv2 (broken plugin) if (std::strcmp(fRdfDescriptor->URI, "http://factorial.hu/plugins/lv2/ir") == 0 && std::strncmp(fRdfDescriptor->Ports[i].Name, "FileHash", 8) == 0) @@ -2089,9 +2093,9 @@ public: max = (float)0xffffff; } - if (carla_isEqual(min, max)) + if (min >= max) { - carla_stderr2("WARNING - Broken plugin parameter '%s': max == min", fRdfDescriptor->Ports[i].Name); + carla_stderr2("WARNING - Broken plugin parameter '%s': min >= max", fRdfDescriptor->Ports[i].Name); max = min + 0.1f; } @@ -2114,14 +2118,6 @@ public: else if (def > max) def = max; - if (LV2_IS_PORT_SAMPLE_RATE(portProps)) - { - min *= sampleRate; - max *= sampleRate; - def *= sampleRate; - pData->param.data[j].hints |= PARAMETER_USES_SAMPLERATE; - } - if (LV2_IS_PORT_TOGGLED(portProps)) { step = max - min;