make middle-click on piano roll track header more usefully select/unselect notes
[ardour.git] / gtk2_ardour / editor_drag.cc
index c252255bb8eee861e56ace6014a91e534020618c..01d81a156d29b645b7b5126a997b271ac024077b 100644 (file)
@@ -397,8 +397,8 @@ Drag::show_verbose_cursor_time (framepos_t frame)
 {
        _editor->verbose_cursor()->set_time (
                frame,
-               _drags->current_pointer_x() + 10 - _editor->horizontal_position(),
-               _drags->current_pointer_y() + 10 - _editor->vertical_adjustment.get_value()
+               _drags->current_pointer_x() + 10,
+               _drags->current_pointer_y() + 10
                );
 
        _editor->verbose_cursor()->show ();
@@ -411,8 +411,8 @@ Drag::show_verbose_cursor_duration (framepos_t start, framepos_t end, double xof
 
        _editor->verbose_cursor()->set_duration (
                start, end,
-               _drags->current_pointer_x() + 10 - _editor->horizontal_position(),
-               _drags->current_pointer_y() + 10 - _editor->vertical_adjustment.get_value()
+               _drags->current_pointer_x() + 10,
+               _drags->current_pointer_y() + 10
                );
 }
 
@@ -423,8 +423,8 @@ Drag::show_verbose_cursor_text (string const & text)
 
        _editor->verbose_cursor()->set (
                text,
-               _drags->current_pointer_x() + 10 - _editor->horizontal_position(),
-               _drags->current_pointer_y() + 10 - _editor->vertical_adjustment.get_value()
+               _drags->current_pointer_x() + 10,
+               _drags->current_pointer_y() + 10
                );
 }
 
@@ -450,7 +450,7 @@ struct EditorOrderTimeAxisViewSorter {
            RouteTimeAxisView* ra = dynamic_cast<RouteTimeAxisView*> (a);
            RouteTimeAxisView* rb = dynamic_cast<RouteTimeAxisView*> (b);
            assert (ra && rb);
-           return ra->route()->order_key (EditorSort) < rb->route()->order_key (EditorSort);
+           return ra->route()->order_key () < rb->route()->order_key ();
     }
 };
 
@@ -1281,8 +1281,13 @@ void
 RegionMotionDrag::aborted (bool)
 {
        for (vector<TimeAxisView*>::iterator i = _time_axis_views.begin(); i != _time_axis_views.end(); ++i) {
-               if ((*i)->view()->layer_display() == Expanded) {
-                       (*i)->view()->set_layer_display (Stacked);
+
+               StreamView* sview = (*i)->view();
+
+               if (sview) {
+                       if (sview->layer_display() == Expanded) {
+                               sview->set_layer_display (Stacked);
+                       }
                }
        }
        
@@ -1682,7 +1687,7 @@ VideoTimeLineDrag::motion (GdkEvent* event, bool first_move)
        }
 
        framecnt_t dt = adjusted_current_frame (event) - raw_grab_frame() + _pointer_frame_offset;
-       dt = ARDOUR_UI::instance()->video_timeline->quantify_frames_to_apv(dt);
+       dt = ARDOUR_UI::instance()->video_timeline->quantify_frames_to_apv(_startdrag_video_offset+dt) - _startdrag_video_offset;
 
        if (_max_backwards_drag >= 0 && dt <= - _max_backwards_drag) {
                dt = - _max_backwards_drag;
@@ -2372,8 +2377,14 @@ CursorDrag::fake_locate (framepos_t t)
        Session* s = _editor->session ();
        if (s->timecode_transmission_suspended ()) {
                framepos_t const f = _editor->playhead_cursor->current_frame ();
+               /* This is asynchronous so it will be sent "now"
+                */
                s->send_mmc_locate (f);
-               s->send_full_time_code (f);
+               /* These are synchronous and will be sent during the next
+                  process cycle
+               */
+               s->queue_full_time_code ();
+               s->queue_song_position_pointer ();
        }
 
        show_verbose_cursor_time (t);
@@ -2387,7 +2398,7 @@ CursorDrag::start_grab (GdkEvent* event, Gdk::Cursor* c)
 
        _grab_zoom = _editor->samples_per_pixel;
 
-       framepos_t where = _editor->canvas_event_frame (event, 0, 0);
+       framepos_t where = _editor->canvas_event_frame (event);
 
        _editor->snap_to_with_modifier (where, event);