new libardour API for Session::new_route_from_template to allow specifying insertion...
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 22 Aug 2016 13:41:08 +0000 (09:41 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 22 Aug 2016 13:41:59 +0000 (09:41 -0400)
libs/ardour/ardour/session.h
libs/ardour/luabindings.cc
libs/ardour/session.cc

index 535317c407c030d076e1004907cc659af6fb27d7..858a2c6d97e51e93cfdf888e72de5a81975cc8ef 100644 (file)
@@ -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);
index 2e47cb8cd7ab54b494cbe1ffc9c10a8d569a21ed..81d14b2a6fab88fee0a3a5d6a45bc1ca53a2cbf9 100644 (file)
@@ -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 ()
index 61bfce14b6bfc995f0203b44e42bdf17652e60d8..fc66dfe602ff38f512dfacba71436eceaa7ad4c7 100644 (file)
@@ -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 ();
        }