make middle-click on piano roll track header more usefully select/unselect notes
[ardour.git] / gtk2_ardour / editor_drag.cc
index 1dd79a572541511c53628d8846dfe26e2490dc3e..01d81a156d29b645b7b5126a997b271ac024077b 100644 (file)
@@ -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);