summaryrefslogtreecommitdiff
path: root/libs/ardour/control_group.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-06-10 16:59:27 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2016-06-10 16:59:34 -0400
commitec8a4de01596c162c1529f3021dfc432bf66dfe8 (patch)
tree690f1a78a9d538ecda8ec6f80673207ce2092980 /libs/ardour/control_group.cc
parent1695de335db34e7d35de25454e3a33e560d81ae0 (diff)
make relative gain control in route groups work (again)
Diffstat (limited to 'libs/ardour/control_group.cc')
-rw-r--r--libs/ardour/control_group.cc34
1 files changed, 24 insertions, 10 deletions
diff --git a/libs/ardour/control_group.cc b/libs/ardour/control_group.cc
index 25f21a8775..51a1515c6a 100644
--- a/libs/ardour/control_group.cc
+++ b/libs/ardour/control_group.cc
@@ -47,6 +47,12 @@ ControlGroup::set_active (bool yn)
}
void
+ControlGroup::set_mode (Mode m)
+{
+ _mode = m;
+}
+
+void
ControlGroup::clear ()
{
/* we're giving up on all members, so we don't care about their
@@ -185,6 +191,11 @@ ControlGroup::set_group_value (boost::shared_ptr<AutomationControl> control, dou
/*---- GAIN CONTROL GROUP -----------*/
+GainControlGroup::GainControlGroup ()
+ : ControlGroup (GainAutomation)
+{
+}
+
gain_t
GainControlGroup::get_min_factor (gain_t factor)
{
@@ -235,13 +246,9 @@ GainControlGroup::get_max_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;
}
@@ -262,8 +269,9 @@ GainControlGroup::set_group_value (boost::shared_ptr<AutomationControl> control,
delta -= usable_gain;
- if (delta == 0.0f)
+ if (delta == 0.0f) {
return;
+ }
gain_t factor = delta / usable_gain;
@@ -281,6 +289,12 @@ GainControlGroup::set_group_value (boost::shared_ptr<AutomationControl> control,
}
}
+ /* 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;
@@ -295,10 +309,10 @@ GainControlGroup::set_group_value (boost::shared_ptr<AutomationControl> control,
} 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);
}
}
}