<menuitem action='record-roll'/>
<menuitem action='ToggleRollForgetCapture'/>
<menuitem action='Record'/>
+ <menuitem action='RecordPreroll'/>
#if 0
<menuitem action='toggle-skip-playback'/>
#endif
editor->play_with_preroll ();
}
+void
+ARDOUR_UI::transport_rec_preroll ()
+{
+ if (!_session) {
+ return;
+ }
+ editor->rec_with_preroll ();
+}
+
void
ARDOUR_UI::transport_rewind (int option)
{
void transport_roll ();
void transport_play_selection();
void transport_play_preroll();
+ void transport_rec_preroll();
void transport_forward (int option);
void transport_rewind (int option);
void transport_loop ();
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);
+ act = global_actions.register_action (transport_actions, X_("RecordPreroll"), _("Record w/Preroll"), sigc::mem_fun(*this, &ARDOUR_UI::transport_rec_preroll));
+ ActionManager::session_sensitive_actions.push_back (act);
+ ActionManager::write_sensitive_actions.push_back (act);
+
act = global_actions.register_action (transport_actions, X_("Record"), _("Enable Record"), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::transport_record), false));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::write_sensitive_actions.push_back (act);
framepos_t get_preroll ();
void maybe_locate_with_edit_preroll (framepos_t);
void play_with_preroll ();
+ void rec_with_preroll ();
void select_all_in_track (Selection::Operation op);
void select_all_objects (Selection::Operation op);
void invert_selection_in_track ();
}
}
+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)
{
virtual bool extend_selection_to_track (TimeAxisView&) = 0;
virtual void play_selection () = 0;
virtual void play_with_preroll () = 0;
+ virtual void rec_with_preroll () = 0;
virtual void maybe_locate_with_edit_preroll (framepos_t location) = 0;
virtual void goto_nth_marker (int nth) = 0;
virtual void trigger_script (int nth) = 0;