diff options
author | Carl Hetherington <carl@carlh.net> | 2009-06-26 13:26:08 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2009-06-26 13:26:08 +0000 |
commit | 564e16ca0755ffa4f0edac64edc3d2d61fe211cd (patch) | |
tree | edd3cae8454782d9551c91dea3ee1aa180aaa9bf /gtk2_ardour | |
parent | 7b66abc7aafb47179b7a683d6a0ec5b7c59645cb (diff) |
Don't add a plugin menu entry for the Amp processor. Desensitize the plugin menu if it is empty.
git-svn-id: svn://localhost/ardour2/branches/3.0@5279 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/route_time_axis.cc | 16 | ||||
-rw-r--r-- | gtk2_ardour/route_time_axis.h | 2 |
2 files changed, 12 insertions, 6 deletions
diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index fd1246bdf5..a2451b5bfe 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -289,7 +289,7 @@ RouteTimeAxisView::post_construct () update_diskstream_display (); subplugin_menu.items().clear (); - _route->foreach_processor (mem_fun (*this, &RouteTimeAxisView::add_processor_to_subplugin_menu)); + _route->foreach_processor (bind (mem_fun (*this, &RouteTimeAxisView::add_processor_to_subplugin_menu), _route)); _route->foreach_processor (mem_fun (*this, &RouteTimeAxisView::add_existing_processor_automation_curves)); reset_processor_automation_curves (); } @@ -469,6 +469,7 @@ RouteTimeAxisView::build_automation_action_menu () subplugin_menu.detach(); automation_items.push_back (MenuElem (_("Plugins"), subplugin_menu)); + automation_items.back().set_sensitive (!subplugin_menu.items().empty()); map<Evoral::Parameter, RouteAutomationNode*>::iterator i; for (i = _automation_tracks.begin(); i != _automation_tracks.end(); ++i) { @@ -2026,10 +2027,16 @@ RouteTimeAxisView::add_automation_child(Evoral::Parameter param, boost::shared_p void -RouteTimeAxisView::add_processor_to_subplugin_menu (boost::weak_ptr<Processor> p) +RouteTimeAxisView::add_processor_to_subplugin_menu (boost::weak_ptr<Processor> p, boost::weak_ptr<Route> r) { boost::shared_ptr<Processor> processor (p.lock ()); - if (!processor) { + boost::shared_ptr<Route> route (r.lock ()); + if (!processor || !route) { + return; + } + + if (processor == route->amp ()) { + /* don't add an entry for the amp processor */ return; } @@ -2162,7 +2169,7 @@ RouteTimeAxisView::processors_changed () subplugin_menu.items().clear (); - _route->foreach_processor (mem_fun (*this, &RouteTimeAxisView::add_processor_to_subplugin_menu)); + _route->foreach_processor (bind (mem_fun (*this, &RouteTimeAxisView::add_processor_to_subplugin_menu), _route)); _route->foreach_processor (mem_fun (*this, &RouteTimeAxisView::add_existing_processor_automation_curves)); for (list<ProcessorAutomationInfo*>::iterator i = processor_automation.begin(); i != processor_automation.end(); ) { @@ -2432,4 +2439,3 @@ RouteTimeAxisView::set_route_group_to_new () delete g; } } - diff --git a/gtk2_ardour/route_time_axis.h b/gtk2_ardour/route_time_axis.h index 34896e4639..ba81fc8bfe 100644 --- a/gtk2_ardour/route_time_axis.h +++ b/gtk2_ardour/route_time_axis.h @@ -188,7 +188,7 @@ protected: void processors_changed (); - void add_processor_to_subplugin_menu (boost::weak_ptr<ARDOUR::Processor>); + void add_processor_to_subplugin_menu (boost::weak_ptr<ARDOUR::Processor>, boost::weak_ptr<ARDOUR::Route>); void remove_processor_automation_node (ProcessorAutomationNode* pan); void processor_menu_item_toggled (RouteTimeAxisView::ProcessorAutomationInfo*, |