- : Automatable (s)
- , SessionHandleRef (s)
- , pan_azimuth_control (new AutomationControl (s, PanAzimuthAutomation,
- boost::shared_ptr<AutomationList>(new AutomationList(PanAzimuthAutomation)), ""))
- , pan_elevation_control (new AutomationControl (s, PanElevationAutomation,
- boost::shared_ptr<AutomationList>(new AutomationList(PanElevationAutomation)), ""))
- , pan_width_control (new AutomationControl (s, PanWidthAutomation,
- boost::shared_ptr<AutomationList>(new AutomationList(PanWidthAutomation)), ""))
- , pan_frontback_control (new AutomationControl (s, PanFrontBackAutomation,
- boost::shared_ptr<AutomationList>(new AutomationList(PanFrontBackAutomation)), ""))
- , pan_lfe_control (new AutomationControl (s, PanLFEAutomation,
- boost::shared_ptr<AutomationList>(new AutomationList(PanLFEAutomation)), ""))
- , _auto_state (Off)
- , _auto_style (Absolute)
+ : Automatable (s)
+ , SessionHandleRef (s)
+ , pan_azimuth_control (new PanControllable (s, "", this, PanAzimuthAutomation))
+ , pan_elevation_control (new PanControllable (s, "", this, PanElevationAutomation))
+ , pan_width_control (new PanControllable (s, "", this, PanWidthAutomation))
+ , pan_frontback_control (new PanControllable (s, "", this, PanFrontBackAutomation))
+ , pan_lfe_control (new PanControllable (s, "", this, PanLFEAutomation))
+ , _auto_state (Off)
+ , _auto_style (Absolute)
+ , _has_state (false)
+ , _responding_to_control_auto_state_change (0)
+{
+ //boost_debug_shared_ptr_mark_interesting (this, "pannable");
+
+ add_control (pan_azimuth_control);
+ add_control (pan_elevation_control);
+ add_control (pan_width_control);
+ add_control (pan_frontback_control);
+ add_control (pan_lfe_control);
+
+ /* all controls change state together */
+
+ pan_azimuth_control->alist()->automation_state_changed.connect_same_thread (*this, boost::bind (&Pannable::control_auto_state_changed, this, _1));
+ pan_elevation_control->alist()->automation_state_changed.connect_same_thread (*this, boost::bind (&Pannable::control_auto_state_changed, this, _1));
+ pan_width_control->alist()->automation_state_changed.connect_same_thread (*this, boost::bind (&Pannable::control_auto_state_changed, this, _1));
+ pan_frontback_control->alist()->automation_state_changed.connect_same_thread (*this, boost::bind (&Pannable::control_auto_state_changed, this, _1));
+ pan_lfe_control->alist()->automation_state_changed.connect_same_thread (*this, boost::bind (&Pannable::control_auto_state_changed, this, _1));
+
+ pan_azimuth_control->Changed.connect_same_thread (*this, boost::bind (&Pannable::value_changed, this));
+ pan_elevation_control->Changed.connect_same_thread (*this, boost::bind (&Pannable::value_changed, this));
+ pan_width_control->Changed.connect_same_thread (*this, boost::bind (&Pannable::value_changed, this));
+ pan_frontback_control->Changed.connect_same_thread (*this, boost::bind (&Pannable::value_changed, this));
+ pan_lfe_control->Changed.connect_same_thread (*this, boost::bind (&Pannable::value_changed, this));
+}
+
+Pannable::~Pannable ()
+{
+ DEBUG_TRACE (DEBUG::Destruction, string_compose ("pannable @ %1 destructor\n", this));
+}
+
+void
+Pannable::control_auto_state_changed (AutoState new_state)
+{
+ if (_responding_to_control_auto_state_change) {
+ return;
+ }
+
+ _responding_to_control_auto_state_change++;
+
+ pan_azimuth_control->set_automation_state (new_state);
+ pan_width_control->set_automation_state (new_state);
+ pan_elevation_control->set_automation_state (new_state);
+ pan_frontback_control->set_automation_state (new_state);
+ pan_lfe_control->set_automation_state (new_state);
+
+ _responding_to_control_auto_state_change--;
+
+ _auto_state = new_state;
+ automation_state_changed (new_state); /* EMIT SIGNAL */
+}
+
+void
+Pannable::set_panner (boost::shared_ptr<Panner> p)
+{
+ _panner = p;
+}
+
+void
+Pannable::value_changed ()