Fix potential deadlock on session-load
[ardour.git] / libs / ardour / pannable.cc
index 70fe70c7287cbfe90ddf1c0790c04e95b2c1f7ee..abfb9d66c2e3aa80457dc90cd849791ccfc92fb3 100644 (file)
@@ -20,8 +20,8 @@
 #include "pbd/error.h"
 #include "pbd/convert.h"
 #include "pbd/compose.h"
-#include "pbd/boost_debug.h"
 
+#include "ardour/boost_debug.h"
 #include "ardour/debug.h"
 #include "ardour/automation_control.h"
 #include "ardour/automation_list.h"
@@ -30,7 +30,7 @@
 #include "ardour/pan_controllable.h"
 #include "ardour/session.h"
 
-#include "i18n.h"
+#include "pbd/i18n.h"
 
 using namespace std;
 using namespace PBD;
@@ -107,6 +107,12 @@ Pannable::set_panner (boost::shared_ptr<Panner> p)
 void
 Pannable::value_changed ()
 {
+       if (!has_state ()) {
+               // prevent the GUI from resetting panners
+               // e.g. when switching to aux-sends and back.
+               _has_state = true;
+       }
+
        _session.set_dirty ();
 }
 
@@ -275,7 +281,7 @@ Pannable::set_state (const XMLNode& root, int version)
 }
 
 string
-Pannable::value_as_string (boost::shared_ptr<AutomationControl> ac) const
+Pannable::value_as_string (boost::shared_ptr<const AutomationControl> ac) const
 {
        boost::shared_ptr<Panner> p = panner ();