diff options
author | Robin Gareus <robin@gareus.org> | 2018-01-31 14:02:44 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2018-01-31 14:02:44 +0100 |
commit | 09ca375e157aef1b81997fe8b80fb9828bfd6351 (patch) | |
tree | 41656c1bf93bfd7ae4e7c1a27e8f664bfbb2a901 /libs/ardour/plugin_manager.cc | |
parent | 17cdc8114c0efa568f4a2f6f5eefb43c747f3b0c (diff) |
Allow to filter tags by hidden + favorite
This in preparation to not populate context-menus with unused tags.
Diffstat (limited to 'libs/ardour/plugin_manager.cc')
-rw-r--r-- | libs/ardour/plugin_manager.cc | 11 |
1 files changed, 9 insertions, 2 deletions
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<std::string> -PluginManager::get_all_tags (bool favorites_only) const +PluginManager::get_all_tags (TagFilter tag_filter) const { std::vector<std::string> 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<string> tags; |