summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2012-06-02 18:06:46 +0000
committerCarl Hetherington <carl@carlh.net>2012-06-02 18:06:46 +0000
commite5024657fc5970691c7d8f89c49a7bb9895e1b04 (patch)
tree24826daba73d2c1e57c702aa5e24f74203ee5e6c
parentc1f46b15d2d84b1cf6849635996192b146580fde (diff)
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
-rw-r--r--gtk2_ardour/editor.h2
-rw-r--r--gtk2_ardour/editor_keys.cc1
-rw-r--r--gtk2_ardour/editor_ops.cc27
3 files changed, 6 insertions, 24 deletions
diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h
index 0dd162ca20..eaf682b9b8 100644
--- a/gtk2_ardour/editor.h
+++ b/gtk2_ardour/editor.h
@@ -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*);
diff --git a/gtk2_ardour/editor_keys.cc b/gtk2_ardour/editor_keys.cc
index d887697d63..93eba4b79f 100644
--- a/gtk2_ardour/editor_keys.cc
+++ b/gtk2_ardour/editor_keys.cc
@@ -87,6 +87,5 @@ Editor::keyboard_selection_begin ()
void
Editor::keyboard_paste ()
{
- ensure_entered_track_selected (true);
paste (1);
}
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc
index ec6a6463b7..d3ce0492c5 100644
--- a/gtk2_ardour/editor_ops.cc
+++ b/gtk2_ardour/editor_ops.cc
@@ -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 */