summaryrefslogtreecommitdiff
path: root/gtk2_ardour/midi_region_view.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/midi_region_view.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/midi_region_view.cc')
-rw-r--r--gtk2_ardour/midi_region_view.cc11
1 files changed, 6 insertions, 5 deletions
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 ();