#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;
using namespace Gtk;
using namespace Glib;
using namespace PBD;
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()
}
void
-ArdourKnob::render (cairo_t* cr, cairo_rectangle_t *)
+ArdourKnob::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangle_t*)
{
+ cairo_t* cr = ctx->cobj();
cairo_pattern_t* shade_pattern;
float width = get_width();
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()) {
+ boost::shared_ptr<ARDOUR::AutomationControl> ac = boost::dynamic_pointer_cast<ARDOUR::AutomationControl> (c);
_tooltip.set_tip (_tooltip_prefix + c->get_user_string());
}
set_dirty();