diff options
author | David Robillard <d@drobilla.net> | 2014-11-14 20:04:09 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-11-14 20:04:19 -0500 |
commit | 31acd96384b930de928aa8c7969336ba3401bbed (patch) | |
tree | 69137126cf3738fb242a7ff1d3875927c82f7541 /gtk2_ardour/route_time_axis.cc | |
parent | b01d1813f88e303bae724d5bc6f51de0c2fb4e1b (diff) |
Implement "multi-paste" for notes, regions, and automation.
The idea here is that pasting several times to the same location doesn't make
sense. Instead, the paste is appended past the last paste, snapped to the
grid. This make it simple to replicate a given section a number of times,
simply by copying once and pasting several times.
This behaviour only appears when successive pastes are done to the same
location (whatever the edit point is). When the paste point changes, the
"multi-paste" state is reset.
Boots 'n cats 'n boots 'n cats.
Diffstat (limited to 'gtk2_ardour/route_time_axis.cc')
-rw-r--r-- | gtk2_ardour/route_time_axis.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index c4d49e40b9..b447288566 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -1534,7 +1534,7 @@ RouteTimeAxisView::cut_copy_clear (Selection& selection, CutCopyOp op) } bool -RouteTimeAxisView::paste (framepos_t pos, float times, Selection& selection, size_t nth) +RouteTimeAxisView::paste (framepos_t pos, unsigned paste_count, float times, Selection& selection, size_t nth) { if (!is_track()) { return false; @@ -1556,6 +1556,11 @@ RouteTimeAxisView::paste (framepos_t pos, float times, Selection& selection, siz DEBUG_TRACE (DEBUG::CutNPaste, string_compose ("modified paste to %1\n", pos)); } + /* add multi-paste offset if applicable */ + std::pair<framepos_t, framepos_t> extent = (*p)->get_extent(); + const framecnt_t duration = extent.second - extent.first; + pos += _editor.get_paste_offset(pos, paste_count, duration); + pl->clear_changes (); if (Config->get_edit_mode() == Ripple) { std::pair<framepos_t, framepos_t> extent = (*p)->get_extent_with_endspace(); |