From 23faf45fcf184813712d2dac3aa955b4da20d4af Mon Sep 17 00:00:00 2001 From: Damien Zammit Date: Fri, 28 Sep 2018 23:34:29 +1000 Subject: PT import: Refactor away from Editor into Session --- libs/ardour/session.cc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'libs/ardour/session.cc') diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 9bdf758a17..f0f8681570 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -6457,6 +6457,26 @@ Session::route_removed_from_route_group (RouteGroup* rg, boost::weak_ptr } } +boost::shared_ptr +Session::get_nth_audio_track (int nth) const +{ + boost::shared_ptr rl = routes.reader (); + boost::shared_ptr ret = NULL; + --nth; + + for (RouteList::const_iterator r = rl->begin(); r != rl->end(); ++r) { + boost::shared_ptr at = boost::dynamic_pointer_cast (*r); + if (at) { + if (nth > 0) { + --nth; + } else { + ret = at; + } + } + } + return ret; +} + boost::shared_ptr Session::get_tracks () const { -- cgit v1.2.3