summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_selection.cc
diff options
context:
space:
mode:
authorBen Loftis <ben@harrisonconsoles.com>2014-07-02 09:18:31 -0500
committerBen Loftis <ben@harrisonconsoles.com>2014-07-02 09:18:31 -0500
commit3047919833f987d2199705e09968606046f2f969 (patch)
treef07c097e17c42b03c3d7b072b4bb268467f008a2 /gtk2_ardour/editor_selection.cc
parent190542c1d0bc81b498229453e62e85b42bdf8246 (diff)
remove implicit range. start-range and end-range work better. documentation changes coming soon
Diffstat (limited to 'gtk2_ardour/editor_selection.cc')
-rw-r--r--gtk2_ardour/editor_selection.cc156
1 files changed, 80 insertions, 76 deletions
diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc
index 3ad49e9edc..01d3d3e418 100644
--- a/gtk2_ardour/editor_selection.cc
+++ b/gtk2_ardour/editor_selection.cc
@@ -1842,98 +1842,102 @@ Editor::select_range_between ()
bool
Editor::get_edit_op_range (framepos_t& start, framepos_t& end) const
{
- framepos_t m;
- bool ignored;
+// framepos_t m;
+// bool ignored;
/* if an explicit range exists, use it */
- if (!selection->time.empty()) {
+ if ( (mouse_mode == MouseRange || get_smart_mode() ) && !selection->time.empty()) {
/* we know that these are ordered */
start = selection->time.start();
end = selection->time.end_frame();
return true;
- }
-
- if (!mouse_frame (m, ignored)) {
- /* mouse is not in a canvas, try playhead+selected marker.
- this is probably most true when using menus.
- */
-
- if (selection->markers.empty()) {
- return false;
- }
-
- start = selection->markers.front()->position();
- end = _session->audible_frame();
-
} else {
-
- switch (_edit_point) {
- case EditAtPlayhead:
- if (selection->markers.empty()) {
- /* use mouse + playhead */
- start = m;
- end = _session->audible_frame();
- } else {
- /* use playhead + selected marker */
- start = _session->audible_frame();
- end = selection->markers.front()->position();
- }
- break;
-
- case EditAtMouse:
- /* use mouse + selected marker */
- if (selection->markers.empty()) {
- start = m;
- end = _session->audible_frame();
- } else {
- start = selection->markers.front()->position();
- end = m;
- }
- break;
-
- case EditAtSelectedMarker:
- /* use mouse + selected marker */
- if (selection->markers.empty()) {
-
- MessageDialog win (_("No edit range defined"),
- false,
- MESSAGE_INFO,
- BUTTONS_OK);
-
- win.set_secondary_text (
- _("the edit point is Selected Marker\nbut there is no selected marker."));
-
-
- win.set_default_response (RESPONSE_CLOSE);
- win.set_position (Gtk::WIN_POS_MOUSE);
- win.show_all();
-
- win.run ();
-
- return false; // NO RANGE
- }
- start = selection->markers.front()->position();
- end = m;
- break;
- }
- }
-
- if (start == end) {
+ start = 0;
+ end = 0;
return false;
}
-
- if (start > end) {
- swap (start, end);
- }
+
+// if (!mouse_frame (m, ignored)) {
+// /* mouse is not in a canvas, try playhead+selected marker.
+// this is probably most true when using menus.
+// */
+//
+// if (selection->markers.empty()) {
+// return false;
+// }
+
+// start = selection->markers.front()->position();
+// end = _session->audible_frame();
+
+// } else {
+
+// switch (_edit_point) {
+// case EditAtPlayhead:
+// if (selection->markers.empty()) {
+// /* use mouse + playhead */
+// start = m;
+// end = _session->audible_frame();
+// } else {
+// /* use playhead + selected marker */
+// start = _session->audible_frame();
+// end = selection->markers.front()->position();
+// }
+// break;
+
+// case EditAtMouse:
+// /* use mouse + selected marker */
+// if (selection->markers.empty()) {
+// start = m;
+// end = _session->audible_frame();
+// } else {
+// start = selection->markers.front()->position();
+// end = m;
+// }
+// break;
+
+// case EditAtSelectedMarker:
+// /* use mouse + selected marker */
+// if (selection->markers.empty()) {
+
+// MessageDialog win (_("No edit range defined"),
+// false,
+// MESSAGE_INFO,
+// BUTTONS_OK);
+
+// win.set_secondary_text (
+// _("the edit point is Selected Marker\nbut there is no selected marker."));
+
+
+// win.set_default_response (RESPONSE_CLOSE);
+// win.set_position (Gtk::WIN_POS_MOUSE);
+// win.show_all();
+
+// win.run ();
+
+// return false; // NO RANGE
+// }
+// start = selection->markers.front()->position();
+// end = m;
+// break;
+// }
+// }
+
+// if (start == end) {
+// return false;
+// }
+
+// if (start > end) {
+// swap (start, end);
+// }
/* turn range into one delimited by start...end,
not start...end-1
*/
- end++;
+// end++;
- return true;
+// return true;
}
void