export: add support for CAF
[ardour.git] / gtk2_ardour / group_tabs.cc
index d53b90584695111dcb528107d4f353beea3c7570..b8d30dc989809eced10d35f5750c40304c040c58 100644 (file)
@@ -42,7 +42,7 @@ GroupTabs::GroupTabs ()
        , _dragging (0)
        , _dragging_new_tab (0)
 {
-
+       add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::POINTER_MOTION_MASK);
 }
 
 GroupTabs::~GroupTabs ()
@@ -175,6 +175,8 @@ GroupTabs::on_motion_notify_event (GdkEventMotion* ev)
        set_dirty ();
        queue_draw ();
 
+       gdk_event_request_motions(ev);
+
        return true;
 }
 
@@ -319,7 +321,11 @@ GroupTabs::get_menu (RouteGroup* 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());
-               items.push_back (MenuElem (_("Add New Subgroup Bus"), sigc::bind (sigc::mem_fun (*this, &GroupTabs::subgroup), g, false, PreFader)));
+               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)));
        }
@@ -434,6 +440,12 @@ GroupTabs::subgroup (RouteGroup* g, bool aux, Placement placement)
        g->make_subgroup (aux, placement);
 }
 
+void
+GroupTabs::un_subgroup (RouteGroup* g)
+{
+       g->destroy_subgroup ();
+}
+
 struct CollectSorter {
        CollectSorter (RouteSortOrderKey key) : _key (key) {}