diff options
author | David Robillard <d@drobilla.net> | 2014-12-06 13:37:08 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-12-06 13:40:35 -0500 |
commit | 4650912ae36ef79fd342a6e183e0bc205d3326c2 (patch) | |
tree | 3af63c1b0dc9dfdbb16441e35b7c0a966c254d3f /gtk2_ardour/editor_ops.cc | |
parent | 96a9292a407dd90b85ed6bebae932c096b357ce8 (diff) |
Adapt range when copying between automation types.
For things like copying from pitch bender to a CC.
Also things like fader to pan, but that seems a bit funny. The conversion
probably needs to be a bit smarter here, perhaps taking the normal into
consideration...
Diffstat (limited to 'gtk2_ardour/editor_ops.cc')
-rw-r--r-- | gtk2_ardour/editor_ops.cc | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index c84bae6ad4..69fcf67d16 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -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); |