summaryrefslogtreecommitdiff
path: root/gtk2_ardour/route_time_axis.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-12-06 12:20:52 -0500
committerDavid Robillard <d@drobilla.net>2014-12-06 12:20:52 -0500
commit63082821d87a8be61982adc551a35fd399f346a2 (patch)
tree68fdf3115c3ba8fe87ed99a076aad5ff8a1b3792 /gtk2_ardour/route_time_axis.cc
parentdb1fc6c3fa5129f0ac20c6668339c477c8ee9447 (diff)
Support paste between automation lanes.
Also push the increasingly unwieldly paste parameters into a context object. As with othe things, currently it is only possible to do "cross-type paste" by explicitly selecting the target track. We will need to get automation region view selection working to do better here, but at least for now it's possible to get the data over.
Diffstat (limited to 'gtk2_ardour/route_time_axis.cc')
-rw-r--r--gtk2_ardour/route_time_axis.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc
index d741b70501..0e71f858a4 100644
--- a/gtk2_ardour/route_time_axis.cc
+++ b/gtk2_ardour/route_time_axis.cc
@@ -67,6 +67,7 @@
#include "gui_thread.h"
#include "item_counts.h"
#include "keyboard.h"
+#include "paste_context.h"
#include "playlist_selector.h"
#include "point_selection.h"
#include "prompter.h"
@@ -1572,7 +1573,7 @@ RouteTimeAxisView::cut_copy_clear (Selection& selection, CutCopyOp op)
}
bool
-RouteTimeAxisView::paste (framepos_t pos, unsigned paste_count, float times, const Selection& selection, ItemCounts& counts)
+RouteTimeAxisView::paste (framepos_t pos, const Selection& selection, PasteContext& ctx)
{
if (!is_track()) {
return false;
@@ -1580,12 +1581,12 @@ RouteTimeAxisView::paste (framepos_t pos, unsigned paste_count, float times, con
boost::shared_ptr<Playlist> pl = playlist ();
const ARDOUR::DataType type = pl->data_type();
- PlaylistSelection::const_iterator p = selection.playlists.get_nth(type, counts.n_playlists(type));
+ PlaylistSelection::const_iterator p = selection.playlists.get_nth(type, ctx.counts.n_playlists(type));
if (p == selection.playlists.end()) {
return false;
}
- counts.increase_n_playlists(type);
+ ctx.counts.increase_n_playlists(type);
DEBUG_TRACE (DEBUG::CutNPaste, string_compose ("paste to %1\n", pos));
@@ -1597,15 +1598,15 @@ RouteTimeAxisView::paste (framepos_t pos, unsigned paste_count, float times, con
/* 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);
+ pos += _editor.get_paste_offset(pos, ctx.count, duration);
pl->clear_changes ();
if (Config->get_edit_mode() == Ripple) {
std::pair<framepos_t, framepos_t> extent = (*p)->get_extent_with_endspace();
framecnt_t amount = extent.second - extent.first;
- pl->ripple(pos, amount * times, boost::shared_ptr<Region>());
+ pl->ripple(pos, amount * ctx.times, boost::shared_ptr<Region>());
}
- pl->paste (*p, pos, times);
+ pl->paste (*p, pos, ctx.times);
vector<Command*> cmds;
pl->rdiff (cmds);