Adapt range when copying between automation types.
[ardour.git] / gtk2_ardour / editor_ops.cc
index c84bae6ad44e41e0cdf776499af6c1902d1a469d..69fcf67d16e2526e38a79211fbd5a792c1dab18f 100644 (file)
@@ -4440,26 +4440,25 @@ Editor::paste_internal (framepos_t position, float times)
                   R1.A1, R1.A2, R2, R2.A1, ... */
        }
 
-       if (internal_editing ()) {
+       if (ts.size() == 1 && cut_buffer->lines.size() == 1 &&
+           dynamic_cast<AutomationTimeAxisView*>(ts.front())) {
+           /* Only one line copied, and one automation track selected.  Do a
+              "greedy" paste from one automation type to another. */
+
+           begin_reversible_command (Operations::paste);
+
+           PasteContext ctx(paste_count, times, ItemCounts(), true);
+           ts.front()->paste (position, *cut_buffer, ctx);
+
+           commit_reversible_command ();
+
+       } else if (internal_editing ()) {
 
                /* undo/redo is handled by individual tracks/regions */
 
                RegionSelection rs;
                get_regions_at (rs, position, ts);
 
-               if (ts.size() == 1 && cut_buffer->lines.size() == 1) {
-                       AutomationTimeAxisView* atv = dynamic_cast<AutomationTimeAxisView*>(ts.front());
-                       if (atv) {
-                               /* Only one line, and one automation track selected.  Do a
-                                  "greedy" paste from one automation type to another. */
-                               PasteContext ctx(paste_count, times, ItemCounts(), true);
-                               begin_reversible_command (Operations::paste);
-                               atv->paste (position, *cut_buffer, ctx);
-                               commit_reversible_command ();
-                               return;
-                       }
-               }
-
                PasteContext ctx(paste_count, times, ItemCounts(), false);
                for (RegionSelection::iterator r = rs.begin(); r != rs.end(); ++r) {
                        MidiRegionView* mrv = dynamic_cast<MidiRegionView*> (*r);