diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2007-11-09 03:36:24 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2007-11-09 03:36:24 +0000 |
commit | 96fa1cd0b636d47d4b0787281fc9401693a77af9 (patch) | |
tree | a722434f290aab01b28b090f5b20bda0d7ad15cd /gtk2_ardour/editor_selection.cc | |
parent | a8d2605f9a6f48f3afb09c212de9486c75856287 (diff) |
the edit cursor is dead, long live the edit point; plus a few fixes; plus location locking
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2610 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_selection.cc')
-rw-r--r-- | gtk2_ardour/editor_selection.cc | 57 |
1 files changed, 46 insertions, 11 deletions
diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc index 4c6f3197d1..9ccd47d87d 100644 --- a/gtk2_ardour/editor_selection.cc +++ b/gtk2_ardour/editor_selection.cc @@ -1003,26 +1003,61 @@ Editor::select_all_selectables_using_cursor (Cursor *cursor, bool after) } void -Editor::select_all_selectables_between_cursors (Cursor *cursor, Cursor *other_cursor) +Editor::select_all_selectables_using_edit (bool after) { nframes_t start; nframes_t end; list<Selectable *> touched; - bool other_cursor_is_first = cursor->current_frame > other_cursor->current_frame; - if (cursor->current_frame == other_cursor->current_frame) { + if (after) { + begin_reversible_command (_("select all after edit")); + start = get_preferred_edit_position(); + end = session->current_end_frame(); + } else { + if ((end = get_preferred_edit_position()) > 1) { + begin_reversible_command (_("select all before edit")); + start = 0; + end -= 1; + } else { + return; + } + } + + for (TrackViewList::iterator iter = track_views.begin(); iter != track_views.end(); ++iter) { + if ((*iter)->hidden()) { + continue; + } + (*iter)->get_selectables (start, end, 0, DBL_MAX, touched); + } + selection->set (touched); + commit_reversible_command (); +} + +void +Editor::select_all_selectables_between () +{ + nframes64_t start; + nframes64_t end; + list<Selectable *> touched; + + if (_edit_point == EditAtPlayhead) { return; } + + start = get_preferred_edit_position(); + end = playhead_cursor->current_frame; - begin_reversible_command (_("select all between cursors")); - if (other_cursor_is_first) { - start = other_cursor->current_frame; - end = cursor->current_frame - 1; - - } else { - start = cursor->current_frame; - end = other_cursor->current_frame - 1; + if (start == end) { + return; + } + + if (start > end) { + swap (start, end); } + + begin_reversible_command (_("select all between cursors")); + + end -= 1; for (TrackViewList::iterator iter = track_views.begin(); iter != track_views.end(); ++iter) { if ((*iter)->hidden()) { |