13
0

add ctrl-left to reset to -inf on gain fader

git-svn-id: svn://localhost/ardour2/trunk@1156 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2006-11-22 14:22:35 +00:00
parent fd289ac967
commit 07e5604bf5

View File

@ -89,13 +89,11 @@ PixFader::on_button_press_event (GdkEventButton* ev)
switch (ev->button) { switch (ev->button) {
case 1: case 1:
case 2: case 2:
if (!(ev->state & Gdk::SHIFT_MASK)) { add_modal_grab();
add_modal_grab(); grab_y = ev->y;
grab_y = ev->y; grab_start = ev->y;
grab_start = ev->y; grab_window = ev->window;
grab_window = ev->window; dragging = true;
dragging = true;
}
break; break;
default: default:
break; break;
@ -108,19 +106,8 @@ PixFader::on_button_press_event (GdkEventButton* ev)
bool bool
PixFader::on_button_release_event (GdkEventButton* ev) PixFader::on_button_release_event (GdkEventButton* ev)
{ {
double scale;
double fract; double fract;
if (ev->state & GDK_CONTROL_MASK) {
if (ev->state & GDK_MOD1_MASK) {
scale = 0.05;
} else {
scale = 0.1;
}
} else {
scale = 1.0;
}
switch (ev->button) { switch (ev->button) {
case 1: case 1:
if (dragging) { if (dragging) {
@ -128,9 +115,14 @@ PixFader::on_button_release_event (GdkEventButton* ev)
dragging = false; dragging = false;
if (ev->y == grab_start) { if (ev->y == grab_start) {
/* no motion - just a click */ /* no motion - just a click */
if (ev->y < view.height - display_height()) { if (ev->state & Gdk::SHIFT_MASK) {
adjustment.set_value (default_value);
} else if (ev->state & GDK_CONTROL_MASK) {
adjustment.set_value (adjustment.get_lower());
} else if (ev->y < view.height - display_height()) {
/* above the current display height, remember X Window coords */ /* above the current display height, remember X Window coords */
adjustment.set_value (adjustment.get_value() + adjustment.get_step_increment()); adjustment.set_value (adjustment.get_value() + adjustment.get_step_increment());
} else { } else {
@ -138,12 +130,7 @@ PixFader::on_button_release_event (GdkEventButton* ev)
} }
} }
} else { }
if (ev->state & Gdk::SHIFT_MASK) {
adjustment.set_value (default_value);
}
}
break; break;
case 2: case 2:
@ -156,7 +143,7 @@ PixFader::on_button_release_event (GdkEventButton* ev)
fract = min (1.0, fract); fract = min (1.0, fract);
fract = max (0.0, fract); fract = max (0.0, fract);
adjustment.set_value (scale * fract * (adjustment.get_upper() - adjustment.get_lower())); adjustment.set_value (fract * (adjustment.get_upper() - adjustment.get_lower()));
} }
break; break;