From f77763020b3450ad68d7155b84f940bd53225950 Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Wed, 28 Nov 2012 17:07:35 +0000 Subject: [PATCH] edit operations should depend on the existence of an explicit range, NOT the mouse mode. this produces less confusion to the user. For an edit (such as delete) the selection should be based on this priority: explicit range selection, ojbect (region) selection, and then implicit range ( i.e. mouse-to-marker) git-svn-id: svn://localhost/ardour2/branches/3.0@13563 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor.cc | 10 ++-------- gtk2_ardour/editor_markers.cc | 8 +++----- gtk2_ardour/editor_ops.cc | 2 +- gtk2_ardour/editor_selection.cc | 4 ++-- 4 files changed, 8 insertions(+), 16 deletions(-) diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 00a2e8b900..453ad7b4b1 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -3262,15 +3262,9 @@ Editor::duplicate_range (bool with_dialog) { float times = 1.0f; - if (mouse_mode == MouseRange) { - if (selection->time.length() == 0) { - return; - } - } - RegionSelection rs = get_regions_from_selection_and_entered (); - if (mouse_mode != MouseRange && rs.empty()) { + if ( selection->time.length() == 0 && rs.empty()) { return; } @@ -3317,7 +3311,7 @@ Editor::duplicate_range (bool with_dialog) times = adjustment.get_value(); } - if (mouse_mode == MouseRange) { + if (selection->time.length() != 0) { duplicate_selection (times); } else { duplicate_some_regions (rs, times); diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc index 28706ac7bc..1eae5d7b38 100644 --- a/gtk2_ardour/editor_markers.cc +++ b/gtk2_ardour/editor_markers.cc @@ -1175,11 +1175,9 @@ Editor::marker_menu_set_from_selection () /* if range selection use first to last */ - if (mouse_mode == Editing::MouseRange) { - if (!selection->time.empty()) { - l->set_start (selection->time.start()); - l->set_end (selection->time.end_frame()); - } + if (!selection->time.empty()) { + l->set_start (selection->time.start()); + l->set_end (selection->time.end_frame()); } else { if (!selection->regions.empty()) { diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 80afe57d76..eac60fd332 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -2725,7 +2725,7 @@ Editor::separate_region_from_selection () returns a single range. */ - if (mouse_mode == MouseRange && !selection->time.empty()) { + if (!selection->time.empty()) { separate_regions_between (selection->time); diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc index 3f88ddbce5..7ee19bdcec 100644 --- a/gtk2_ardour/editor_selection.cc +++ b/gtk2_ardour/editor_selection.cc @@ -1817,9 +1817,9 @@ Editor::get_edit_op_range (framepos_t& start, framepos_t& end) const framepos_t m; bool ignored; - /* in range mode, use any existing selection */ + /* if an explicit range exists, use it */ - if (mouse_mode == MouseRange && !selection->time.empty()) { + if (!selection->time.empty()) { /* we know that these are ordered */ start = selection->time.start(); end = selection->time.end_frame();