Skip to content

Commit

Permalink
Fix ttl export for program names with double-quotes
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <[email protected]>
  • Loading branch information
falkTX committed Oct 15, 2023
1 parent 92b0f83 commit b238d8d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion distrho/src/DistrhoPluginLV2export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,10 +328,17 @@ void lv2_generate_ttl(const char* const basename)
{
std::snprintf(strBuf, 0xff, "%03i", i+1);

const String& programName(plugin.getProgramName(i));

presetString = "<" DISTRHO_PLUGIN_URI + presetSeparator + "preset" + strBuf + ">\n";
presetString += " a pset:Preset ;\n";
presetString += " lv2:appliesTo <" DISTRHO_PLUGIN_URI "> ;\n";
presetString += " rdfs:label \"" + plugin.getProgramName(i) + "\" ;\n";

if (programName.contains('"'))
presetString += " rdfs:label\"\"\"" + programName + "\"\"\" ;\n";
else
presetString += " rdfs:label \"" + programName + "\" ;\n";

presetString += " rdfs:seeAlso <presets.ttl> .\n";
presetString += "\n";

Expand Down

0 comments on commit b238d8d

Please sign in to comment.