summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_ops.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-01-18 15:16:05 +0100
committerRobin Gareus <robin@gareus.org>2017-01-18 15:16:05 +0100
commit645402bc42879364a16c0d6c230e9125bd0aeb1f (patch)
treeba7a9e632575466f2221ec5441e3d5b9dfdeeda3 /gtk2_ardour/editor_ops.cc
parentefd10abdfb54bb1dd56de0aa01278805f5fbf332 (diff)
Add GUI action to record with preroll
Diffstat (limited to 'gtk2_ardour/editor_ops.cc')
-rw-r--r--gtk2_ardour/editor_ops.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc
index 633a6989d8..95be0ed972 100644
--- a/gtk2_ardour/editor_ops.cc
+++ b/gtk2_ardour/editor_ops.cc
@@ -2666,6 +2666,20 @@ Editor::play_with_preroll ()
}
void
+Editor::rec_with_preroll ()
+{
+ framepos_t preroll = get_preroll();
+ framepos_t ph = playhead_cursor->current_frame ();
+ framepos_t start = std::max ((framepos_t)0, ph - preroll);
+
+ _session->request_preroll_record (ph);
+ _session->maybe_enable_record ();
+ _session->request_locate (start, true);
+ _session->set_requested_return_frame (ph);
+}
+
+
+void
Editor::play_location (Location& location)
{
if (location.start() <= location.end()) {