summaryrefslogtreecommitdiff
path: root/libs/ardour/control_protocol_manager.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2012-04-26 16:18:03 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2012-04-26 16:18:03 +0000
commit834f94c60a7f6ff2b0695096e9dbcd340dbca3af (patch)
treedece708d97110d03dad26e5bab686f3c1b32f7ee /libs/ardour/control_protocol_manager.cc
parent3b7e2f7d67ad87bfb0ce183c10e9d00e71b6b085 (diff)
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
Diffstat (limited to 'libs/ardour/control_protocol_manager.cc')
-rw-r--r--libs/ardour/control_protocol_manager.cc11
1 files changed, 6 insertions, 5 deletions
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 {