From fc988428bc6a5b2f84c10d903b3e15fe91003f79 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 19 Mar 2016 16:36:44 +0100 Subject: fix plugin preset listing --- libs/ardour/plugin.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libs') 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::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::const_iterator pr = _presets.find (uri); if (pr != _presets.end()) { return &pr->second; -- cgit v1.2.3