Paste to the track under the mouse if we are using the mouse
authorCarl Hetherington <carl@carlh.net>
Sat, 2 Jun 2012 18:06:46 +0000 (18:06 +0000)
committerCarl Hetherington <carl@carlh.net>
Sat, 2 Jun 2012 18:06:46 +0000 (18:06 +0000)
as the edit point, otherwise use selected tracks (#4595).

git-svn-id: svn://localhost/ardour2/branches/3.0@12547 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/editor.h
gtk2_ardour/editor_keys.cc
gtk2_ardour/editor_ops.cc

index 0dd162ca200f5cb81156ce17d1f65719e67e974c..eaf682b9b82689471bbce5fd7954cbbd0dd15149 100644 (file)
@@ -1944,8 +1944,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        */
        RegionView*   entered_regionview;
 
-
-       void ensure_entered_track_selected (bool op_acts_on_objects = false);
        bool clear_entered_track;
        bool left_track_canvas (GdkEventCrossing*);
        bool entered_track_canvas (GdkEventCrossing*);
index d887697d637510ba90e1e7c25c57dd6b7f9cf632..93eba4b79f02c24b714b52de0212bd4247acba90 100644 (file)
@@ -87,6 +87,5 @@ Editor::keyboard_selection_begin ()
 void
 Editor::keyboard_paste ()
 {
-       ensure_entered_track_selected (true);
        paste (1);
 }
index ec6a6463b752390a6aba6d564bae1a5391a12e04..d3ce0492c5ea4813115166dc4cb5a05dd4fcb37a 100644 (file)
@@ -4171,12 +4171,15 @@ Editor::paste_internal (framepos_t position, float times)
 
        /* get everything in the correct order */
 
-       if (!selection->tracks.empty()) {
-               /* there are some selected tracks, so paste to them */
+       if (_edit_point == Editing::EditAtMouse && entered_track) {
+               /* With the mouse edit point, paste onto the track under the mouse */
+               ts.push_back (entered_track);
+       } else if (!selection->tracks.empty()) {
+               /* Otherwise, if there are some selected tracks, paste to them */
                ts = selection->tracks.filter_to_unique_playlists ();
                sort_track_selection (ts);
        } else if (_last_cut_copy_source_track) {
-               /* otherwise paste to the track that the cut/copy came from;
+               /* Otherwise paste to the track that the cut/copy came from;
                   see discussion in mantis #3333.
                */
                ts.push_back (_last_cut_copy_source_track);
@@ -5388,24 +5391,6 @@ Editor::split_region ()
        split_regions_at (where, rs);
 }
 
-void
-Editor::ensure_entered_track_selected (bool op_really_wants_one_track_if_none_are_selected)
-{
-       if (entered_track && mouse_mode == MouseObject) {
-               if (!selection->tracks.empty()) {
-                       if (!selection->selected (entered_track)) {
-                               selection->add (entered_track);
-                       }
-               } else {
-                       /* there is no selection, but this operation requires/prefers selected objects */
-
-                       if (op_really_wants_one_track_if_none_are_selected) {
-                               selection->set (entered_track);
-                       }
-               }
-       }
-}
-
 struct EditorOrderRouteSorter {
     bool operator() (boost::shared_ptr<Route> a, boost::shared_ptr<Route> b) {
            /* use of ">" forces the correct sort order */