From d72b44b5a43a39102d505c23341cc7ab3d5e38ca Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 30 Jan 2020 18:07:01 +0100 Subject: [PATCH] Fix scripted/meta session templates --- gtk2_ardour/ardour_ui_session.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/ardour_ui_session.cc b/gtk2_ardour/ardour_ui_session.cc index 60df179258..3ae6fd3a5d 100644 --- a/gtk2_ardour/ardour_ui_session.cc +++ b/gtk2_ardour/ardour_ui_session.cc @@ -597,8 +597,10 @@ ARDOUR_UI::build_session_stage_two (std::string const& path, std::string const& { Session* new_session; + bool meta_session = !session_template.empty() && session_template.substr (0, 11) == "urn:ardour:"; + try { - new_session = new Session (*AudioEngine::instance(), path, snap_name, bus_profile.master_out_channels > 0 ? &bus_profile : NULL, session_template); + new_session = new Session (*AudioEngine::instance(), path, snap_name, bus_profile.master_out_channels > 0 ? &bus_profile : NULL, meta_session ? "" : session_template); } catch (SessionException const& e) { cerr << "Here are the errors associated with this failed session:\n"; @@ -650,7 +652,7 @@ ARDOUR_UI::build_session_stage_two (std::string const& path, std::string const& new_session->save_state(new_session->name()); - if (!session_template.empty() && session_template.substr (0, 11) == "urn:ardour:") { + if (meta_session) { meta_session_setup (session_template.substr (11)); }