make step edit cursor follow zoom (and change its color a bit)
[ardour.git] / gtk2_ardour / automation_controller.cc
index 1a32c36b62463efa41a4be02868c842dedff9885..f63f2ed70c4fb48bc92c3ab38ce5c9d5f12b90ea 100644 (file)
@@ -24,6 +24,7 @@
 #include "ardour/automation_control.h"
 #include "ardour/event_type_map.h"
 #include "ardour/automatable.h"
+#include "ardour/panner.h"
 #include "ardour_ui.h"
 #include "utils.h"
 #include "automation_controller.h"
@@ -54,7 +55,7 @@ AutomationController::AutomationController(boost::shared_ptr<AutomationControl>
        _screen_update_connection = ARDOUR_UI::RapidScreenUpdate.connect (
                        sigc::mem_fun (*this, &AutomationController::display_effective_value));
 
-       ac->Changed.connect (_changed_connection, boost::bind (&AutomationController::value_changed, this), gui_context());
+       ac->Changed.connect (_changed_connection, invalidator (*this), boost::bind (&AutomationController::value_changed, this), gui_context());
 }
 
 AutomationController::~AutomationController()
@@ -85,6 +86,8 @@ AutomationController::get_label (int&)
        // Hack to display CC rounded to int
        if (_controllable->parameter().type() == MidiCCAutomation) {
                s << (int)_controllable->get_value();
+       } else if (_controllable->parameter().type() == PanAutomation) {
+               s << Panner::value_as_string (_controllable->get_value ());
        } else {
                s << std::fixed << std::setprecision(3) << _controllable->get_value();
        }
@@ -147,6 +150,12 @@ AutomationController::automation_state_changed ()
 void
 AutomationController::value_changed ()
 {
-       Gtkmm2ext::UI::instance()->call_slot (boost::bind (&AutomationController::display_effective_value, this));
+       Gtkmm2ext::UI::instance()->call_slot (invalidator (*this), boost::bind (&AutomationController::display_effective_value, this));
 }
 
+/** Stop updating our value from our controllable */
+void
+AutomationController::stop_updating ()
+{
+       _screen_update_connection.disconnect ();
+}