remove method and inline its contents. Nothing gained by wrapping this up
[ardour.git] / gtk2_ardour / editor_drag.cc
index e80f28171c84f47d124fd7064826e48febac7f24..0b6b1e34b328b90d82af22acd1256730e7457060 100644 (file)
@@ -381,7 +381,7 @@ Drag::setup_snap_delta (MusicSample pos)
 {
        TempoMap& map (_editor->session()->tempo_map());
        MusicSample snap (pos);
-       _editor->snap_to (snap, ARDOUR::RoundNearest, ARDOUR::SnapToAny, false, true);
+       _editor->snap_to (snap, ARDOUR::RoundNearest, ARDOUR::SnapToAny_Visual, true);
        _snap_delta = snap.sample - pos.sample;
 
        _snap_delta_music = 0.0;
@@ -1428,6 +1428,10 @@ RegionMoveDrag::finished (GdkEvent* ev, bool movement_occurred)
 RouteTimeAxisView*
 RegionMoveDrag::create_destination_time_axis (boost::shared_ptr<Region> region, TimeAxisView* original)
 {
+       if (!ARDOUR_UI_UTILS::engine_is_running ()) {
+               return NULL;
+       }
+
        /* Add a new track of the correct type, and return the RouteTimeAxisView that is created to display the
           new track.
         */
@@ -5092,7 +5096,7 @@ RubberbandSelectDrag::motion (GdkEvent* event, bool)
        MusicSample grab (grab_sample (), 0);
 
        if (UIConfiguration::instance().get_rubberbanding_snaps_to_grid ()) {
-               _editor->snap_to_with_modifier (grab, event, RoundNearest, SnapToGrid);
+               _editor->snap_to_with_modifier (grab, event, RoundNearest, SnapToGrid_Scaled);
        } else {
                grab.sample = raw_grab_sample ();
        }
@@ -5675,12 +5679,16 @@ SelectionDrag::finished (GdkEvent* event, bool movement_occurred)
 
                /* XXX what if its a music time selection? */
                if (s) {
-                       if (s->get_play_range() && s->transport_rolling()) {
-                               s->request_play_range (&_editor->selection->time, true);
-                       } else if (!s->config.get_external_sync()) {
-                               if (UIConfiguration::instance().get_follow_edits() && !s->transport_rolling()) {
-                                       s->request_locate (_editor->get_selection().time.start());
+
+                       //if Follow Edits is on, maybe try to follow the range selection  ... also consider range-audition mode
+                       if ( !s->config.get_external_sync() && s->transport_rolling() ) {
+                               if ( s->solo_selection_active() ) {
+                                       _editor->play_solo_selection(true);  //play the newly selected range, and move solos to match
+                               } else if ( UIConfiguration::instance().get_follow_edits() && s->get_play_range() ) {  //already rolling a selected range
+                                       s->request_play_range (&_editor->selection->time, true);  //play the newly selected range
                                }
+                       } else if ( !s->transport_rolling() && UIConfiguration::instance().get_follow_edits() ) {
+                               s->request_locate (_editor->get_selection().time.start());
                        }
 
                        if (_editor->get_selection().time.length() != 0) {
@@ -6071,7 +6079,7 @@ NoteDrag::total_dx (GdkEvent * event) const
 
        /* possibly snap and return corresponding delta in quarter notes */
        MusicSample snap (st, 0);
-       _editor->snap_to_with_modifier (snap, event, RoundNearest, SnapToGrid);
+       _editor->snap_to_with_modifier (snap, event, RoundNearest, SnapToGrid_Unscaled);
        double ret = map.exact_qn_at_sample (snap.sample, snap.division) - n_qn - snap_delta_music (event->button.state);
 
        /* prevent the earliest note being dragged earlier than the region's start position */
@@ -6990,7 +6998,7 @@ RegionCutDrag::finished (GdkEvent* event, bool)
                return;
        }
 
-       _editor->split_regions_at (pos, rs, false);
+       _editor->split_regions_at (pos, rs);
 }
 
 void