diff options
-rw-r--r-- | libs/ardour/session.cc | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 24a531b424..f3e23e237c 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -4336,18 +4336,6 @@ Session::get_remote_nth_stripable (PresentationInfo::order_t n, PresentationInfo return boost::shared_ptr<Stripable>(); } -boost::shared_ptr<Route> -Session::route_by_selected_count (uint32_t id) const -{ - boost::shared_ptr<RouteList> r = routes.reader (); - - for (RouteList::iterator i = r->begin(); i != r->end(); ++i) { - /* NOT IMPLEMENTED */ - } - - return boost::shared_ptr<Route> ((Route*) 0); -} - struct PresentationOrderSorter { bool operator() (boost::shared_ptr<Stripable> a, boost::shared_ptr<Stripable> b) { if (a->presentation_info().special() && !b->presentation_info().special()) { @@ -4362,6 +4350,27 @@ struct PresentationOrderSorter { } }; +boost::shared_ptr<Route> +Session::route_by_selected_count (uint32_t id) const +{ + RouteList r (*(routes.reader ())); + PresentationOrderSorter sorter; + r.sort (sorter); + + RouteList::iterator i; + + for (i = r.begin(); i != r.end(); ++i) { + if ((*i)->presentation_info().selected()) { + if (id == 0) { + return *i; + } + --id; + } + } + + return boost::shared_ptr<Route> (); +} + void Session::reassign_track_numbers () { |