13
0

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
This commit is contained in:
Carl Hetherington 2011-11-21 22:38:44 +00:00
parent 322684b94f
commit 6de0f8a8a8

View File

@ -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;