summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/group_tabs.cc16
-rw-r--r--gtk2_ardour/meterbridge.cc21
-rw-r--r--gtk2_ardour/meterbridge.h2
3 files changed, 14 insertions, 25 deletions
diff --git a/gtk2_ardour/group_tabs.cc b/gtk2_ardour/group_tabs.cc
index 06e50f274b..f7ceb9e996 100644
--- a/gtk2_ardour/group_tabs.cc
+++ b/gtk2_ardour/group_tabs.cc
@@ -663,18 +663,6 @@ GroupTabs::un_subgroup (RouteGroup* g)
g->destroy_subgroup ();
}
-struct CollectSorter {
- bool operator () (boost::shared_ptr<Route> a, boost::shared_ptr<Route> b) {
- return a->presentation_info () < b->presentation_info();
- }
-};
-
-struct OrderSorter {
- bool operator() (boost::shared_ptr<Route> a, boost::shared_ptr<Route> b) {
- return a->presentation_info() < b->presentation_info();
- }
-};
-
/** Collect all members of a RouteGroup so that they are together in the Editor or Mixer.
* @param g Group to collect.
*/
@@ -682,12 +670,12 @@ void
GroupTabs::collect (RouteGroup* g)
{
boost::shared_ptr<RouteList> group_routes = g->route_list ();
- group_routes->sort (CollectSorter ());
+ group_routes->sort (Stripable::PresentationOrderSorter());
int const N = group_routes->size ();
RouteList::iterator i = group_routes->begin ();
boost::shared_ptr<RouteList> routes = _session->get_routes ();
- routes->sort (OrderSorter ());
+ routes->sort (Stripable::PresentationOrderSorter());
RouteList::const_iterator j = routes->begin ();
int diff = 0;
diff --git a/gtk2_ardour/meterbridge.cc b/gtk2_ardour/meterbridge.cc
index f687d0c72d..07553ced18 100644
--- a/gtk2_ardour/meterbridge.cc
+++ b/gtk2_ardour/meterbridge.cc
@@ -401,14 +401,16 @@ Meterbridge::on_scroll()
struct PresentationInfoRouteSorter
{
bool operator() (boost::shared_ptr<Route> a, boost::shared_ptr<Route> b) {
- if (a->is_master()) {
- /* master before everything else */
- return true;
- } else if (b->is_master()) {
- /* everything else before b */
+ if (a->is_master() || a->is_monitor()) {
+ /* "a" is a special route (master, monitor, etc), and comes
+ * last in the mixer ordering
+ */
return false;
+ } else if (b->is_master() || b->is_monitor()) {
+ /* everything comes before b */
+ return true;
}
- return a->presentation_info() < b->presentation_info();
+ return a->presentation_info().order() < b->presentation_info().order();
}
};
@@ -434,12 +436,11 @@ Meterbridge::set_session (Session* s)
_show_master = _session->config.get_show_master_on_meterbridge();
_show_midi = _session->config.get_show_midi_on_meterbridge();
- PresentationInfoRouteSorter sorter;
boost::shared_ptr<RouteList> routes = _session->get_routes();
- RouteList copy(*routes);
- copy.sort(sorter);
- add_strips(copy);
+ RouteList copy (*routes);
+ copy.sort (PresentationInfoRouteSorter());
+ add_strips (copy);
_session->RouteAdded.connect (_session_connections, invalidator (*this), boost::bind (&Meterbridge::add_strips, this, _1), gui_context());
_session->DirtyChanged.connect (_session_connections, invalidator (*this), boost::bind (&Meterbridge::update_title, this), gui_context());
diff --git a/gtk2_ardour/meterbridge.h b/gtk2_ardour/meterbridge.h
index 5e06907917..a1715b2633 100644
--- a/gtk2_ardour/meterbridge.h
+++ b/gtk2_ardour/meterbridge.h
@@ -107,7 +107,7 @@ class Meterbridge :
/* everything comes before b */
return true;
}
- return a->presentation_info() < b->presentation_info ();
+ return a->presentation_info().order() < b->presentation_info().order();
}
};