13
0

make it possible to drop a group from a VCA

This commit is contained in:
Paul Davis 2017-03-26 15:01:00 +02:00
parent 196bdf8394
commit aeae859c46
2 changed files with 31 additions and 7 deletions

View File

@ -356,15 +356,18 @@ GroupTabs::get_menu (RouteGroup* g, bool in_tab_area)
items.push_back (SeparatorElem()); items.push_back (SeparatorElem());
vca_menu = manage (new Menu); if (g->has_control_master()) {
MenuList& f (vca_menu->items()); items.push_back (MenuElem (_("Drop Group from VCA..."), sigc::bind (sigc::mem_fun (*this, &GroupTabs::unassign_group_to_master), g->group_master_number(), g)));
f.push_back (MenuElem ("New", sigc::bind (sigc::mem_fun (*this, &GroupTabs::assign_group_to_master), 0, g, true))); } else {
vca_menu = manage (new Menu);
MenuList& f (vca_menu->items());
f.push_back (MenuElem ("New", sigc::bind (sigc::mem_fun (*this, &GroupTabs::assign_group_to_master), 0, g, true)));
for (VCAList::const_iterator v = vcas.begin(); v != vcas.end(); ++v) { for (VCAList::const_iterator v = vcas.begin(); v != vcas.end(); ++v) {
f.push_back (MenuElem ((*v)->name().empty() ? string_compose ("VCA %1", (*v)->number()) : (*v)->name(), sigc::bind (sigc::mem_fun (*this, &GroupTabs::assign_group_to_master), (*v)->number(), g, true))); f.push_back (MenuElem ((*v)->name().empty() ? string_compose ("VCA %1", (*v)->number()) : (*v)->name(), sigc::bind (sigc::mem_fun (*this, &GroupTabs::assign_group_to_master), (*v)->number(), g, true)));
}
items.push_back (MenuElem (_("Assign Group to VCA..."), *vca_menu));
} }
items.push_back (MenuElem (_("Assign Group to VCA..."), *vca_menu));
items.push_back (SeparatorElem()); items.push_back (SeparatorElem());
@ -466,6 +469,26 @@ GroupTabs::assign_group_to_master (uint32_t which, RouteGroup* group, bool renam
} }
} }
void
GroupTabs::unassign_group_to_master (uint32_t which, RouteGroup* group) const
{
if (!_session || !group) {
return;
}
boost::shared_ptr<VCA> master = _session->vca_manager().vca_by_number (which);
if (!master) {
/* should never happen; if it does, basically something deeply
odd happened, no reason to tell user because there's no
sensible explanation.
*/
return;
}
group->unassign_master (master);
}
void void
GroupTabs::assign_some_to_master (uint32_t which, RouteList rl) GroupTabs::assign_some_to_master (uint32_t which, RouteList rl)
{ {

View File

@ -128,6 +128,7 @@ private:
void route_removed_from_route_group (ARDOUR::RouteGroup *, boost::weak_ptr<ARDOUR::Route>); void route_removed_from_route_group (ARDOUR::RouteGroup *, boost::weak_ptr<ARDOUR::Route>);
void assign_group_to_master (uint32_t which, ARDOUR::RouteGroup*, bool rename_master) const; void assign_group_to_master (uint32_t which, ARDOUR::RouteGroup*, bool rename_master) const;
void unassign_group_to_master (uint32_t which, ARDOUR::RouteGroup*) const;
void assign_selection_to_master (uint32_t which); void assign_selection_to_master (uint32_t which);
void assign_recenabled_to_master (uint32_t which); void assign_recenabled_to_master (uint32_t which);
void assign_soloed_to_master (uint32_t which); void assign_soloed_to_master (uint32_t which);