Fix warning.
[ardour.git] / gtk2_ardour / editor_mouse.cc
index b7357cd53adcdd57bfa9f2bf367b5590f49245fa..d75dce80791f640ce2eb03a10f3d08d463be638f 100644 (file)
@@ -1152,11 +1152,11 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT
                                break;
 
                        case TempoMarkerItem:
-                               tm_marker_context_menu (&event->button, item);
+                               tempo_or_meter_marker_context_menu (&event->button, item);
                                break;
 
                        case MeterMarkerItem:
-                               tm_marker_context_menu (&event->button, item);
+                               tempo_or_meter_marker_context_menu (&event->button, item);
                                break;
 
                        case CrossfadeViewItem:
@@ -2119,7 +2119,7 @@ Editor::cancel_selection ()
 
 
 void
-Editor::single_contents_trim (RegionView& rv, nframes64_t frame_delta, bool left_direction, bool swap_direction, bool obey_snap)
+Editor::single_contents_trim (RegionView& rv, nframes64_t frame_delta, bool left_direction, bool swap_direction)
 {
        boost::shared_ptr<Region> region (rv.region());
 
@@ -2151,15 +2151,12 @@ Editor::single_contents_trim (RegionView& rv, nframes64_t frame_delta, bool left
                }
        }
 
-       if (obey_snap) {
-               snap_to (new_bound);
-       }
        region->trim_start ((nframes64_t) (new_bound * speed), this);
        rv.region_changed (PropertyChange (ARDOUR::Properties::start));
 }
 
 void
-Editor::single_start_trim (RegionView& rv, nframes64_t frame_delta, bool left_direction, bool obey_snap, bool no_overlap)
+Editor::single_start_trim (RegionView& rv, nframes64_t new_bound, bool no_overlap)
 {
        boost::shared_ptr<Region> region (rv.region());
 
@@ -2167,8 +2164,6 @@ Editor::single_start_trim (RegionView& rv, nframes64_t frame_delta, bool left_di
                return;
        }
 
-       nframes64_t new_bound;
-
        double speed = 1.0;
        TimeAxisView* tvp = clicked_axisview;
        RouteTimeAxisView* tv = dynamic_cast<RouteTimeAxisView*>(tvp);
@@ -2177,16 +2172,6 @@ Editor::single_start_trim (RegionView& rv, nframes64_t frame_delta, bool left_di
                speed = tv->track()->speed();
        }
 
-       if (left_direction) {
-               new_bound = (nframes64_t) (region->position()/speed) - frame_delta;
-       } else {
-               new_bound = (nframes64_t) (region->position()/speed) + frame_delta;
-       }
-
-       if (obey_snap) {
-               snap_to (new_bound, (left_direction ? 0 : 1));
-       }
-
        nframes64_t pre_trim_first_frame = region->first_frame();
 
        region->trim_front ((nframes64_t) (new_bound * speed), this);
@@ -2214,7 +2199,7 @@ Editor::single_start_trim (RegionView& rv, nframes64_t frame_delta, bool left_di
 }
 
 void
-Editor::single_end_trim (RegionView& rv, nframes64_t frame_delta, bool left_direction, bool obey_snap, bool no_overlap)
+Editor::single_end_trim (RegionView& rv, nframes64_t new_bound, bool no_overlap)
 {
        boost::shared_ptr<Region> region (rv.region());
 
@@ -2222,8 +2207,6 @@ Editor::single_end_trim (RegionView& rv, nframes64_t frame_delta, bool left_dire
                return;
        }
 
-       nframes64_t new_bound;
-
        double speed = 1.0;
        TimeAxisView* tvp = clicked_axisview;
        RouteTimeAxisView* tv = dynamic_cast<RouteTimeAxisView*>(tvp);
@@ -2232,16 +2215,6 @@ Editor::single_end_trim (RegionView& rv, nframes64_t frame_delta, bool left_dire
                speed = tv->track()->speed();
        }
 
-       if (left_direction) {
-               new_bound = (nframes64_t) ((region->last_frame() + 1)/speed) - frame_delta;
-       } else {
-               new_bound = (nframes64_t) ((region->last_frame() + 1)/speed) + frame_delta;
-       }
-
-       if (obey_snap) {
-               snap_to (new_bound);
-       }
-
        nframes64_t pre_trim_last_frame = region->last_frame();
 
        region->trim_end ((nframes64_t) (new_bound * speed), this);
@@ -2253,8 +2226,8 @@ Editor::single_end_trim (RegionView& rv, nframes64_t frame_delta, bool left_dire
 
                bool regions_touching = false;
 
-               if (region_right != 0 && (pre_trim_last_frame == region_right->first_frame() - 1)){
-                   regions_touching = true;
+               if (region_right != 0 && (pre_trim_last_frame == region_right->first_frame() - 1)) {
+                       regions_touching = true;
                }
 
                //Only trim region on the right if the last frame has gone beyond the right region's first frame.
@@ -2578,7 +2551,7 @@ void
 Editor::escape ()
 {
        if (_drags->active ()) {
-               _drags->break_drag ();
+               _drags->abort ();
        } else {
                selection->clear ();
        }