break circular reference between panners and pannables; more destruction debug tracin...
[ardour.git] / libs / ardour / pannable.cc
index 4243ab45dfe07e2856a42c43d127810729c7dd91..b4744d5658e0bdedd652e2cae2e87d3e5e739f71 100644 (file)
 #include "pbd/error.h"
 #include "pbd/convert.h"
 
+#include "ardour/debug.h"
 #include "ardour/automation_control.h"
 #include "ardour/automation_list.h"
 #include "ardour/pannable.h"
+#include "ardour/panner.h"
 #include "ardour/pan_controllable.h"
 #include "ardour/session.h"
 
+using namespace std;
 using namespace PBD;
 using namespace ARDOUR;
 
@@ -57,6 +60,11 @@ Pannable::Pannable (Session& s)
         pan_lfe_control->alist()->automation_state_changed.connect_same_thread (*this, boost::bind (&Pannable::control_auto_state_changed, this, _1));
 }
 
+Pannable::~Pannable ()
+{
+       DEBUG_TRACE (DEBUG::Destruction, string_compose ("pannable @ %1 destructor\n", this));
+}
+
 void
 Pannable::control_auto_state_changed (AutoState new_state)
 {
@@ -245,6 +253,14 @@ Pannable::set_state (const XMLNode& root, int /*version - not used*/)
         return 0;
 }
 
+string 
+Pannable::value_as_string (boost::shared_ptr<AutomationControl> ac) const
+{
+        boost::shared_ptr<Panner> p = panner ();
 
+        if (p) {
+                return p->value_as_string (ac);
+        } 
 
-        
+        return Automatable::value_as_string (ac);
+}