Merging undo branch into trunk. It compiles and works for limited tests. Keep
[ardour.git] / libs / ardour / control_protocol_manager.cc
index 57a89cc2d9643cb495d41972571171f322c791c7..0370886a35b338d14bed27ae7e2c3def0d18a902 100644 (file)
@@ -4,16 +4,14 @@
 #include <pbd/error.h>
 #include <pbd/pathscanner.h>
 
-#include "control_protocol.h"
+#include <control_protocol/control_protocol.h>
 
 #include <ardour/session.h>
 #include <ardour/control_protocol_manager.h>
 
-
-
-
 using namespace ARDOUR;
 using namespace std;
+using namespace PBD;
 
 #include "i18n.h"
 
@@ -51,6 +49,10 @@ ControlProtocolManager::set_session (Session& s)
                if ((*i)->requested || (*i)->mandatory) {
                        instantiate (**i);
                        (*i)->requested = false;
+
+                       if ((*i)->state) {
+                               (*i)->protocol->set_state (*(*i)->state);
+                       }
                }
        }
 }
@@ -183,6 +185,7 @@ ControlProtocolManager::control_protocol_discover (string path)
                        cpi->protocol = 0;
                        cpi->requested = false;
                        cpi->mandatory = descriptor->mandatory;
+                       cpi->state = 0;
                        
                        control_protocol_info.push_back (cpi);