ControlGroup::set_active (bool yn)
{
_active = yn;
- std::cerr << " CG for " << enum_2_string ((AutomationType) _parameter.type()) << " now active ? " << _active << std::endl;
+}
+
+void
+ControlGroup::set_mode (Mode m)
+{
+ _mode = m;
}
void
control->set_value (val, Controllable::ForGroup);
+ if (!_active) {
+ return;
+ }
+
/* now propagate across the group */
Glib::Threads::RWLock::ReaderLock lm (controls_lock);
/*---- GAIN CONTROL GROUP -----------*/
+GainControlGroup::GainControlGroup ()
+ : ControlGroup (GainAutomation)
+{
+}
+
gain_t
GainControlGroup::get_min_factor (gain_t factor)
{
void
GainControlGroup::set_group_value (boost::shared_ptr<AutomationControl> control, double val)
{
- /* set the primary control */
-
- control->set_value (val, Controllable::ForGroup);
-
- /* now propagate across the group */
+ if (!_active) {
+ /* set the primary control */
+ control->set_value (val, Controllable::ForGroup);
+ return;
+ }
Glib::Threads::RWLock::ReaderLock lm (controls_lock);
delta -= usable_gain;
- if (delta == 0.0f)
+ if (delta == 0.0f) {
return;
+ }
gain_t factor = delta / usable_gain;
}
}
+ /* set the primary control */
+
+ control->set_value (val, Controllable::ForGroup);
+
+ /* now propagate across the group */
+
for (ControlMap::iterator c = _controls.begin(); c != _controls.end(); ++c) {
if (c->second == control) {
continue;
} else {
+ /* just set entire group */
+
for (ControlMap::iterator c = _controls.begin(); c != _controls.end(); ++c) {
- if (c->second != control) {
- c->second->set_value (val, Controllable::ForGroup);
- }
+ c->second->set_value (val, Controllable::ForGroup);
}
}
}