13
0

new libardour API for Session::new_route_from_template to allow specifying insertion point

This commit is contained in:
Paul Davis 2016-08-22 09:41:08 -04:00
parent ae32f44dc9
commit 636522bd79
3 changed files with 9 additions and 8 deletions

View 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);

View 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 ()

View 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 ();
}