diff --git a/gtk2_ardour/virtual_keyboard_window.cc b/gtk2_ardour/virtual_keyboard_window.cc index 56cd96145e..0310c4b909 100644 --- a/gtk2_ardour/virtual_keyboard_window.cc +++ b/gtk2_ardour/virtual_keyboard_window.cc @@ -20,6 +20,7 @@ #include "pbd/convert.h" +#include "pbd/compose.h" #include "ardour/async_midi_port.h" #include "ardour/session.h" @@ -114,7 +115,7 @@ VirtualKeyboardWindow::VirtualKeyboardWindow () set_tooltip (_send_panic, _("Send MIDI Panic message for current channel")); - _pitch_slider_tooltip->set_tip (_("Pitchbend: ") + std::string ("8192")); + pitch_bend_update_tooltip (8192); _pitch_slider->set_can_focus (false); /* config */ @@ -597,11 +598,20 @@ void VirtualKeyboardWindow::pitch_slider_adjusted () { _pitchbend->set_value (_pitch_adjustment.get_value (), PBD::Controllable::NoGroup); - char buf[64]; - snprintf (buf, sizeof (buf), "%.0f", _pitch_adjustment.get_value ()); - _pitch_slider_tooltip->set_tip (_("Pitchbend: ") + std::string(buf)); + pitch_bend_update_tooltip (_pitch_adjustment.get_value ()); } +void +VirtualKeyboardWindow::pitch_bend_update_tooltip (int value) +{ + _pitch_slider_tooltip->set_tip (string_compose ( + _("Pitchbend: %1\n" + "Use mouse-drag for sprung mode,\n" + "mouse-wheel for presisent bends.\n" + "F1-F4 keys jump to select values."), value)); +} + + void VirtualKeyboardWindow::note_on_event_handler (int note, int velocity) { diff --git a/gtk2_ardour/virtual_keyboard_window.h b/gtk2_ardour/virtual_keyboard_window.h index dc5b63df5e..3ee663b102 100644 --- a/gtk2_ardour/virtual_keyboard_window.h +++ b/gtk2_ardour/virtual_keyboard_window.h @@ -103,8 +103,11 @@ private: void note_on_event_handler (int, int); void note_off_event_handler (int); void control_change_event_handler (int, int); + void pitch_bend_event_handler (int); void pitch_bend_release (); + void pitch_bend_update_tooltip (int); + void pitch_slider_adjusted (); void select_keyboard_layout (std::string const&); void update_velocity_settings (int); @@ -112,7 +115,6 @@ private: void update_octave_range (); void bank_patch (); void update_sensitivity (); - void pitch_slider_adjusted (); bool toggle_config (GdkEventButton*); bool toggle_bankpatch (GdkEventButton*); bool toggle_yaxis_velocity (GdkEventButton*);