Add option to zoom using button press in the time rulers and dragging vertically

This is a common operation used for zooming in other DAWs like Ableton Live and
Cubase. To support such a usage pattern without changing the existing behaviour
of the ruler area I've made it an option that is false by default.

The behaviour of RulerDragZoom is intentionally different than a CursorDrag
that occurs in the rest of the ruler area in that it doesn't follow the snap to
grid setting and no locate related stuff occurs until button release.

There are some issues with responsiveness with more than a few hundred regions
or a large amount of MIDI events/notes.

Implements feature #6768
This commit is contained in:
Tim Mayberry 2016-02-09 20:39:27 +10:00
parent 37a7d87786
commit dac2d41ee2
6 changed files with 91 additions and 0 deletions

View file

@ -1078,6 +1078,18 @@ Editor::canvas_ruler_event (GdkEvent *event, ArdourCanvas::Item* item, ItemType
return handled;
}
switch (event->type) {
case GDK_BUTTON_PRESS:
if (UIConfiguration::instance ().get_use_time_rulers_to_zoom_with_vertical_drag () &&
Keyboard::no_modifier_keys_pressed (&event->button) && event->button.button == 1) {
_drags->set(new RulerZoomDrag(this, item), event);
return true;
}
break;
default:
break;
}
return typed_event (item, event, type);
}