diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2008-04-24 21:50:33 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2008-04-24 21:50:33 +0000 |
commit | c38707ba6190980ffc1d94a2170a941ae72bd4ee (patch) | |
tree | 0de14728ee75769bb59272401ebd8627ce1fb060 /gtk2_ardour/plugin_selector.cc | |
parent | 7d765bd2073f34beabbf8b94a8627d962b4cee43 (diff) |
properly sort plugin menus
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3286 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/plugin_selector.cc')
-rw-r--r-- | gtk2_ardour/plugin_selector.cc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gtk2_ardour/plugin_selector.cc b/gtk2_ardour/plugin_selector.cc index 41bcd18af1..f812ac0f39 100644 --- a/gtk2_ardour/plugin_selector.cc +++ b/gtk2_ardour/plugin_selector.cc @@ -452,6 +452,24 @@ PluginSelector::on_show () filter_entry.grab_focus (); } +struct PluginMenuCompare { + bool operator() (PluginInfoPtr a, PluginInfoPtr b) const { + int cmp; + + cmp = strcasecmp (a->creator.c_str(), b->creator.c_str()); + + if (cmp < 0) { + return true; + } else if (cmp == 0) { + /* same creator ... compare names */ + if (strcasecmp (a->name.c_str(), b->name.c_str()) < 0) { + return true; + } + } + return false; + } +}; + Gtk::Menu& PluginSelector::plugin_menu() { @@ -485,6 +503,9 @@ PluginSelector::plugin_menu() all_plugs.insert (all_plugs.end(), manager->lv2_plugin_info().begin(), manager->lv2_plugin_info().end()); #endif + PluginMenuCompare cmp; + all_plugs.sort (cmp); + for (PluginInfoList::const_iterator i = all_plugs.begin(); i != all_plugs.end(); ++i) { SubmenuMap::iterator x; Gtk::Menu* submenu; |