From 7fcb50cc7bab50779d14a5b3e7ea8ddf415c6e67 Mon Sep 17 00:00:00 2001 From: falkTX Date: Fri, 11 Feb 2022 01:36:55 +0000 Subject: [PATCH] Fix lv2 presets with host readable state Signed-off-by: falkTX --- distrho/src/DistrhoPluginLV2export.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/distrho/src/DistrhoPluginLV2export.cpp b/distrho/src/DistrhoPluginLV2export.cpp index e1e0fc65..9878e5eb 100644 --- a/distrho/src/DistrhoPluginLV2export.cpp +++ b/distrho/src/DistrhoPluginLV2export.cpp @@ -429,10 +429,10 @@ void lv2_generate_ttl(const char* const basename) continue; const String& key(plugin.getStateKey(i)); - pluginString += " patch:readable <" DISTRHO_PLUGIN_URI "#" + key + ">;\n"; + pluginString += " patch:readable <" DISTRHO_PLUGIN_URI "#" + key + "> ;\n"; if ((hints & kStateIsHostWritable) == kStateIsHostWritable) - pluginString += " patch:writable <" DISTRHO_PLUGIN_URI "#" + key + ">;\n"; + pluginString += " patch:writable <" DISTRHO_PLUGIN_URI "#" + key + "> ;\n"; } pluginString += "\n"; } @@ -1293,7 +1293,14 @@ void lv2_generate_ttl(const char* const basename) const String key = plugin.getStateKey(j); const String value = plugin.getStateValue(key); - presetString += " <" DISTRHO_PLUGIN_LV2_STATE_PREFIX + key + ">"; + presetString += " <"; + + if (plugin.getStateHints(i) & kStateIsHostReadable) + presetString += DISTRHO_PLUGIN_URI "#"; + else + presetString += DISTRHO_PLUGIN_LV2_STATE_PREFIX; + + presetString += key + ">"; if (value.length() < 10) presetString += " \"" + value + "\" ;\n";