summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_mouse.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2015-01-13 23:30:37 -0500
committerDavid Robillard <d@drobilla.net>2015-01-13 23:30:37 -0500
commitd39d4c1c118960fe482caab9a2c10ca06d1aafa6 (patch)
treec8538b33fbd338eadd4b7f026197d74837c894d8 /gtk2_ardour/editor_mouse.cc
parent88e6995b14e83d7f22166abec0656a60b0111424 (diff)
Fix automation range drag and implement for MIDI.
Range select rect sticks around now after switching to the draw tool, but disappears if a note selection is made. Not sure if draw is really the most appropriate tool here (particularly if we ever implement actual pencil-like drawing); edit contents seems more appropriate but that would probably cause more selection issues, so here we are.
Diffstat (limited to 'gtk2_ardour/editor_mouse.cc')
-rw-r--r--gtk2_ardour/editor_mouse.cc54
1 files changed, 27 insertions, 27 deletions
diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc
index d0df73e3e8..8ec03d778d 100644
--- a/gtk2_ardour/editor_mouse.cc
+++ b/gtk2_ardour/editor_mouse.cc
@@ -336,29 +336,28 @@ void
Editor::update_time_selection_display ()
{
switch (mouse_mode) {
- case MouseRange:
- selection->clear_objects ();
- selection->ClearMidiNoteSelection(); //signal
- break;
- case MouseObject:
- selection->clear_objects ();
- selection->clear_time ();
- selection->clear_tracks ();
- selection->ClearMidiNoteSelection(); //signal
- break;
- case MouseContent:
- case MouseDraw:
- //if we go into internal editing, clear everything in the outside world
- selection->clear_objects ();
- selection->clear_time ();
- selection->clear_tracks ();
- break;
- default:
- //clear everything
- selection->clear_objects ();
- selection->clear_time ();
- selection->clear_tracks ();
- break;
+ case MouseRange:
+ selection->clear_objects ();
+ selection->ClearMidiNoteSelection (); /* EMIT SIGNAL */
+ break;
+ case MouseObject:
+ selection->clear_objects ();
+ selection->clear_time ();
+ selection->clear_tracks ();
+ selection->ClearMidiNoteSelection (); /* EMIT SIGNAL */
+ break;
+ case MouseDraw:
+ /* Clear top level objects, but not time or tracks, since that
+ woulddestroy the range selection rectangle, which we need to stick
+ around for AutomationRangeDrag. */
+ selection->clear_objects ();
+ break;
+ default:
+ /* Clear everything. */
+ selection->clear_objects ();
+ selection->clear_time ();
+ selection->clear_tracks ();
+ break;
}
}
@@ -920,12 +919,13 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
case SelectionItem:
{
- AudioRegionView* arv = dynamic_cast<AudioRegionView *> (clicked_regionview);
- if (arv) {
- _drags->set (new AutomationRangeDrag (this, arv, selection->time), event, _cursors->up_down);
+ if (dynamic_cast<AudioRegionView*>(clicked_regionview) ||
+ dynamic_cast<AutomationRegionView*>(clicked_regionview)) {
+ _drags->set (new AutomationRangeDrag (this, clicked_regionview, selection->time),
+ event, _cursors->up_down);
} else {
double const y = event->button.y;
- pair<TimeAxisView*, int> tvp = trackview_by_y_position (y);
+ pair<TimeAxisView*, int> tvp = trackview_by_y_position (y, false);
if (tvp.first) {
AutomationTimeAxisView* atv = dynamic_cast<AutomationTimeAxisView*> (tvp.first);
if ( atv) {