diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-07-08 09:25:18 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-07-08 09:25:18 -0400 |
commit | 2cc33684c71131fd483346fe05e3b1a0e1706de9 (patch) | |
tree | 0a7da73fa7ea0aeea9c48d1f9cae7fe035457f76 /libs/ardour/route_group.cc | |
parent | da0bd3d8a50955a3242b42bd0a752a68a763c4f4 (diff) |
treat VCA assign as a RouteGroup property.
Newly added routes,removed routes etc. all correctly assign or
unassign to the group's VCA.
Diffstat (limited to 'libs/ardour/route_group.cc')
-rw-r--r-- | libs/ardour/route_group.cc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/libs/ardour/route_group.cc b/libs/ardour/route_group.cc index 91303af07e..959342c282 100644 --- a/libs/ardour/route_group.cc +++ b/libs/ardour/route_group.cc @@ -126,12 +126,18 @@ RouteGroup::~RouteGroup () _rec_enable_group->clear (); _monitoring_group->clear (); + boost::shared_ptr<VCA> vca (group_master.lock()); + for (RouteList::iterator i = routes->begin(); i != routes->end();) { RouteList::iterator tmp = i; ++tmp; (*i)->set_route_group (0); + if (vca) { + (*i)->unassign (vca); + } + i = tmp; } } @@ -164,6 +170,12 @@ RouteGroup::add (boost::shared_ptr<Route> r) r->set_route_group (this); r->DropReferences.connect_same_thread (*this, boost::bind (&RouteGroup::remove_when_going_away, this, boost::weak_ptr<Route> (r))); + boost::shared_ptr<VCA> vca (group_master.lock()); + + if (vca) { + r->assign (vca); + } + _session.set_dirty (); RouteAdded (this, boost::weak_ptr<Route> (r)); /* EMIT SIGNAL */ return 0; @@ -186,6 +198,13 @@ RouteGroup::remove (boost::shared_ptr<Route> r) if ((i = find (routes->begin(), routes->end(), r)) != routes->end()) { r->set_route_group (0); + + boost::shared_ptr<VCA> vca = group_master.lock(); + + if (vca) { + r->unassign (vca); + } + _solo_group->remove_control (r->solo_control()); _mute_group->remove_control (r->mute_control()); _gain_group->remove_control (r->gain_control()); @@ -584,6 +603,8 @@ RouteGroup::assign_master (boost::shared_ptr<VCA> master) for (RouteList::iterator r = routes->begin(); r != routes->end(); ++r) { (*r)->assign (master); } + + group_master = master; } void @@ -602,6 +623,8 @@ RouteGroup::unassign_master (boost::shared_ptr<VCA> master) for (RouteList::iterator r = routes->begin(); r != routes->end(); ++r) { (*r)->unassign (master); } + + group_master.reset (); } bool |