make relative gain control in route groups work (again)
This commit is contained in:
parent
1695de335d
commit
ec8a4de015
@ -46,6 +46,12 @@ ControlGroup::set_active (bool yn)
|
|||||||
_active = yn;
|
_active = yn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ControlGroup::set_mode (Mode m)
|
||||||
|
{
|
||||||
|
_mode = m;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ControlGroup::clear ()
|
ControlGroup::clear ()
|
||||||
{
|
{
|
||||||
@ -185,6 +191,11 @@ ControlGroup::set_group_value (boost::shared_ptr<AutomationControl> control, dou
|
|||||||
|
|
||||||
/*---- GAIN CONTROL GROUP -----------*/
|
/*---- GAIN CONTROL GROUP -----------*/
|
||||||
|
|
||||||
|
GainControlGroup::GainControlGroup ()
|
||||||
|
: ControlGroup (GainAutomation)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
gain_t
|
gain_t
|
||||||
GainControlGroup::get_min_factor (gain_t factor)
|
GainControlGroup::get_min_factor (gain_t factor)
|
||||||
{
|
{
|
||||||
@ -235,13 +246,9 @@ GainControlGroup::get_max_factor (gain_t factor)
|
|||||||
void
|
void
|
||||||
GainControlGroup::set_group_value (boost::shared_ptr<AutomationControl> control, double val)
|
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) {
|
if (!_active) {
|
||||||
|
/* set the primary control */
|
||||||
|
control->set_value (val, Controllable::ForGroup);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -262,8 +269,9 @@ GainControlGroup::set_group_value (boost::shared_ptr<AutomationControl> control,
|
|||||||
|
|
||||||
delta -= usable_gain;
|
delta -= usable_gain;
|
||||||
|
|
||||||
if (delta == 0.0f)
|
if (delta == 0.0f) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
gain_t factor = delta / usable_gain;
|
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) {
|
for (ControlMap::iterator c = _controls.begin(); c != _controls.end(); ++c) {
|
||||||
if (c->second == control) {
|
if (c->second == control) {
|
||||||
continue;
|
continue;
|
||||||
@ -295,10 +309,10 @@ GainControlGroup::set_group_value (boost::shared_ptr<AutomationControl> control,
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
/* just set entire group */
|
||||||
|
|
||||||
for (ControlMap::iterator c = _controls.begin(); c != _controls.end(); ++c) {
|
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -99,7 +99,7 @@ RouteGroup::RouteGroup (Session& s, const string &n)
|
|||||||
, _solo_group (new ControlGroup (SoloAutomation))
|
, _solo_group (new ControlGroup (SoloAutomation))
|
||||||
, _mute_group (new ControlGroup (MuteAutomation))
|
, _mute_group (new ControlGroup (MuteAutomation))
|
||||||
, _rec_enable_group (new ControlGroup (RecEnableAutomation))
|
, _rec_enable_group (new ControlGroup (RecEnableAutomation))
|
||||||
, _gain_group (new ControlGroup (GainAutomation))
|
, _gain_group (new GainControlGroup ())
|
||||||
, _monitoring_group (new ControlGroup (MonitoringAutomation))
|
, _monitoring_group (new ControlGroup (MonitoringAutomation))
|
||||||
{
|
{
|
||||||
_xml_node_name = X_("RouteGroup");
|
_xml_node_name = X_("RouteGroup");
|
||||||
@ -408,7 +408,11 @@ RouteGroup::set_relative (bool yn, void* /*src*/)
|
|||||||
if (is_relative() == yn) {
|
if (is_relative() == yn) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_relative = yn;
|
_relative = yn;
|
||||||
|
|
||||||
|
push_to_groups ();
|
||||||
|
|
||||||
send_change (PropertyChange (Properties::group_relative));
|
send_change (PropertyChange (Properties::group_relative));
|
||||||
_session.set_dirty ();
|
_session.set_dirty ();
|
||||||
}
|
}
|
||||||
@ -542,6 +546,12 @@ RouteGroup::post_set (PBD::PropertyChange const &)
|
|||||||
void
|
void
|
||||||
RouteGroup::push_to_groups ()
|
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) {
|
if (_active) {
|
||||||
_gain_group->set_active (is_gain());
|
_gain_group->set_active (is_gain());
|
||||||
_solo_group->set_active (is_solo());
|
_solo_group->set_active (is_solo());
|
||||||
|
Loading…
Reference in New Issue
Block a user