don't display hidden automation-controls.
[ardour.git] / gtk2_ardour / route_time_axis.cc
index 41d7905bf179bbdd2c17fa66b6069c107a1bf0f2..72ab5842440e10f84ce7a73916b2dc46824af36a 100644 (file)
@@ -2333,14 +2333,9 @@ RouteTimeAxisView::add_processor_to_subplugin_menu (boost::weak_ptr<Processor> p
        }
 
        if (x == processor_automation.end()) {
-
                rai = new ProcessorAutomationInfo (processor);
-               processor_automation.push_back (rai);
-
        } else {
-
                rai = *x;
-
        }
 
        /* any older menu was deleted at the top of processors_changed()
@@ -2363,6 +2358,10 @@ RouteTimeAxisView::add_processor_to_subplugin_menu (boost::weak_ptr<Processor> p
 
                string name = processor->describe_parameter (*i);
 
+               if (name.begin == X_("hidden")) {
+                       continue;
+               }
+
                items.push_back (CheckMenuElem (name));
                mitem = dynamic_cast<Gtk::CheckMenuItem*> (&items.back());
 
@@ -2389,6 +2388,13 @@ RouteTimeAxisView::add_processor_to_subplugin_menu (boost::weak_ptr<Processor> p
                mitem->signal_toggled().connect (sigc::bind (sigc::mem_fun(*this, &RouteTimeAxisView::processor_menu_item_toggled), rai, pan));
        }
 
+       if (items.size() > 0) {
+               processor_automation.push_back (rai);
+       } else {
+               delete rai;
+               return;
+       }
+
        /* add the menu for this processor, because the subplugin
           menu is always cleared at the top of processors_changed().
           this is the result of some poor design in gtkmm and/or