From d6815d7e40d5e520db05b2b75629c0b7b1a23499 Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Fri, 21 Jan 2022 17:45:18 -0600 Subject: [PATCH] trigger page: rough-in a control for Cue Recording --- gtk2_ardour/trigger_page.cc | 17 +++++++++++++++++ gtk2_ardour/trigger_page.h | 4 ++++ 2 files changed, 21 insertions(+) diff --git a/gtk2_ardour/trigger_page.cc b/gtk2_ardour/trigger_page.cc index f15889a191..704e3770ef 100644 --- a/gtk2_ardour/trigger_page.cc +++ b/gtk2_ardour/trigger_page.cc @@ -84,6 +84,7 @@ TriggerPage::TriggerPage () _cue_area_box.pack_start (*spacer, Gtk::PACK_SHRINK); _cue_area_box.pack_start (_cue_box, Gtk::PACK_SHRINK); _cue_area_box.pack_start (_master_widget, Gtk::PACK_SHRINK); + _cue_area_box.pack_start (_cue_rec_enable, Gtk::PACK_SHRINK); /* left-side frame, same layout as TriggerStrip. * use Alignment instead of Frame with SHADOW_IN (2px) @@ -286,6 +287,10 @@ TriggerPage::set_session (Session* s) Editor::instance ().get_selection ().TriggersChanged.connect (sigc::mem_fun (*this, &TriggerPage::selection_changed)); + TriggerBox::CueRecordingChanged.connect (_session_connections, invalidator (*this), boost::bind (&TriggerPage::rec_state_changed, this), gui_context ()); + rec_state_changed(); + _cue_rec_enable.signal_clicked.connect(sigc::mem_fun(*this, &TriggerPage::rec_state_clicked)); + initial_track_display (); _slot_prop_box.set_session (s); @@ -481,6 +486,18 @@ TriggerPage::redisplay_track_list () } } +void +TriggerPage::rec_state_clicked () +{ + TriggerBox::set_cue_recording(!TriggerBox::cue_recording()); +} + +void +TriggerPage::rec_state_changed () +{ + _cue_rec_enable.set_active_state( TriggerBox::cue_recording() ? Gtkmm2ext::ExplicitActive : Gtkmm2ext::Off); +} + void TriggerPage::parameter_changed (string const& p) { diff --git a/gtk2_ardour/trigger_page.h b/gtk2_ardour/trigger_page.h index 468220d81d..fd02c191f3 100644 --- a/gtk2_ardour/trigger_page.h +++ b/gtk2_ardour/trigger_page.h @@ -74,6 +74,9 @@ private: void pi_property_changed (PBD::PropertyChange const&); void stripable_property_changed (PBD::PropertyChange const&, boost::weak_ptr); + void rec_state_changed (); + void rec_state_clicked (); + void add_sidebar_page (std::string const&, Gtk::Widget&); bool no_strip_button_event (GdkEventButton*); @@ -111,6 +114,7 @@ private: CueBoxWidget _cue_box; FittedCanvasWidget _master_widget; CueMaster _master; + ArdourWidgets::ArdourButton _cue_rec_enable; SlotPropertiesBox _slot_prop_box;