13
0

rearrange group tabs menu

This commit is contained in:
Paul Davis 2016-05-19 13:11:10 -04:00
parent b5869ac0a4
commit b81fec9d58
2 changed files with 70 additions and 42 deletions

View File

@ -303,22 +303,11 @@ GroupTabs::click_to_tab (double c, list<Tab>::iterator* prev, list<Tab>::iterato
return under;
}
Gtk::Menu*
GroupTabs::get_menu (RouteGroup* g, bool TabArea)
void
GroupTabs::add_new_from_items (Menu_Helpers::MenuList& items)
{
using namespace Menu_Helpers;
delete _menu;
_menu = new Menu;
_menu->set_name ("ArdourContextMenu");
MenuList& items = _menu->items();
Menu* new_from;
if (!TabArea) {
items.push_back (MenuElem (_("Create New Group ..."), hide_return (sigc::mem_fun(*this, &GroupTabs::create_and_add_group))));
items.push_back (MenuElem (_("Create New Group with Control Master ..."), hide_return (sigc::mem_fun(*this, &GroupTabs::create_and_add_group_with_master))));
}
Menu *new_from;
new_from = new Menu;
{
@ -337,10 +326,75 @@ GroupTabs::get_menu (RouteGroup* g, bool TabArea)
f.push_back (MenuElem (_("Soloed..."), sigc::bind (sigc::mem_fun (*this, &GroupTabs::new_from_soloed), true)));
}
items.push_back (MenuElem (_("Create New Group with Master From..."), *new_from));
}
Gtk::Menu*
GroupTabs::get_menu (RouteGroup* g, bool in_tab_area)
{
using namespace Menu_Helpers;
delete _menu;
_menu = new Menu;
_menu->set_name ("ArdourContextMenu");
MenuList& items = _menu->items();
Menu* vca_menu;
const VCAList vcas = _session->vca_manager().vcas ();
if (!in_tab_area) {
items.push_back (MenuElem (_("Create New Group ..."), hide_return (sigc::mem_fun(*this, &GroupTabs::create_and_add_group))));
items.push_back (MenuElem (_("Create New Group with Control Master ..."), hide_return (sigc::mem_fun(*this, &GroupTabs::create_and_add_group_with_master))));
/* context menu is not for a group tab, show the "create new
from" items here
*/
add_new_from_items (items);
}
if (g) {
items.push_back (SeparatorElem());
items.push_back (MenuElem (_("Edit Group..."), sigc::bind (sigc::mem_fun (*this, &GroupTabs::edit_group), g)));
items.push_back (MenuElem (_("Collect Group"), sigc::bind (sigc::mem_fun (*this, &GroupTabs::collect), g)));
items.push_back (MenuElem (_("Remove Group"), sigc::bind (sigc::mem_fun (*this, &GroupTabs::remove_group), g)));
items.push_back (SeparatorElem());
vca_menu = 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)));
for (VCAList::const_iterator v = vcas.begin(); v != vcas.end(); ++v) {
f.push_back (MenuElem (string_compose ("VCA %1", (*v)->number()), sigc::bind (sigc::mem_fun (*this, &GroupTabs::assign_group_to_master), (*v)->number(), g)));
}
items.push_back (MenuElem (_("Assign Group to Control Master..."), *vca_menu));
items.push_back (SeparatorElem());
if (g->has_subgroup()) {
items.push_back (MenuElem (_("Remove Subgroup Bus"), sigc::bind (sigc::mem_fun (*this, &GroupTabs::un_subgroup), g)));
} else {
items.push_back (MenuElem (_("Add New Subgroup Bus"), sigc::bind (sigc::mem_fun (*this, &GroupTabs::subgroup), g, false, PreFader)));
}
items.push_back (MenuElem (_("Add New Aux Bus (pre-fader)"), sigc::bind (sigc::mem_fun (*this, &GroupTabs::subgroup), g, true, PreFader)));
items.push_back (MenuElem (_("Add New Aux Bus (post-fader)"), sigc::bind (sigc::mem_fun (*this, &GroupTabs::subgroup), g, true, PostFader)));
items.push_back (SeparatorElem());
}
add_menu_items (_menu, g);
if (in_tab_area) {
/* context menu is for a group tab, show the "create new
from" items here
*/
add_new_from_items (items);
}
items.push_back (SeparatorElem());
vca_menu = new Menu;
{
MenuList& f (vca_menu->items());
@ -374,37 +428,9 @@ GroupTabs::get_menu (RouteGroup* g, bool TabArea)
}
items.push_back (MenuElem (_("Assign Soloed to Control Master...")));
if (g) {
items.push_back (SeparatorElem());
items.push_back (MenuElem (_("Edit Group..."), sigc::bind (sigc::mem_fun (*this, &GroupTabs::edit_group), g)));
items.push_back (MenuElem (_("Collect Group"), sigc::bind (sigc::mem_fun (*this, &GroupTabs::collect), g)));
items.push_back (MenuElem (_("Remove Group"), sigc::bind (sigc::mem_fun (*this, &GroupTabs::remove_group), g)));
items.push_back (SeparatorElem());
if (g->has_subgroup()) {
items.push_back (MenuElem (_("Remove Subgroup Bus"), sigc::bind (sigc::mem_fun (*this, &GroupTabs::un_subgroup), g)));
} else {
items.push_back (MenuElem (_("Add New Subgroup Bus"), sigc::bind (sigc::mem_fun (*this, &GroupTabs::subgroup), g, false, PreFader)));
}
items.push_back (MenuElem (_("Add New Aux Bus (pre-fader)"), sigc::bind (sigc::mem_fun (*this, &GroupTabs::subgroup), g, true, PreFader)));
items.push_back (MenuElem (_("Add New Aux Bus (post-fader)"), sigc::bind (sigc::mem_fun (*this, &GroupTabs::subgroup), g, true, PostFader)));
items.push_back (SeparatorElem());
vca_menu = 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)));
for (VCAList::const_iterator v = vcas.begin(); v != vcas.end(); ++v) {
f.push_back (MenuElem (string_compose ("VCA %1", (*v)->number()), sigc::bind (sigc::mem_fun (*this, &GroupTabs::assign_group_to_master), (*v)->number(), g)));
}
items.push_back (MenuElem (_("Assign Group to Control Master..."), *vca_menu));
}
add_menu_items (_menu, g);
items.push_back (SeparatorElem());
items.push_back (MenuElem (_("Enable All Groups"), sigc::mem_fun(*this, &GroupTabs::activate_all)));
items.push_back (MenuElem (_("Disable All Groups"), sigc::mem_fun(*this, &GroupTabs::disable_all)));
items.push_back (SeparatorElem());
return _menu;
}

View File

@ -93,6 +93,8 @@ private:
virtual void add_menu_items (Gtk::Menu *, ARDOUR::RouteGroup *) {}
virtual ARDOUR::RouteList selected_routes () const = 0;
void add_new_from_items (Gtk::Menu_Helpers::MenuList&);
void new_from_selection (bool with_master);
void new_from_rec_enabled (bool with_master);
void new_from_soloed (bool with_master);