remove explicit setting of Toggle flag for AutomationControls

Make it be based on the ParameterDescriptor, which indicates toggle status anyway
This commit is contained in:
Paul Davis 2016-04-25 12:31:50 -04:00
parent 52b150ba5d
commit eee3837245
4 changed files with 3 additions and 11 deletions

View File

@ -55,6 +55,9 @@ AutomationControl::AutomationControl(ARDOUR::Session& s
, _session(session)
, _desc(desc)
{
if (_desc.toggled) {
set_flags (Controllable::Toggle);
}
}
AutomationControl::~AutomationControl ()

View File

@ -2607,10 +2607,6 @@ PluginInsert::PluginControl::PluginControl (PluginInsert* p,
list->set_interpolation(Evoral::ControlList::Discrete);
}
}
if (desc.toggled) {
set_flags(Controllable::Toggle);
}
}
/** @param val `user' value */
@ -2680,10 +2676,6 @@ PluginInsert::PluginPropertyControl::PluginPropertyControl (PluginInsert*
alist()->set_yrange (desc.lower, desc.upper);
alist()->reset_default (desc.normal);
}
if (desc.toggled) {
set_flags(Controllable::Toggle);
}
}
void

View File

@ -145,12 +145,10 @@ Route::init ()
add_control (_trim_control);
_solo_control.reset (new SoloControl (_session, X_("solo"), *this, *this));
_solo_control->set_flags (Controllable::Flag (_solo_control->flags() | Controllable::Toggle));
add_control (_solo_control);
_solo_control->Changed.connect_same_thread (*this, boost::bind (&Route::solo_control_changed, this, _1, _2));
_mute_control.reset (new MuteControl (_session, X_("mute"), *this));
_mute_control->set_flags (Controllable::Flag (_mute_control->flags() | Controllable::Toggle));
add_control (_mute_control);
_phase_control.reset (new PhaseControl (_session, X_("phase")));

View File

@ -66,7 +66,6 @@ Track::init ()
_record_enable_control.reset (new RecordEnableControl (_session, X_("recenable"), *this));
add_control (_record_enable_control);
_record_enable_control->set_flags (Controllable::Toggle);
_record_safe_control.reset (new AutomationControl (_session, RecSafeAutomation, ParameterDescriptor (RecSafeAutomation),
boost::shared_ptr<AutomationList> (new AutomationList (Evoral::Parameter (RecSafeAutomation))),