From 0031a1424f24342164e95f2b9c64b222375fef52 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sun, 11 Nov 2007 22:00:26 +0000 Subject: [PATCH] fix up return and alt-return behaviour git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2618 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor_ops.cc | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 73681bd62c..2a57d4e41c 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -1041,26 +1041,32 @@ Editor::playhead_forward () void Editor::cursor_align (bool playhead_to_edit) { + if (!session) { + return; + } + if (playhead_to_edit) { - if (session) { - session->request_locate (get_preferred_edit_position()); + + if (selection->markers.empty()) { + return; } + + session->request_locate (selection->markers.front()->position(), session->transport_rolling()); + } else { - if (_edit_point == EditAtSelectedMarker) { - /* move selected markers to playhead */ - - for (MarkerSelection::iterator i = selection->markers.begin(); i != selection->markers.end(); ++i) { - bool ignored; - - Location* loc = find_location_from_marker (*i, ignored); - - if (loc->is_mark()) { - loc->set_start (playhead_cursor->current_frame); - } else { - loc->set (playhead_cursor->current_frame, - playhead_cursor->current_frame + loc->length()); - } + /* move selected markers to playhead */ + + for (MarkerSelection::iterator i = selection->markers.begin(); i != selection->markers.end(); ++i) { + bool ignored; + + Location* loc = find_location_from_marker (*i, ignored); + + if (loc->is_mark()) { + loc->set_start (playhead_cursor->current_frame); + } else { + loc->set (playhead_cursor->current_frame, + playhead_cursor->current_frame + loc->length()); } } }