- if (get_prefix (prefix, was_floating) == 0) {
- duplicate_selection (prefix);
- } else {
- duplicate_selection (1);
+ if ((_edit_point == EditAtPlayhead) && _session->transport_rolling()) {
+ start = _session->audible_frame();
+ } else {
+ start = get_preferred_edit_position();
+ }
+
+ //snap the selection start/end
+ snap_to(start);
+
+ //if there's not already a sensible selection endpoint, go "forever"
+ if ( start > end ) {
+ end = max_framepos;
+ }
+
+ //if no tracks are selected and we're working from the keyboard, enable all tracks (_something_ has to be selected for any range selection)
+ if ( selection->tracks.empty() )
+ select_all_tracks();
+
+ selection->set (start, end);
+
+ //if session is playing a range, cancel that
+ if (_session->get_play_range())
+ _session->request_transport_speed ( 1.0 );
+
+ //if join playhead, locate to the newly selected start
+// if ( !_session->transport_rolling() && Config->get_join_play_range() )
+// _session->request_cancel_play_range();