From 65b38322db994462358318c7a3a2ba1a002351bd Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 13 Feb 2017 22:59:51 +0100 Subject: GUI action Transport/RecordCountIn --- gtk2_ardour/ardour.menus.in | 1 + gtk2_ardour/ardour_ui.cc | 9 +++++++++ gtk2_ardour/ardour_ui.h | 1 + gtk2_ardour/ardour_ui_ed.cc | 4 ++++ gtk2_ardour/editor.h | 1 + gtk2_ardour/editor_ops.cc | 5 +++++ gtk2_ardour/public_editor.h | 1 + 7 files changed, 22 insertions(+) (limited to 'gtk2_ardour') diff --git a/gtk2_ardour/ardour.menus.in b/gtk2_ardour/ardour.menus.in index b579e7d2a1..5c43175f20 100644 --- a/gtk2_ardour/ardour.menus.in +++ b/gtk2_ardour/ardour.menus.in @@ -75,6 +75,7 @@ + #if 0 #endif diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index b0feef3686..8700f59d4f 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -2397,6 +2397,15 @@ ARDOUR_UI::transport_rec_preroll () editor->rec_with_preroll (); } +void +ARDOUR_UI::transport_rec_count_in () +{ + if (!_session) { + return; + } + editor->rec_with_count_in (); +} + void ARDOUR_UI::transport_rewind (int option) { diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index 27bdf4bcc4..170dbe9948 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -666,6 +666,7 @@ private: void transport_play_selection(); void transport_play_preroll(); void transport_rec_preroll(); + void transport_rec_count_in(); void transport_forward (int option); void transport_rewind (int option); void transport_loop (); diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc index 1b14cba012..1cca283900 100644 --- a/gtk2_ardour/ardour_ui_ed.cc +++ b/gtk2_ardour/ardour_ui_ed.cc @@ -474,6 +474,10 @@ ARDOUR_UI::install_actions () ActionManager::session_sensitive_actions.push_back (act); ActionManager::write_sensitive_actions.push_back (act); + act = global_actions.register_action (transport_actions, X_("RecordCountIn"), _("Record w/Count-In"), sigc::mem_fun(*this, &ARDOUR_UI::transport_rec_count_in)); + 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); diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index fa5ed9057a..46562a76b8 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -263,6 +263,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void maybe_locate_with_edit_preroll (framepos_t); void play_with_preroll (); void rec_with_preroll (); + void rec_with_count_in (); void select_all_in_track (Selection::Operation op); void select_all_objects (Selection::Operation op); void invert_selection_in_track (); diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 93a4571d89..1db9ce4423 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -2670,6 +2670,11 @@ Editor::rec_with_preroll () _session->request_preroll_record_trim (ph, preroll); } +void +Editor::rec_with_count_in () +{ + _session->request_count_in_record (); +} void Editor::play_location (Location& location) diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h index 7516d48099..38b977171b 100644 --- a/gtk2_ardour/public_editor.h +++ b/gtk2_ardour/public_editor.h @@ -211,6 +211,7 @@ class PublicEditor : public Gtkmm2ext::Tabbable { virtual void play_selection () = 0; virtual void play_with_preroll () = 0; virtual void rec_with_preroll () = 0; + virtual void rec_with_count_in () = 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; -- cgit v1.2.3