From f7586f3a0d3492a15cae901bb209f6a983e7db0a Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 21 Sep 2013 12:50:45 -0400 Subject: [PATCH] likely fix for creating new sessions from templates --- libs/ardour/session.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 4be52a7584..d45375fe0d 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -276,6 +276,21 @@ Session::Session (AudioEngine &eng, throw failed_constructor (); } + /* if a mix template was provided, then ::create() will + * have copied it into the session and we need to load it + * so that we have the state ready for ::set_state() + * after the engine is started. + * + * Note that we do NOT try to get the sample rate from + * the template at this time, though doing so would + * be easy if we decided this was an appropriate part + * of a template. + */ + + if (!mix_template.empty() && load_state (_current_snapshot_name)) { + throw failed_constructor (); + } + } else { if (load_state (_current_snapshot_name)) {