diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-06-10 13:50:19 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-06-10 13:57:18 -0400 |
commit | 2d4358ddb5e9cf3cd21b603b74dc999aaebf53a2 (patch) | |
tree | 156fb8fa0d0e182cacece8d112cb4dec3fd3f5aa /gtk2_ardour/meterbridge.cc | |
parent | 3eaa6c038988776e3bab441b84de45b2a8364130 (diff) |
Various changes to PresentationInfo and a small consolidation of sorters.
The semantics for sorting PresentationInfo are up to the caller, not the
PresentationInfo object, so operator<() was removed and callers specifically
invoke ::order() for sorting.
Diffstat (limited to 'gtk2_ardour/meterbridge.cc')
-rw-r--r-- | gtk2_ardour/meterbridge.cc | 21 |
1 files changed, 11 insertions, 10 deletions
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()); |