diff options
author | John Emmas <johne53@tiscali.co.uk> | 2013-10-06 11:56:03 +0100 |
---|---|---|
committer | John Emmas <johne53@tiscali.co.uk> | 2013-10-06 11:56:03 +0100 |
commit | 300b484cf6ac14c15e365c4062345d64a61c4b18 (patch) | |
tree | f10b9abedc141192f5c35f9c0f40e94f1d52786d /libs/ardour/session.cc | |
parent | 7d78172abfd9b02bcb6809db3f7545e90dbe968d (diff) | |
parent | 2d5e605bf124c82f77a5a893e540bc176164947d (diff) |
Merge branch 'master' into windows+cc
Conflicts (hopefully resolved):
gtk2_ardour/ardour_ui.cc
gtk2_ardour/ardour_ui.h
gtk2_ardour/ardour_ui_options.cc
Diffstat (limited to 'libs/ardour/session.cc')
-rw-r--r-- | libs/ardour/session.cc | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 2a081086d4..4b30543cb0 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)) { @@ -393,7 +408,7 @@ Session::immediately_post_engine () _engine.Running.connect_same_thread (*this, boost::bind (&Session::initialize_latencies, this)); - if (synced_to_jack()) { + if (synced_to_engine()) { _engine.transport_stop (); } @@ -577,14 +592,21 @@ Session::setup_ltc () void Session::setup_click () { - XMLNode* child = 0; - _clicking = false; _click_io.reset (new ClickIO (*this, "click")); _click_gain.reset (new Amp (*this)); _click_gain->activate (); - - if (state_tree && (child = find_named_node (*state_tree->root(), "Click")) != 0) { + if (state_tree) { + setup_click_state (*state_tree->root()); + } +} + +void +Session::setup_click_state (const XMLNode& node) +{ + const XMLNode* child = 0; + + if ((child = find_named_node (node, "Click")) != 0) { /* existing state for Click */ int c = 0; @@ -1406,7 +1428,7 @@ Session::audible_frame () const offset = current_block_size; } - if (synced_to_jack()) { + if (synced_to_engine()) { tf = _engine.transport_frame(); } else { tf = _transport_frame; |