move computation of TimeAxisViewItem fixed heights into a static member function...
[ardour.git] / gtk2_ardour / route_time_axis.cc
index 9093abca1b12e57200b05a6ad73bc88288363ea7..9ec6048de53ba2044643e826826c6e1fb66b0bd5 100644 (file)
@@ -39,7 +39,6 @@
 #include <gtkmm/menuitem.h>
 #include <gtkmm2ext/gtk_ui.h>
 #include <gtkmm2ext/selector.h>
-#include <gtkmm2ext/stop_signal.h>
 #include <gtkmm2ext/bindable_button.h>
 #include <gtkmm2ext/utils.h>
 
@@ -392,6 +391,12 @@ RouteTimeAxisView::build_automation_action_menu ()
 {
        using namespace Menu_Helpers;
 
+       /* detach subplugin_menu from automation_action_menu before we delete automation_action_menu,
+          otherwise bad things happen (see comment for similar case in MidiTimeAxisView::build_automation_action_menu)
+       */
+
+       detach_menu (subplugin_menu);
+
        delete automation_action_menu;
        automation_action_menu = new Menu;
 
@@ -407,11 +412,13 @@ RouteTimeAxisView::build_automation_action_menu ()
        
        items.push_back (MenuElem (_("Hide All Automation"),
                                   sigc::mem_fun(*this, &RouteTimeAxisView::hide_all_automation)));
+
+       items.push_back (SeparatorElem ());
        
-       /* attach the plugin submenu. It may have previously been used elsewhere, so we detach it first. */
+       /* Attach the plugin submenu. It may have previously been used elsewhere,
+          so it was detached above */
 
-       detach_menu (subplugin_menu);
-       items.push_back (MenuElem (_("Plugins"),  subplugin_menu));
+       items.push_back (MenuElem (_("Plugins"), subplugin_menu));
        items.back().set_sensitive (!subplugin_menu.items().empty());
 }
 
@@ -2001,6 +2008,8 @@ RouteTimeAxisView::add_processor_to_subplugin_menu (boost::weak_ptr<Processor> p
                items.push_back (CheckMenuElem (name));
                mitem = dynamic_cast<CheckMenuItem*> (&items.back());
 
+               _parameter_menu_map[*i] = mitem;
+
                if (has_visible_automation.find((*i)) != has_visible_automation.end()) {
                        mitem->set_active(true);
                }