diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-05-27 16:11:47 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-05-31 15:30:45 -0400 |
commit | 2ac7108ccbcf873128fef7977edfdcd90d243104 (patch) | |
tree | 8e2e006a8ea80c594fd4741ba8f8d463b216e52e /libs/ardour/track.cc | |
parent | 203cf3ce7c3b6130a58626082d051ade8ca90dbf (diff) |
use new record safe control in libardour
Diffstat (limited to 'libs/ardour/track.cc')
-rw-r--r-- | libs/ardour/track.cc | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/libs/ardour/track.cc b/libs/ardour/track.cc index 17a7c13295..75cb689441 100644 --- a/libs/ardour/track.cc +++ b/libs/ardour/track.cc @@ -28,6 +28,7 @@ #include "ardour/port.h" #include "ardour/processor.h" #include "ardour/record_enable_control.h" +#include "ardour/record_safe_control.h" #include "ardour/route_group_specialized.h" #include "ardour/session.h" #include "ardour/session_playlists.h" @@ -67,9 +68,7 @@ Track::init () _record_enable_control.reset (new RecordEnableControl (_session, X_("recenable"), *this)); add_control (_record_enable_control); - _record_safe_control.reset (new AutomationControl (_session, RecSafeAutomation, ParameterDescriptor (RecSafeAutomation), - boost::shared_ptr<AutomationList> (new AutomationList (Evoral::Parameter (RecSafeAutomation))), - X_("recsafe"))); + _record_safe_control.reset (new RecordSafeControl (_session, X_("recsafe"), *this)); add_control (_record_safe_control); _monitoring_control.reset (new MonitorControl (_session, X_("monitoring"), *this)); @@ -241,27 +240,15 @@ Track::record_safe_changed (bool, Controllable::GroupControlDisposition) } bool -Track::record_safe () const +Track::can_be_record_safe () { - return _diskstream && _diskstream->record_safe (); + return !_record_enable_control->get_value() && _diskstream && _session.writable() && (_freeze_record.state != Frozen); } -void -Track::set_record_safe (bool yn, Controllable::GroupControlDisposition group_override) +bool +Track::can_be_record_enabled () { - if (!_session.writable()) { - return; - } - - if (_freeze_record.state == Frozen) { - return; - } - - if (record_enabled ()) { - return; - } - - _rec_safe_control->set_value (yn, group_override); + return !_record_safe_control->get_value() && _diskstream && !_diskstream->record_safe() && _session.writable() && (_freeze_record.state != Frozen); } void |