From ec0b7cc1da8522abbf5a11e6d5151880444d7d46 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 9 Jul 2014 12:07:05 -0400 Subject: [PATCH] add new TRX-only function for unusual global-record-enable semantics --- gtk2_ardour/ardour_ui.cc | 31 ++++++++++++++++++++++++++++++- gtk2_ardour/ardour_ui.h | 1 + 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 3948b5cc8c..c87c78d58e 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -1833,10 +1833,36 @@ ARDOUR_UI::transport_stop () _session->request_stop (false, true); } +bool +ARDOUR_UI::trx_record_enable_all_tracks () +{ + if (!_session) { + return false; + } + + boost::shared_ptr rl = _session->get_tracks (); + bool none_record_enabled = true; + + for (RouteList::iterator r = rl->begin(); r != rl->end(); ++r) { + boost::shared_ptr t = boost::dynamic_pointer_cast (*r); + assert (t); + + if (t->record_enabled()) { + none_record_enabled = false; + break; + } + } + + if (none_record_enabled) { + _session->set_record_enabled (rl, true, Session::rt_cleanup); + } + + return none_record_enabled; +} + void ARDOUR_UI::transport_record (bool roll) { - if (_session) { switch (_session->record_status()) { case Session::Disabled: @@ -1845,6 +1871,9 @@ ARDOUR_UI::transport_record (bool roll) msg.run (); return; } + if (Profile->get_trx()) { + roll = trx_record_enable_all_tracks (); + } _session->maybe_enable_record (); if (roll) { transport_roll (); diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index 5d10c6f13d..fbb17819b5 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -583,6 +583,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr void transport_rewind (int option); void transport_loop (); void toggle_roll (bool with_abort, bool roll_out_of_bounded_mode); + bool trx_record_enable_all_tracks (); bool _session_is_new; void set_session (ARDOUR::Session *);