_active = yn;
}
+void
+ControlGroup::set_mode (Mode m)
+{
+ _mode = m;
+}
+
void
ControlGroup::clear ()
{
/*---- 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;
}
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);
}
}
}
, _solo_group (new ControlGroup (SoloAutomation))
, _mute_group (new ControlGroup (MuteAutomation))
, _rec_enable_group (new ControlGroup (RecEnableAutomation))
- , _gain_group (new ControlGroup (GainAutomation))
+ , _gain_group (new GainControlGroup ())
, _monitoring_group (new ControlGroup (MonitoringAutomation))
{
_xml_node_name = X_("RouteGroup");
if (is_relative() == yn) {
return;
}
+
_relative = yn;
+
+ push_to_groups ();
+
send_change (PropertyChange (Properties::group_relative));
_session.set_dirty ();
}
void
RouteGroup::push_to_groups ()
{
+ if (is_relative()) {
+ _gain_group->set_mode (ControlGroup::Mode (_gain_group->mode()|ControlGroup::Relative));
+ } else {
+ _gain_group->set_mode (ControlGroup::Mode (_gain_group->mode()&~ControlGroup::Relative));
+ }
+
if (_active) {
_gain_group->set_active (is_gain());
_solo_group->set_active (is_solo());