summaryrefslogtreecommitdiff
path: root/libs/ardour/session.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/session.cc')
-rw-r--r--libs/ardour/session.cc20
1 files changed, 20 insertions, 0 deletions
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<Route>
}
}
+boost::shared_ptr<AudioTrack>
+Session::get_nth_audio_track (int nth) const
+{
+ boost::shared_ptr<RouteList> rl = routes.reader ();
+ boost::shared_ptr<AudioTrack> ret = NULL;
+ --nth;
+
+ for (RouteList::const_iterator r = rl->begin(); r != rl->end(); ++r) {
+ boost::shared_ptr<AudioTrack> at = boost::dynamic_pointer_cast<AudioTrack> (*r);
+ if (at) {
+ if (nth > 0) {
+ --nth;
+ } else {
+ ret = at;
+ }
+ }
+ }
+ return ret;
+}
+
boost::shared_ptr<RouteList>
Session::get_tracks () const
{