diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2007-10-11 22:07:47 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2007-10-11 22:07:47 +0000 |
commit | f7f9d6fdc40248b190ec9c6e1a886261d55777ae (patch) | |
tree | 080723e9dc35a66013b37acbafc67a6afa929302 /gtk2_ardour/editor_audiotrack.cc | |
parent | aa1f736a651376534acaa2268b65d42a3786fff7 (diff) |
merge from 2.0-ongoing by hand, minus key binding editor
git-svn-id: svn://localhost/ardour2/trunk@2539 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_audiotrack.cc')
-rw-r--r-- | gtk2_ardour/editor_audiotrack.cc | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/gtk2_ardour/editor_audiotrack.cc b/gtk2_ardour/editor_audiotrack.cc index cdcbb43f76..87fa8a06b8 100644 --- a/gtk2_ardour/editor_audiotrack.cc +++ b/gtk2_ardour/editor_audiotrack.cc @@ -26,11 +26,13 @@ #include "audio_region_view.h" #include "selection.h" +#include "i18n.h" + using namespace ARDOUR; using namespace PBD; void -Editor::set_route_loop_selection () +Editor::set_loop_from_selection (bool play) { if (session == 0 || selection->time.empty()) { return; @@ -38,18 +40,26 @@ Editor::set_route_loop_selection () nframes_t start = selection->time[clicked_selection].start; nframes_t end = selection->time[clicked_selection].end; + + set_loop_range (start, end, _("set loop range from selection")); - Location* loc = transport_loop_location(); - - if (loc) { - - loc->set (start, end); - - // enable looping, reposition and start rolling + if (play) { session->request_play_loop (true); - session->request_locate (loc->start(), true); + session->request_locate (start, true); + } +} + +void +Editor::set_punch_from_selection () +{ + if (session == 0 || selection->time.empty()) { + return; } + nframes_t start = selection->time[clicked_selection].start; + nframes_t end = selection->time[clicked_selection].end; + + set_punch_range (start, end, _("set punch range from selection")); } void |