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 /libs/ardour/session_midi.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 'libs/ardour/session_midi.cc')
-rw-r--r-- | libs/ardour/session_midi.cc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/libs/ardour/session_midi.cc b/libs/ardour/session_midi.cc index f3a8d7dd81..e53970840b 100644 --- a/libs/ardour/session_midi.cc +++ b/libs/ardour/session_midi.cc @@ -338,21 +338,24 @@ Session::mmc_shuttle (MIDI::MachineControl &/*mmc*/, float speed, bool forw) boost::shared_ptr<Route> Session::get_midi_nth_route_by_id (PresentationInfo::order_t n) const { - PresentationInfo id (PresentationInfo::Flag (0)); + PresentationInfo::Flag f; if (n == 318) { - id.set_flags (PresentationInfo::MasterOut); + f = PresentationInfo::MasterOut; } else if (n == 319) { - id.set_flags (PresentationInfo::MonitorOut); + f = PresentationInfo::MonitorOut; } else { - id = PresentationInfo (n, PresentationInfo::Route); + f = PresentationInfo::Route; } boost::shared_ptr<RouteList> r = routes.reader (); + PresentationInfo::order_t match_cnt = 0; for (RouteList::iterator i = r->begin(); i != r->end(); ++i) { - if ((*i)->presentation_info().match (id)) { - return *i; + if ((*i)->presentation_info().flag_match (f)) { + if (match_cnt++ == n) { + return *i; + } } } |