diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2015-05-08 13:46:42 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-06-29 14:18:10 -0400 |
commit | 9320b5103293cf1d8242d252fd2875c0b358c9e2 (patch) | |
tree | d4743a4aa9b277be9fec816fc4c9122174ea49bd | |
parent | 0108f9f18df9273b88c2c2a1f7fecb29926ea04d (diff) |
provide Session::have_rec_disabled_track()
-rw-r--r-- | libs/ardour/ardour/session.h | 2 | ||||
-rw-r--r-- | libs/ardour/session.cc | 21 |
2 files changed, 23 insertions, 0 deletions
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<Playlist>); 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<gint*>(&_have_rec_enabled_track)) == 1; } +bool +Session::have_rec_disabled_track () const +{ + return g_atomic_int_get (const_cast<gint*>(&_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<Track> tr = boost::dynamic_pointer_cast<Track> (*i); + if (tr && !tr->record_enabled ()) { + break; + } + + ++i; + } + + g_atomic_int_set (&_have_rec_disabled_track, i != rl->end () ? 1 : 0); } void |