diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index bbc82939c7..bdb3c3f792 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -214,6 +214,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop BufferSet& get_mix_buffers (ChanCount count = ChanCount::ZERO); bool have_rec_enabled_track () const; + bool have_rec_disabled_track () const; bool have_captured() const { return _have_captured; } @@ -1678,6 +1679,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop void update_have_rec_enabled_track (); gint _have_rec_enabled_track; + gint _have_rec_disabled_track; static int ask_about_playlist_deletion (boost::shared_ptr); diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 56b8f2b739..dc00ecd893 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -269,6 +269,7 @@ Session::Session (AudioEngine &eng, , first_file_header_format_reset (true) , have_looped (false) , _have_rec_enabled_track (false) + , _have_rec_disabled_track (true) , _step_editors (0) , _suspend_timecode_transmission (0) , _speakers (new Speakers) @@ -4977,6 +4978,12 @@ Session::have_rec_enabled_track () const return g_atomic_int_get (const_cast(&_have_rec_enabled_track)) == 1; } +bool +Session::have_rec_disabled_track () const +{ + return g_atomic_int_get (const_cast(&_have_rec_disabled_track)) == 1; +} + /** Update the state of our rec-enabled tracks flag */ void Session::update_have_rec_enabled_track () @@ -5000,6 +5007,20 @@ Session::update_have_rec_enabled_track () if (g_atomic_int_get (&_have_rec_enabled_track) != old) { RecordStateChanged (); /* EMIT SIGNAL */ } + + + i = rl->begin(); + while (i != rl->end ()) { + + 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); } void