diff options
author | David Robillard <d@drobilla.net> | 2014-12-06 12:20:52 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-12-06 12:20:52 -0500 |
commit | 63082821d87a8be61982adc551a35fd399f346a2 (patch) | |
tree | 68fdf3115c3ba8fe87ed99a076aad5ff8a1b3792 /gtk2_ardour/editor_ops.cc | |
parent | db1fc6c3fa5129f0ac20c6668339c477c8ee9447 (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/editor_ops.cc')
-rw-r--r-- | gtk2_ardour/editor_ops.cc | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 00703dfc94..c84bae6ad4 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -83,6 +83,7 @@ #include "mixer_strip.h" #include "mouse_cursors.h" #include "normalize_dialog.h" +#include "paste_context.h" #include "patch_change_dialog.h" #include "quantize_dialog.h" #include "region_gain_line.h" @@ -4446,11 +4447,24 @@ Editor::paste_internal (framepos_t position, float times) RegionSelection rs; get_regions_at (rs, position, ts); - ItemCounts counts; + 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); if (mrv) { - mrv->paste (position, paste_count, times, *cut_buffer, counts); + mrv->paste (position, *cut_buffer, ctx); } } @@ -4460,9 +4474,9 @@ Editor::paste_internal (framepos_t position, float times) begin_reversible_command (Operations::paste); - ItemCounts counts; + PasteContext ctx(paste_count, times, ItemCounts(), false); for (TrackViewList::iterator i = ts.begin(); i != ts.end(); ++i) { - (*i)->paste (position, paste_count, times, *cut_buffer, counts); + (*i)->paste (position, *cut_buffer, ctx); } commit_reversible_command (); |