From 834f94c60a7f6ff2b0695096e9dbcd340dbca3af Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 26 Apr 2012 16:18:03 +0000 Subject: fix initialization of control protocols so that brand new sessions get working control protocols if the user's ardour.rc file indicates to do so; fix MCP bank scrolling git-svn-id: svn://localhost/ardour2/branches/3.0@12096 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/control_protocol_manager.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'libs/ardour/control_protocol_manager.cc') diff --git a/libs/ardour/control_protocol_manager.cc b/libs/ardour/control_protocol_manager.cc index c72d3f31d0..6aa0c51da2 100644 --- a/libs/ardour/control_protocol_manager.cc +++ b/libs/ardour/control_protocol_manager.cc @@ -41,7 +41,6 @@ const string ControlProtocolManager::state_node_name = X_("ControlProtocols"); ControlProtocolManager::ControlProtocolManager () { - } ControlProtocolManager::~ControlProtocolManager() @@ -320,13 +319,15 @@ ControlProtocolManager::set_state (const XMLNode& node, int /*version*/) if (prop && string_is_affirmative (prop->value())) { if ((prop = (*citer)->property (X_("name"))) != 0) { ControlProtocolInfo* cpi = cpi_by_name (prop->value()); + if (cpi) { - if (!(*citer)->children().empty()) { - cpi->state = (*citer)->children().front (); - } else { - cpi->state = 0; + + if (cpi->state) { + delete cpi->state; } + cpi->state = new XMLNode (**citer); + if (_session) { instantiate (*cpi); } else { -- cgit v1.2.3