diff --git a/gtk2_ardour/ardour_knob.cc b/gtk2_ardour/ardour_knob.cc index 1cad9f4f55..e7d9647d3b 100644 --- a/gtk2_ardour/ardour_knob.cc +++ b/gtk2_ardour/ardour_knob.cc @@ -377,10 +377,12 @@ ArdourKnob::set_controllable (boost::shared_ptr c) void ArdourKnob::controllable_changed () { - _val = binding_proxy.get_controllable()->get_interface(); //% of knob travel + boost::shared_ptr c = binding_proxy.get_controllable(); + _val = c->get_interface(); //% of knob travel _val = min( max(0.0f, _val), 1.0f); //range check + ARDOUR_UI::instance()->set_tip (*this, _tooltip_prefix + c->get_user_string()); set_dirty(); } diff --git a/gtk2_ardour/ardour_knob.h b/gtk2_ardour/ardour_knob.h index 3a9c2bd7ff..50fc81bfaa 100644 --- a/gtk2_ardour/ardour_knob.h +++ b/gtk2_ardour/ardour_knob.h @@ -53,6 +53,8 @@ public: void add_elements (Element); static Element default_elements; + void set_tooltip_prefix (std::string pfx) { _tooltip_prefix = pfx; } + boost::shared_ptr get_controllable() { return binding_proxy.get_controllable(); } void set_controllable (boost::shared_ptr c); @@ -91,6 +93,8 @@ public: void action_sensitivity_changed (); void action_visibility_changed (); void action_tooltip_changed (); + + std::string _tooltip_prefix; }; #endif /* __gtk2_ardour_ardour_knob_h__ */