Paste to the source of a copy if there are no selected tracks (rather than using the track under the mouse). Fixes #3333.
git-svn-id: svn://localhost/ardour2/branches/3.0@7729 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
e76c4ee06d
commit
b9191eb0c5
|
@ -303,6 +303,7 @@ Editor::Editor ()
|
|||
, meters_running(false)
|
||||
, _pending_locate_request (false)
|
||||
, _pending_initial_locate (false)
|
||||
, _last_cut_copy_source_track (0)
|
||||
{
|
||||
constructed = false;
|
||||
|
||||
|
|
|
@ -2044,6 +2044,11 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
|||
RegionLayeringOrderEditor* layering_order_editor;
|
||||
void update_region_layering_order_editor (ARDOUR::framepos_t);
|
||||
|
||||
/** Track that was the source for the last cut/copy operation. Used as a place
|
||||
to paste things iff there is no selected track.
|
||||
*/
|
||||
TimeAxisView* _last_cut_copy_source_track;
|
||||
|
||||
friend class Drag;
|
||||
friend class RegionDrag;
|
||||
friend class RegionMoveDrag;
|
||||
|
|
|
@ -4213,10 +4213,15 @@ Editor::cut_copy_regions (CutCopyOp op, RegionSelection& rs)
|
|||
foo.push_back ((*i).pl);
|
||||
}
|
||||
|
||||
|
||||
if (!foo.empty()) {
|
||||
cut_buffer->set (foo);
|
||||
}
|
||||
|
||||
if (pmap.empty()) {
|
||||
_last_cut_copy_source_track = 0;
|
||||
} else {
|
||||
_last_cut_copy_source_track = pmap.front().tv;
|
||||
}
|
||||
|
||||
for (FreezeList::iterator pl = freezelist.begin(); pl != freezelist.end(); ++pl) {
|
||||
(*pl)->thaw ();
|
||||
|
@ -4293,10 +4298,14 @@ Editor::paste_internal (nframes64_t position, float times)
|
|||
/* get everything in the correct order */
|
||||
|
||||
if (!selection->tracks.empty()) {
|
||||
/* there are some selected tracks, so paste to them */
|
||||
sort_track_selection ();
|
||||
ts = selection->tracks;
|
||||
} else if (entered_track) {
|
||||
ts.push_back (entered_track);
|
||||
} else if (_last_cut_copy_source_track) {
|
||||
/* otherwise paste to the track that the cut/copy came from;
|
||||
see discussion in mants #3333.
|
||||
*/
|
||||
ts.push_back (_last_cut_copy_source_track);
|
||||
}
|
||||
|
||||
for (nth = 0, i = ts.begin(); i != ts.end(); ++i, ++nth) {
|
||||
|
|
Loading…
Reference in New Issue