diff options
author | Robin Gareus <robin@gareus.org> | 2016-01-07 21:05:14 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-01-07 21:05:14 +0100 |
commit | 085ffef1066921e4f9496c2d095f0a2dc1c69b42 (patch) | |
tree | 8a34a639d512919c4cbda2f86c1d406eb43ad113 /libs/ardour/ladspa_plugin.cc | |
parent | b7e06693be1091256e9538c5c4f6f642f09b1335 (diff) |
LADSPA preset discovery
Diffstat (limited to 'libs/ardour/ladspa_plugin.cc')
-rw-r--r-- | libs/ardour/ladspa_plugin.cc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/libs/ardour/ladspa_plugin.cc b/libs/ardour/ladspa_plugin.cc index 88f40c1f84..6ec0723248 100644 --- a/libs/ardour/ladspa_plugin.cc +++ b/libs/ardour/ladspa_plugin.cc @@ -738,6 +738,29 @@ LadspaPluginInfo::load (Session& session) } } +std::vector<Plugin::PresetRecord> +LadspaPluginInfo::get_presets(Session& session) +{ + std::vector<Plugin::PresetRecord> p; +#if (defined HAVE_LRDF && !defined NO_PLUGIN_STATE) + if (!isdigit (unique_id[0])) { + return p; + } + uint32_t id = atol (unique_id); + lrdf_uris* set_uris = lrdf_get_setting_uris(id); + + if (set_uris) { + for (uint32_t i = 0; i < (uint32_t) set_uris->count; ++i) { + if (char* label = lrdf_get_label (set_uris->items[i])) { + p.push_back (Plugin::PresetRecord (set_uris->items[i], label)); + } + } + lrdf_free_uris(set_uris); + } +#endif + return p; +} + LadspaPluginInfo::LadspaPluginInfo() { type = ARDOUR::LADSPA; |