Paste to the track under the mouse if we are using the mouse

as the edit point, otherwise use selected tracks (#4595).


git-svn-id: svn://localhost/ardour2/branches/3.0@12547 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2012-06-02 18:06:46 +00:00
parent c1f46b15d2
commit e5024657fc
3 changed files with 6 additions and 24 deletions

View File

@ -1944,8 +1944,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
*/
RegionView* entered_regionview;
void ensure_entered_track_selected (bool op_acts_on_objects = false);
bool clear_entered_track;
bool left_track_canvas (GdkEventCrossing*);
bool entered_track_canvas (GdkEventCrossing*);

View File

@ -87,6 +87,5 @@ Editor::keyboard_selection_begin ()
void
Editor::keyboard_paste ()
{
ensure_entered_track_selected (true);
paste (1);
}

View File

@ -4171,12 +4171,15 @@ Editor::paste_internal (framepos_t position, float times)
/* get everything in the correct order */
if (!selection->tracks.empty()) {
/* there are some selected tracks, so paste to them */
if (_edit_point == Editing::EditAtMouse && entered_track) {
/* With the mouse edit point, paste onto the track under the mouse */
ts.push_back (entered_track);
} else if (!selection->tracks.empty()) {
/* Otherwise, if there are some selected tracks, paste to them */
ts = selection->tracks.filter_to_unique_playlists ();
sort_track_selection (ts);
} else if (_last_cut_copy_source_track) {
/* otherwise paste to the track that the cut/copy came from;
/* Otherwise paste to the track that the cut/copy came from;
see discussion in mantis #3333.
*/
ts.push_back (_last_cut_copy_source_track);
@ -5388,24 +5391,6 @@ Editor::split_region ()
split_regions_at (where, rs);
}
void
Editor::ensure_entered_track_selected (bool op_really_wants_one_track_if_none_are_selected)
{
if (entered_track && mouse_mode == MouseObject) {
if (!selection->tracks.empty()) {
if (!selection->selected (entered_track)) {
selection->add (entered_track);
}
} else {
/* there is no selection, but this operation requires/prefers selected objects */
if (op_really_wants_one_track_if_none_are_selected) {
selection->set (entered_track);
}
}
}
}
struct EditorOrderRouteSorter {
bool operator() (boost::shared_ptr<Route> a, boost::shared_ptr<Route> b) {
/* use of ">" forces the correct sort order */