diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-08-22 09:41:08 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-08-22 09:41:59 -0400 |
commit | 636522bd79774af3e0f3ad11939c15b1dd1e4eb7 (patch) | |
tree | 00dcfbeda614a6387bbc7fff93ce08244bc103f0 | |
parent | ae32f44dc95801372b1a2a4549e0997550d16eef (diff) |
new libardour API for Session::new_route_from_template to allow specifying insertion point
-rw-r--r-- | libs/ardour/ardour/session.h | 4 | ||||
-rw-r--r-- | libs/ardour/luabindings.cc | 2 | ||||
-rw-r--r-- | libs/ardour/session.cc | 11 |
3 files changed, 9 insertions, 8 deletions
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 535317c407..858a2c6d97 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -245,8 +245,8 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop * @param pd Playlist disposition * @return list of newly created routes */ - RouteList new_route_from_template (uint32_t how_many, const std::string& template_path, const std::string& name, PlaylistDisposition pd = NewPlaylist); - RouteList new_route_from_template (uint32_t how_many, XMLNode&, const std::string& name, PlaylistDisposition pd = NewPlaylist); + RouteList new_route_from_template (uint32_t how_many, PresentationInfo::order_t insert_at, const std::string& template_path, const std::string& name, PlaylistDisposition pd = NewPlaylist); + RouteList new_route_from_template (uint32_t how_many, PresentationInfo::order_t insert_at, XMLNode&, const std::string& name, PlaylistDisposition pd = NewPlaylist); std::vector<std::string> get_paths_for_new_sources (bool allow_replacing, const std::string& import_file_path, uint32_t channels); int bring_all_sources_into_session (boost::function<void(uint32_t,uint32_t,std::string)> callback); diff --git a/libs/ardour/luabindings.cc b/libs/ardour/luabindings.cc index 2e47cb8cd7..81d14b2a6f 100644 --- a/libs/ardour/luabindings.cc +++ b/libs/ardour/luabindings.cc @@ -1565,7 +1565,7 @@ LuaBindings::session (lua_State* L) .addFunction ("set_dirty", &Session::set_dirty) .addFunction ("unknown_processors", &Session::unknown_processors) - .addFunction<RouteList (Session::*)(uint32_t, const std::string&, const std::string&, PlaylistDisposition)> ("new_route_from_template", &Session::new_route_from_template) + .addFunction<RouteList (Session::*)(uint32_t, PresentationInfo::order_t, const std::string&, const std::string&, PlaylistDisposition)> ("new_route_from_template", &Session::new_route_from_template) // TODO session_add_audio_track session_add_midi_track session_add_mixed_track //.addFunction ("new_midi_track", &Session::new_midi_track) .endClass () diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 61bfce14b6..fc66dfe602 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -3158,7 +3158,8 @@ Session::new_audio_route (int input_channels, int output_channels, RouteGroup* r } RouteList -Session::new_route_from_template (uint32_t how_many, const std::string& template_path, const std::string& name_base, PlaylistDisposition pd) +Session::new_route_from_template (uint32_t how_many, PresentationInfo::order_t insert_at, const std::string& template_path, const std::string& name_base, + PlaylistDisposition pd) { XMLTree tree; @@ -3166,11 +3167,11 @@ Session::new_route_from_template (uint32_t how_many, const std::string& template return RouteList(); } - return new_route_from_template (how_many, *tree.root(), name_base, pd); + return new_route_from_template (how_many, insert_at, *tree.root(), name_base, pd); } RouteList -Session::new_route_from_template (uint32_t how_many, XMLNode& node, const std::string& name_base, PlaylistDisposition pd) +Session::new_route_from_template (uint32_t how_many, PresentationInfo::order_t insert_at, XMLNode& node, const std::string& name_base, PlaylistDisposition pd) { RouteList ret; uint32_t number = 0; @@ -3340,9 +3341,9 @@ Session::new_route_from_template (uint32_t how_many, XMLNode& node, const std::s if (!ret.empty()) { StateProtector sp (this); if (Profile->get_trx()) { - add_routes (ret, false, false, false, PresentationInfo::max_order); + add_routes (ret, false, false, false, insert_at); } else { - add_routes (ret, true, true, false, PresentationInfo::max_order); + add_routes (ret, true, true, false, insert_at); } IO::enable_connecting (); } |