Browse Source

Export LV2 scalePoint for integer ports as integer values not float (#195)

* Export LV2 scalePoint for integer ports as integer values not float

Signed-off-by: Christopher Arndt <chris@chrisarndt.de>

* Round int scale point value instead of truncating

Signed-off-by: Christopher Arndt <chris@chrisarndt.de>

* Name roundedValue properly and make it const

Signed-off-by: Christopher Arndt <chris@chrisarndt.de>
pull/196/head
Christopher Arndt Filipe Coelho <falktx@gmail.com> 5 years ago
parent
commit
30ba386bc6
1 changed files with 8 additions and 1 deletions
  1. +8
    -1
      distrho/src/DistrhoPluginLV2export.cpp

+ 8
- 1
distrho/src/DistrhoPluginLV2export.cpp View File

@@ -561,7 +561,14 @@ void lv2_generate_ttl(const char* const basename)
pluginString += " [\n";

pluginString += " rdfs:label \"\"\"" + enumValue.label + "\"\"\" ;\n";
pluginString += " rdf:value " + String(enumValue.value) + " ;\n";

if (plugin.getParameterHints(i) & kParameterIsInteger) {
const int roundedValue = (int)(enumValue.value + 0.5f);
pluginString += " rdf:value " + String(roundedValue) + " ;\n";
}
else {
pluginString += " rdf:value " + String(enumValue.value) + " ;\n";
}

if (j+1 == enumValues.count)
pluginString += " ] ;\n\n";


Loading…
Cancel
Save