From 3fd7f9478faf1be8b76b7bd1614917fc2aaf778c Mon Sep 17 00:00:00 2001 From: Damien Zammit Date: Wed, 10 Oct 2018 20:17:57 +1100 Subject: PT import: Minor changes to session --- libs/ardour/ardour/session.h | 6 ++++++ libs/ardour/session.cc | 19 +++++++++++++++++++ libs/ardour/wscript | 2 ++ 3 files changed, 27 insertions(+) diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index e63c68f604..786bb195ab 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -41,6 +41,7 @@ #include #include +#include #include "pbd/error.h" #include "pbd/event_loop.h" @@ -302,6 +303,8 @@ public: boost::shared_ptr get_routes_with_internal_returns() const; boost::shared_ptr get_routes_with_regions_at (samplepos_t const) const; + boost::shared_ptr get_nth_audio_track (int nth) const; + uint32_t nstripables (bool with_monitor = false) const; uint32_t nroutes() const { return routes.reader()->size(); } uint32_t ntracks () const; @@ -1198,6 +1201,9 @@ public: bool transport_master_is_external() const; boost::shared_ptr transport_master() const; + void import_pt (PTFFormat& ptf, ImportStatus& status); + bool import_sndfile_as_region (std::string path, SrcQuality quality, samplepos_t& pos, SourceList& sources, ImportStatus& status); + protected: friend class AudioEngine; void set_block_size (pframes_t nframes); diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 064a929b43..228c52ef08 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -6460,6 +6460,25 @@ 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 (); + rl->sort (Stripable::Sorter ()); + + for (RouteList::const_iterator r = rl->begin(); r != rl->end(); ++r) { + if (!boost::dynamic_pointer_cast (*r)) { + continue; + } + + if (--nth > 0) { + continue; + } + return boost::dynamic_pointer_cast (*r); + } + return boost::shared_ptr (); +} + boost::shared_ptr Session::get_tracks () const { diff --git a/libs/ardour/wscript b/libs/ardour/wscript index efc305325a..ffc6827334 100644 --- a/libs/ardour/wscript +++ b/libs/ardour/wscript @@ -103,6 +103,7 @@ libardour_sources = [ 'iec1ppmdsp.cc', 'iec2ppmdsp.cc', 'import.cc', + 'import_pt.cc', 'instrument_info.cc', 'internal_return.cc', 'internal_send.cc', @@ -399,6 +400,7 @@ def build(bld): 'libaudiographer', 'libtemporal', 'liblua', + 'libptformat', 'zita-resampler', ] if bld.env['build_target'] != 'mingw': -- cgit v1.2.3