-Track::RecEnableControl::RecEnableControl (boost::shared_ptr<Track> t)
- : AutomationControl (t->session(),
- RecEnableAutomation,
- ParameterDescriptor(Evoral::Parameter(RecEnableAutomation)),
- boost::shared_ptr<AutomationList>(),
- X_("recenable"))
- , track (t)
-{
- boost::shared_ptr<AutomationList> gl(new AutomationList(Evoral::Parameter(RecEnableAutomation)));
- set_list (gl);
-}
-
-void
-Track::RecEnableControl::set_value (double val)
-{
- boost::shared_ptr<Track> t = track.lock ();
- if (!t) {
- return;
- }
-
- t->set_record_enabled (val >= 0.5 ? true : false, this);
-}
-
-double
-Track::RecEnableControl::get_value () const
-{
- boost::shared_ptr<Track> t = track.lock ();
- if (!t) {
- return 0;
- }
-
- return (t->record_enabled() ? 1.0 : 0.0);
-}
-
-bool
-Track::record_enabled () const
-{
- return _diskstream && _diskstream->record_enabled ();
-}
-