@@ -903,14 +903,16 @@ public: | |||||
else | else | ||||
max = 1.0f; | 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; | max = min + 0.1f; | ||||
} | } | ||||
@@ -922,14 +924,6 @@ public: | |||||
else if (def > max) | else if (def > max) | ||||
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)) | if (LADSPA_IS_HINT_TOGGLED(portRangeHints.HintDescriptor)) | ||||
{ | { | ||||
step = max - min; | step = max - min; | ||||
@@ -609,14 +609,16 @@ public: | |||||
else | else | ||||
max = 1.0f; | 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; | max = min + 0.1f; | ||||
} | } | ||||
@@ -631,14 +633,6 @@ public: | |||||
else if (def > max) | else if (def > max) | ||||
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)) | if (LADSPA_IS_HINT_TOGGLED(portRangeHints.HintDescriptor)) | ||||
{ | { | ||||
step = max - min; | step = max - min; | ||||
@@ -2079,8 +2079,12 @@ public: | |||||
else | else | ||||
max = 1.0f; | 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) | // 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) | 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; | 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; | max = min + 0.1f; | ||||
} | } | ||||
@@ -2114,14 +2118,6 @@ public: | |||||
else if (def > max) | else if (def > max) | ||||
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)) | if (LV2_IS_PORT_TOGGLED(portProps)) | ||||
{ | { | ||||
step = max - min; | step = max - min; | ||||