summaryrefslogtreecommitdiff
path: root/gtk2_ardour/group_tabs.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2019-04-11 02:08:36 +0200
committerRobin Gareus <robin@gareus.org>2019-04-11 02:08:36 +0200
commit54d8bcca57f4dafb4eaf7e18ab7e7ef2041051c0 (patch)
tree45a6a0ae007b8e6889721a5a40f06a78ae3a7ab3 /gtk2_ardour/group_tabs.cc
parent01024e2b4ce71dc30a23aac777e89cebba08bd5a (diff)
Skip Subgroup menu-options when not available (no MIDI subgroups)
Diffstat (limited to 'gtk2_ardour/group_tabs.cc')
-rw-r--r--gtk2_ardour/group_tabs.cc30
1 files changed, 25 insertions, 5 deletions
diff --git a/gtk2_ardour/group_tabs.cc b/gtk2_ardour/group_tabs.cc
index f1f8c317fd..d43fce89d4 100644
--- a/gtk2_ardour/group_tabs.cc
+++ b/gtk2_ardour/group_tabs.cc
@@ -377,15 +377,35 @@ GroupTabs::get_menu (RouteGroup* g, bool in_tab_area)
items.push_back (SeparatorElem());
- if (g->has_subgroup()) {
+ bool can_subgroup = true;
+ boost::shared_ptr<RouteList> rl = g->route_list();
+ for (RouteList::const_iterator i = rl->begin(); i != rl->end(); ++i) {
+#ifdef MIXBUS
+ if ((*i)->mixbus ()) {
+ can_subgroup = false;
+ break;
+ }
+#endif
+ if ((*i)->output()->n_ports().n_midi() != 0) {
+ can_subgroup = false;
+ break;
+ }
+ }
+
+ if (g->has_subgroup ()) {
items.push_back (MenuElem (_("Remove Subgroup Bus"), sigc::bind (sigc::mem_fun (*this, &GroupTabs::un_subgroup), g)));
- } else {
+ } else if (can_subgroup) {
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());
+ if (can_subgroup) {
+ 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)));
+ }
+
+ if (can_subgroup || g->has_subgroup ()) {
+ items.push_back (SeparatorElem());
+ }
}
add_menu_items (_menu, g);