From 2d4358ddb5e9cf3cd21b603b74dc999aaebf53a2 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 10 Jun 2016 13:50:19 -0400 Subject: 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. --- libs/ardour/session_midi.cc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'libs/ardour/session_midi.cc') 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 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 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; + } } } -- cgit v1.2.3