diff options
author | Robin Gareus <robin@gareus.org> | 2016-03-19 16:36:44 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-03-19 16:41:59 +0100 |
commit | fc988428bc6a5b2f84c10d903b3e15fe91003f79 (patch) | |
tree | a8a72bbd717991acdd76733f35f4d56122dd46bf | |
parent | e41d4e82480d993778a162cb9a76d2b41cbfc549 (diff) |
fix plugin preset listing
-rw-r--r-- | libs/ardour/plugin.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libs/ardour/plugin.cc b/libs/ardour/plugin.cc index 93ef60e639..4bb5b02c77 100644 --- a/libs/ardour/plugin.cc +++ b/libs/ardour/plugin.cc @@ -260,6 +260,12 @@ Plugin::input_streams () const const Plugin::PresetRecord * Plugin::preset_by_label (const string& label) { +#ifndef NO_PLUGIN_STATE + if (!_have_presets) { + find_presets (); + _have_presets = true; + } +#endif // FIXME: O(n) for (map<string, PresetRecord>::const_iterator i = _presets.begin(); i != _presets.end(); ++i) { if (i->second.label == label) { @@ -273,6 +279,12 @@ Plugin::preset_by_label (const string& label) const Plugin::PresetRecord * Plugin::preset_by_uri (const string& uri) { +#ifndef NO_PLUGIN_STATE + if (!_have_presets) { + find_presets (); + _have_presets = true; + } +#endif map<string, PresetRecord>::const_iterator pr = _presets.find (uri); if (pr != _presets.end()) { return &pr->second; |