diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-04-08 16:49:47 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-05-31 15:30:40 -0400 |
commit | 653ae4acd639fef149314fe6f8c7a0d862afae40 (patch) | |
tree | ba32ff0efd9b105c207ad7e3b2e89d73e76b4355 /libs/ardour/vca.cc | |
parent | c107f1ab56270f4485ca2a787d575c2b5b53cfcf (diff) |
universal change in the design of the way Route/Track controls are designed and used. The controls now own their own state, rather than proxy for state in their owners.
Massive changes all over the code to accomodate this. Many things are not finished. Consider this a backup safety commit
Diffstat (limited to 'libs/ardour/vca.cc')
-rw-r--r-- | libs/ardour/vca.cc | 100 |
1 files changed, 3 insertions, 97 deletions
diff --git a/libs/ardour/vca.cc b/libs/ardour/vca.cc index d92fa67c03..39303fc8ca 100644 --- a/libs/ardour/vca.cc +++ b/libs/ardour/vca.cc @@ -63,6 +63,7 @@ VCA::get_next_vca_number () VCA::VCA (Session& s, uint32_t num, const string& name) : Stripable (s, name) + , Muteable (s, name) , Automatable (s) , _number (num) , _gain_control (new GainControl (s, Evoral::Parameter (GainAutomation), boost::shared_ptr<AutomationList> ())) @@ -74,8 +75,8 @@ VCA::VCA (Session& s, uint32_t num, const string& name) int VCA::init () { - _solo_control.reset (new VCASoloControllable (X_("solo"), shared_from_this())); - _mute_control.reset (new VCAMuteControllable (X_("mute"), shared_from_this())); + _solo_control.reset (new SoloControl (_session, X_("solo"), *this, *this)); + _mute_control.reset (new MuteControl (_session, X_("mute"), *this)); add_control (_gain_control); add_control (_solo_control); @@ -159,98 +160,3 @@ VCA::muted () const { return _mute_requested; } - -VCA::VCASoloControllable::VCASoloControllable (string const & name, boost::shared_ptr<VCA> vca) - : AutomationControl (vca->session(), Evoral::Parameter (SoloAutomation), ParameterDescriptor (Evoral::Parameter (SoloAutomation)), - boost::shared_ptr<AutomationList>(), name) - , _vca (vca) -{ -} - -void -VCA::VCASoloControllable::set_value (double val, PBD::Controllable::GroupControlDisposition gcd) -{ - if (writable()) { - _set_value (val, gcd); - } -} - -void -VCA::VCASoloControllable::_set_value (double val, PBD::Controllable::GroupControlDisposition gcd) -{ - boost::shared_ptr<VCA> vca = _vca.lock(); - if (!vca) { - return; - } - - vca->set_solo (val >= 0.5); - - AutomationControl::set_value (val, gcd); -} - -void -VCA::VCASoloControllable::set_value_unchecked (double val) -{ - /* used only by automation playback */ - _set_value (val, Controllable::NoGroup); -} - -double -VCA::VCASoloControllable::get_value() const -{ - boost::shared_ptr<VCA> vca = _vca.lock(); - if (!vca) { - return 0.0; - } - - return vca->soloed() ? 1.0 : 0.0; -} - -/*----*/ - -VCA::VCAMuteControllable::VCAMuteControllable (string const & name, boost::shared_ptr<VCA> vca) - : AutomationControl (vca->session(), Evoral::Parameter (MuteAutomation), ParameterDescriptor (Evoral::Parameter (MuteAutomation)), - boost::shared_ptr<AutomationList>(), name) - , _vca (vca) -{ -} - -void -VCA::VCAMuteControllable::set_value (double val, PBD::Controllable::GroupControlDisposition gcd) -{ - if (writable()) { - _set_value (val, gcd); - } -} - -void -VCA::VCAMuteControllable::_set_value (double val, PBD::Controllable::GroupControlDisposition gcd) -{ - boost::shared_ptr<VCA> vca = _vca.lock(); - - if (!vca) { - return; - } - - vca->set_mute (val >= 0.5); - - AutomationControl::set_value (val, gcd); -} - -void -VCA::VCAMuteControllable::set_value_unchecked (double val) -{ - /* used only by automation playback */ - _set_value (val, Controllable::NoGroup); -} - -double -VCA::VCAMuteControllable::get_value() const -{ - boost::shared_ptr<VCA> vca = _vca.lock(); - if (!vca) { - return 0.0; - } - - return vca->muted() ? 1.0 : 0.0; -} |