provisional code to support assigning an entire RouteGroup to a VCA master
This commit is contained in:
parent
0e830fb6ec
commit
57f4706204
@ -143,6 +143,9 @@ class LIBARDOUR_API RouteGroup : public SessionObject
|
|||||||
|
|
||||||
int set_state (const XMLNode&, int version);
|
int set_state (const XMLNode&, int version);
|
||||||
|
|
||||||
|
void assign_master (boost::shared_ptr<VCA>);
|
||||||
|
void unassign_master (boost::shared_ptr<VCA>);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
boost::shared_ptr<RouteList> routes;
|
boost::shared_ptr<RouteList> routes;
|
||||||
boost::shared_ptr<Route> subgroup_bus;
|
boost::shared_ptr<Route> subgroup_bus;
|
||||||
@ -159,6 +162,10 @@ class LIBARDOUR_API RouteGroup : public SessionObject
|
|||||||
PBD::Property<bool> _color;
|
PBD::Property<bool> _color;
|
||||||
PBD::Property<bool> _monitoring;
|
PBD::Property<bool> _monitoring;
|
||||||
|
|
||||||
|
bool pre_master_gain;
|
||||||
|
bool pre_master_solo;
|
||||||
|
bool pre_master_mute;
|
||||||
|
|
||||||
boost::shared_ptr<ControlGroup> _solo_group;
|
boost::shared_ptr<ControlGroup> _solo_group;
|
||||||
boost::shared_ptr<ControlGroup> _mute_group;
|
boost::shared_ptr<ControlGroup> _mute_group;
|
||||||
boost::shared_ptr<ControlGroup> _rec_enable_group;
|
boost::shared_ptr<ControlGroup> _rec_enable_group;
|
||||||
|
@ -295,6 +295,10 @@ RouteGroup::set_gain (bool yn)
|
|||||||
_gain = yn;
|
_gain = yn;
|
||||||
_gain_group->set_active (yn);
|
_gain_group->set_active (yn);
|
||||||
|
|
||||||
|
if (routes->empty() || !routes->front()->slaved()) {
|
||||||
|
pre_master_gain = yn;
|
||||||
|
}
|
||||||
|
|
||||||
send_change (PropertyChange (Properties::gain));
|
send_change (PropertyChange (Properties::gain));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -306,6 +310,11 @@ RouteGroup::set_mute (bool yn)
|
|||||||
}
|
}
|
||||||
_mute = yn;
|
_mute = yn;
|
||||||
_mute_group->set_active (yn);
|
_mute_group->set_active (yn);
|
||||||
|
|
||||||
|
if (routes->empty() || !routes->front()->slaved()) {
|
||||||
|
pre_master_mute = yn;
|
||||||
|
}
|
||||||
|
|
||||||
send_change (PropertyChange (Properties::mute));
|
send_change (PropertyChange (Properties::mute));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -317,6 +326,11 @@ RouteGroup::set_solo (bool yn)
|
|||||||
}
|
}
|
||||||
_solo = yn;
|
_solo = yn;
|
||||||
_solo_group->set_active (yn);
|
_solo_group->set_active (yn);
|
||||||
|
|
||||||
|
if (routes->empty() || !routes->front()->slaved()) {
|
||||||
|
pre_master_solo = yn;
|
||||||
|
}
|
||||||
|
|
||||||
send_change (PropertyChange (Properties::solo));
|
send_change (PropertyChange (Properties::solo));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -544,3 +558,56 @@ RouteGroup::push_to_groups ()
|
|||||||
_rec_enable_group->set_active (_recenable);
|
_rec_enable_group->set_active (_recenable);
|
||||||
_monitoring_group->set_active (_monitoring);
|
_monitoring_group->set_active (_monitoring);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
RouteGroup::assign_master (boost::shared_ptr<VCA> master)
|
||||||
|
{
|
||||||
|
boost::shared_ptr<Route> front = routes->front ();
|
||||||
|
|
||||||
|
if (!front) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (front->slaved_to (master)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!front->slaved()) {
|
||||||
|
|
||||||
|
pre_master_gain = is_gain ();
|
||||||
|
pre_master_solo = is_solo ();
|
||||||
|
pre_master_mute = is_mute ();
|
||||||
|
|
||||||
|
for (RouteList::iterator r = routes->begin(); r != routes->end(); ++r) {
|
||||||
|
(*r)->assign (master);
|
||||||
|
}
|
||||||
|
|
||||||
|
set_gain (false);
|
||||||
|
set_solo (false);
|
||||||
|
set_mute (false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
RouteGroup::unassign_master (boost::shared_ptr<VCA> master)
|
||||||
|
{
|
||||||
|
boost::shared_ptr<Route> front = routes->front ();
|
||||||
|
|
||||||
|
if (!front) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!front->slaved_to (master)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (RouteList::iterator r = routes->begin(); r != routes->end(); ++r) {
|
||||||
|
(*r)->unassign (master);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!front->slaved()) {
|
||||||
|
set_gain (pre_master_gain);
|
||||||
|
set_solo (pre_master_solo);
|
||||||
|
set_mute (pre_master_mute);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user