13
0

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; RegionView* entered_regionview;
void ensure_entered_track_selected (bool op_acts_on_objects = false);
bool clear_entered_track; bool clear_entered_track;
bool left_track_canvas (GdkEventCrossing*); bool left_track_canvas (GdkEventCrossing*);
bool entered_track_canvas (GdkEventCrossing*); bool entered_track_canvas (GdkEventCrossing*);

View File

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

View File

@ -4171,12 +4171,15 @@ Editor::paste_internal (framepos_t position, float times)
/* get everything in the correct order */ /* get everything in the correct order */
if (!selection->tracks.empty()) { if (_edit_point == Editing::EditAtMouse && entered_track) {
/* there are some selected tracks, so paste to them */ /* 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 (); ts = selection->tracks.filter_to_unique_playlists ();
sort_track_selection (ts); sort_track_selection (ts);
} else if (_last_cut_copy_source_track) { } 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. see discussion in mantis #3333.
*/ */
ts.push_back (_last_cut_copy_source_track); ts.push_back (_last_cut_copy_source_track);
@ -5388,24 +5391,6 @@ Editor::split_region ()
split_regions_at (where, rs); 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 { struct EditorOrderRouteSorter {
bool operator() (boost::shared_ptr<Route> a, boost::shared_ptr<Route> b) { bool operator() (boost::shared_ptr<Route> a, boost::shared_ptr<Route> b) {
/* use of ">" forces the correct sort order */ /* use of ">" forces the correct sort order */