From 09ca375e157aef1b81997fe8b80fb9828bfd6351 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 31 Jan 2018 14:02:44 +0100 Subject: Allow to filter tags by hidden + favorite This in preparation to not populate context-menus with unused tags. --- libs/ardour/plugin_manager.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'libs/ardour/plugin_manager.cc') diff --git a/libs/ardour/plugin_manager.cc b/libs/ardour/plugin_manager.cc index d48fe8cd15..4b396da489 100644 --- a/libs/ardour/plugin_manager.cc +++ b/libs/ardour/plugin_manager.cc @@ -1650,7 +1650,7 @@ PluginManager::sanitize_tag (const std::string to_sanitize) const } std::vector -PluginManager::get_all_tags (bool favorites_only) const +PluginManager::get_all_tags (TagFilter tag_filter) const { std::vector ret; @@ -1661,7 +1661,7 @@ PluginManager::get_all_tags (bool favorites_only) const } /* if favorites_only then we need to check the info ptr and maybe skip */ - if (favorites_only) { + if (tag_filter == OnlyFavorites) { PluginStatus stat ((*pt).type, (*pt).unique_id); PluginStatusList::const_iterator i = find (statuses.begin(), statuses.end(), stat); if ((i != statuses.end()) && (i->status == Favorite)) { @@ -1670,6 +1670,13 @@ PluginManager::get_all_tags (bool favorites_only) const continue; } } + if (tag_filter == NoHidden) { + PluginStatus stat ((*pt).type, (*pt).unique_id); + PluginStatusList::const_iterator i = find (statuses.begin(), statuses.end(), stat); + if ((i != statuses.end()) && (i->status == Hidden)) { + continue; + } + } /* parse each plugin's tag string into separate tags */ vector tags; -- cgit v1.2.3