summaryrefslogtreecommitdiff
path: root/gtk2_ardour/group_tabs.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-11-21 22:38:44 +0000
committerCarl Hetherington <carl@carlh.net>2011-11-21 22:38:44 +0000
commit6de0f8a8a8348b502344bbd3a50b8c54f4d7afaf (patch)
tree42ad67654ce04479c417d0acb5cd838f0288339a /gtk2_ardour/group_tabs.cc
parent322684b94f94d84268592341ff30a09cc7468f5d (diff)
Sort session routes before trying to do the group tabs
collection; should fix #4500. git-svn-id: svn://localhost/ardour2/branches/3.0@10749 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/group_tabs.cc')
-rw-r--r--gtk2_ardour/group_tabs.cc16
1 files changed, 14 insertions, 2 deletions
diff --git a/gtk2_ardour/group_tabs.cc b/gtk2_ardour/group_tabs.cc
index c1b6e5142d..08dfe539a2 100644
--- a/gtk2_ardour/group_tabs.cc
+++ b/gtk2_ardour/group_tabs.cc
@@ -432,13 +432,24 @@ GroupTabs::subgroup (RouteGroup* g, bool aux, Placement placement)
}
struct CollectSorter {
- CollectSorter (std::string const & key) : _key (key) {}
+ CollectSorter (string const & key) : _key (key) {}
bool operator () (boost::shared_ptr<Route> a, boost::shared_ptr<Route> b) {
return a->order_key (_key) < b->order_key (_key);
}
- std::string _key;
+ string _key;
+};
+
+struct OrderSorter {
+ OrderSorter (string const & key) : _key (key) {}
+
+ bool operator() (boost::shared_ptr<Route> a, boost::shared_ptr<Route> b) {
+ /* use of ">" forces the correct sort order */
+ return a->order_key (_key) < b->order_key (_key);
+ }
+
+ string _key;
};
/** Collect all members of a RouteGroup so that they are together in the Editor or Mixer.
@@ -453,6 +464,7 @@ GroupTabs::collect (RouteGroup* g)
RouteList::iterator i = group_routes->begin ();
boost::shared_ptr<RouteList> routes = _session->get_routes ();
+ routes->sort (OrderSorter (order_key ()));
RouteList::const_iterator j = routes->begin ();
int diff = 0;