#include "gtkmm2ext/gui_thread.h"
#include "gtkmm2ext/keyboard.h"
+#include "ardour/automation_control.h"
#include "ardour/rc_configuration.h" // for widget prelight preference
#include "ardour_knob.h"
#include "canvas/colors.h"
#include "canvas/utils.h"
-#include "i18n.h"
+#include "pbd/i18n.h"
using namespace Gtkmm2ext;
using namespace Gdk;
UIConfiguration::instance().ColorsChanged.connect (sigc::mem_fun (*this, &ArdourKnob::color_handler));
// watch automation :(
- Timers::rapid_connect (sigc::mem_fun (*this, &ArdourKnob::controllable_changed));
+ // TODO only use for GainAutomation
+ Timers::rapid_connect (sigc::bind (sigc::mem_fun (*this, &ArdourKnob::controllable_changed), false));
}
ArdourKnob::~ArdourKnob()
binding_proxy.set_controllable (c);
- c->Changed.connect (watch_connection, invalidator(*this), boost::bind (&ArdourKnob::controllable_changed, this), gui_context());
+ c->Changed.connect (watch_connection, invalidator(*this), boost::bind (&ArdourKnob::controllable_changed, this, false), gui_context());
_normal = c->internal_to_interface(c->normal());
}
void
-ArdourKnob::controllable_changed ()
+ArdourKnob::controllable_changed (bool force_update)
{
boost::shared_ptr<PBD::Controllable> c = binding_proxy.get_controllable();
if (!c) return;
float val = c->get_interface();
val = min( max(0.0f, val), 1.0f); // clamp
- if (val == _val) {
+ if (val == _val && !force_update) {
return;
}
_val = val;
if (!_tooltip_prefix.empty()) {
- _tooltip.set_tip (_tooltip_prefix + c->get_user_string());
+ boost::shared_ptr<ARDOUR::AutomationControl> ac = boost::dynamic_pointer_cast<ARDOUR::AutomationControl> (c);
+ if (_printer && ac) {
+
+ _tooltip.set_tip (_tooltip_prefix + _printer->value_as_string (ac));
+ } else {
+ _tooltip.set_tip (_tooltip_prefix + c->get_user_string());
+ }
}
set_dirty();
}