13
0

allow to set toolip on knob

This commit is contained in:
Robin Gareus 2015-04-24 22:16:10 +02:00
parent 3cdd8fa221
commit 57e80c2c8f
2 changed files with 7 additions and 1 deletions

View File

@ -377,10 +377,12 @@ ArdourKnob::set_controllable (boost::shared_ptr<Controllable> c)
void
ArdourKnob::controllable_changed ()
{
_val = binding_proxy.get_controllable()->get_interface(); //% of knob travel
boost::shared_ptr<PBD::Controllable> 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();
}

View File

@ -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<PBD::Controllable> get_controllable() { return binding_proxy.get_controllable(); }
void set_controllable (boost::shared_ptr<PBD::Controllable> 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__ */