Fix bug: sequential pasting to the same time, but different tracks, would trigger...
authorBen Loftis <ben@harrisonconsoles.com>
Tue, 27 Feb 2018 01:40:24 +0000 (19:40 -0600)
committerBen Loftis <ben@harrisonconsoles.com>
Tue, 27 Feb 2018 01:40:24 +0000 (19:40 -0600)
gtk2_ardour/editor_ops.cc
gtk2_ardour/editor_selection.cc

index fba1e2de28b28170b7808c44d7c1253bf71d189a..1773b33b194718308e44fb993c6f4ef4dcbc4f85 100644 (file)
@@ -4774,10 +4774,7 @@ Editor::paste_internal (samplepos_t position, float times, const int32_t sub_num
                DEBUG_TRACE (DEBUG::CutNPaste, string_compose ("preferred edit position is %1\n", position));
        }
 
-       if (position == last_paste_pos) {
-               /* repeated paste in the same position */
-               ++paste_count;
-       } else {
+       if (position != last_paste_pos) {
                /* paste in new location, reset repeated paste state */
                paste_count = 0;
                last_paste_pos = position;
@@ -4866,6 +4863,8 @@ Editor::paste_internal (samplepos_t position, float times, const int32_t sub_num
                }
        }
 
+       ++paste_count;
+
        commit_reversible_command ();
 }
 
index 95cba60704ed00e6a8859b4ef2f1d2cf8874947b..6ee5dc0f38382bfaba3745a4ac8dc8d2d9c6e121 100644 (file)
@@ -1158,6 +1158,11 @@ Editor::presentation_info_changed (PropertyChange const & what_changed)
 void
 Editor::track_selection_changed ()
 {
+cout << "resetting paste count" << endl;
+       /* reset paste count, so the plaste location doesn't get incremented
+        * if we want to paste in the same place, but different track. */ 
+       paste_count = 0;
+       
        if ( _session->solo_selection_active() )
                play_solo_selection(false);
 }