From 63082821d87a8be61982adc551a35fd399f346a2 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 6 Dec 2014 12:20:52 -0500 Subject: 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. --- gtk2_ardour/midi_region_view.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'gtk2_ardour/midi_region_view.cc') diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index 54c37267a7..bad479bc26 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -66,6 +66,7 @@ #include "midi_velocity_dialog.h" #include "mouse_cursors.h" #include "note_player.h" +#include "paste_context.h" #include "public_editor.h" #include "route_time_axis.h" #include "rgb_macros.h" @@ -3322,22 +3323,22 @@ MidiRegionView::selection_as_cut_buffer () const /** This method handles undo */ bool -MidiRegionView::paste (framepos_t pos, unsigned paste_count, float times, const ::Selection& selection, ItemCounts& counts) +MidiRegionView::paste (framepos_t pos, const ::Selection& selection, PasteContext& ctx) { trackview.session()->begin_reversible_command (Operations::paste); // Paste notes, if available - MidiNoteSelection::const_iterator m = selection.midi_notes.get_nth(counts.n_notes()); + MidiNoteSelection::const_iterator m = selection.midi_notes.get_nth(ctx.counts.n_notes()); if (m != selection.midi_notes.end()) { - counts.increase_n_notes(); - paste_internal(pos, paste_count, times, **m); + ctx.counts.increase_n_notes(); + paste_internal(pos, ctx.count, ctx.times, **m); } // Paste control points to automation children, if available typedef RouteTimeAxisView::AutomationTracks ATracks; const ATracks& atracks = midi_view()->automation_tracks(); for (ATracks::const_iterator a = atracks.begin(); a != atracks.end(); ++a) { - a->second->paste(pos, paste_count, times, selection, counts); + a->second->paste(pos, selection, ctx); } trackview.session()->commit_reversible_command (); -- cgit v1.2.3