diff options
author | Nick Mainsbridge <beatroute@iprimus.com.au> | 2006-01-23 16:02:48 +0000 |
---|---|---|
committer | Nick Mainsbridge <beatroute@iprimus.com.au> | 2006-01-23 16:02:48 +0000 |
commit | dfcd837d67f7653addde7f8760a6b7dcf94b51fc (patch) | |
tree | 846395d244afc60cd655b1b963ba9d845fd12ca7 /gtk2_ardour/editor_ops.cc | |
parent | 51093cc589ff35d037b8ee77ffc6b834c219af86 (diff) |
select all, musical (fuzzy) loop/punch/range region selections, soundtouch patch for gcc 4.1, needs 's' key to not clear selection.
git-svn-id: svn://localhost/trunk/ardour2@289 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_ops.cc')
-rw-r--r-- | gtk2_ardour/editor_ops.cc | 63 |
1 files changed, 61 insertions, 2 deletions
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index e9439b60d6..640d8b09b8 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -1306,11 +1306,48 @@ Editor::set_selection_from_loop() if ((location = session->locations()->auto_loop_location()) == 0) { return; } - set_selection_from_range (*location); } void +Editor::select_all_from_punch() +{ + Location* location; + list<Selectable *> touched; + if ((location = session->locations()->auto_punch_location()) == 0) { + return; + } + + for (TrackViewList::iterator iter = track_views.begin(); iter != track_views.end(); ++iter) { + if ((*iter)->hidden()) { + continue; + } + (*iter)->get_selectables (location->start(), location->end(), 0, DBL_MAX, touched); + } + selection->set (touched); + +} + +void +Editor::select_all_from_loop() +{ + Location* location; + list<Selectable *> touched; + + if ((location = session->locations()->auto_loop_location()) == 0) { + return; + } + for (TrackViewList::iterator iter = track_views.begin(); iter != track_views.end(); ++iter) { + if ((*iter)->hidden()) { + continue; + } + (*iter)->get_selectables (location->start(), location->end(), 0, DBL_MAX, touched); + } + selection->set (touched); + +} + +void Editor::set_selection_from_range (Location& range) { if (clicked_trackview == 0) { @@ -1323,6 +1360,29 @@ Editor::set_selection_from_range (Location& range) } void +Editor::select_all_after_cursor (Cursor *cursor, bool after) +{ + jack_nframes_t start; + jack_nframes_t end; + list<Selectable *> touched; + + if (after) { + start = cursor->current_frame ; + end = session->current_end_frame(); + } else { + start = 0; + end = cursor->current_frame ; + } + 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); +} + +void Editor::amplitude_zoom_step (bool in) { gdouble zoom = 1.0; @@ -2654,7 +2714,6 @@ Editor::set_region_sync_from_edit_cursor () } Region& region (clicked_regionview->region); - begin_reversible_command (_("set sync from edit cursor")); session->add_undo (region.playlist()->get_memento()); region.set_sync_position (edit_cursor->current_frame); |