diff options
-rw-r--r-- | libs/ardour/ardour/session.h | 1 | ||||
-rw-r--r-- | libs/ardour/session.cc | 15 | ||||
-rw-r--r-- | libs/ardour/session_state.cc | 8 |
3 files changed, 13 insertions, 11 deletions
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 2fcf6d476a..937ae4fb2e 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -1619,6 +1619,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi void setup_ltc (); void setup_click (); + void setup_click_state (const XMLNode&); void setup_bundles (); static int get_session_info_from_path (XMLTree& state_tree, const std::string& xmlpath); diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index d45375fe0d..28849e2930 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -592,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; diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index d96db8f188..94e9f00564 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -1317,13 +1317,7 @@ Session::set_state (const XMLNode& node, int version) if ((child = find_named_node (node, "Click")) == 0) { warning << _("Session: XML state has no click section") << endmsg; } else if (_click_io) { - const XMLNodeList& children (child->children()); - XMLNodeList::const_iterator i = children.begin(); - _click_io->set_state (**i, version); - ++i; - if (i != children.end()) { - _click_gain->set_state (**i, version); - } + setup_click_state (node); } if ((child = find_named_node (node, ControlProtocolManager::state_node_name)) != 0) { |