From 9c95a8bdea67fb1e3b5147d3abb169756c9c78e7 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 8 May 2015 16:26:52 -0400 Subject: [PATCH] another signal related to record state added from Tracks. This doesn't appear to have obviously distinct semantics from RecordStateChanged but Tracks is using it and I can't verify instantly that it could be replaced by RecordStateChanged. --- libs/ardour/ardour/session.h | 6 +++++- libs/ardour/session.cc | 16 +++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index df4fb0dcb2..b6f7fc1bb8 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -299,7 +299,11 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop /* Record status signals */ - PBD::Signal0 RecordStateChanged; + PBD::Signal0 RecordStateChanged; /* signals changes in recording state (i.e. are we recording) */ + /* XXX may 2015: paul says: it isn't clear to me that this has semantics that cannot be inferrred + from the previous signal and session state. + */ + PBD::Signal0 RecordArmStateChanged; /* signals changes in recording arming */ /* Transport mechanism signals */ diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 7f9e26dffe..72e61b8084 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -5093,19 +5093,21 @@ Session::update_route_record_state () RecordStateChanged (); /* EMIT SIGNAL */ } - - i = rl->begin(); - while (i != rl->end ()) { - + for (i = rl->begin(); i != rl->end (); ++i) { boost::shared_ptr tr = boost::dynamic_pointer_cast (*i); if (tr && !tr->record_enabled ()) { break; } - - ++i; } - g_atomic_int_set (&_have_rec_disabled_track, i != rl->end () ? 1 : 0); + g_atomic_int_set (&_have_rec_disabled_track, i != rl->end () ? 1 : 0); + + bool record_arm_state_changed = (old != g_atomic_int_get (&_have_rec_enabled_track) ); + + if (record_status() == Recording && record_arm_state_changed ) { + RecordArmStateChanged (); + } + } void