DPF

DISTRHO Plugin Framework
Log | Files | Refs | Submodules | README | LICENSE

commit b214c2bd527843c95ce8bce6802df4c7e051eb05
parent 485832aff30132f2e8139719c96a97057aa0fe62
Author: falkTX <falktx@falktx.com>
Date:   Fri, 11 Feb 2022 01:36:28 +0000

Fix lv2 presets with host readable state

Signed-off-by: falkTX <falktx@falktx.com>

Diffstat:
Mdistrho/src/DistrhoPluginLV2export.cpp | 13++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)

diff --git 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";