13
0

Vkeybd: Add tooltip to pitchbend control

This commit is contained in:
Robin Gareus 2019-12-15 14:04:44 +01:00
parent a31fde491a
commit f969d4fc31
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 17 additions and 5 deletions

View File

@ -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)
{

View File

@ -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*);