From 75eeb68e37cc32cd308762c0034557610d89b251 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 2 Jul 2011 23:36:01 +0000 Subject: Minor refactoring; a few comments; don't try to add Amp processor automation curves using the generic mechanism as they are already special-cased separately (#4127). git-svn-id: svn://localhost/ardour2/branches/3.0@9787 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/route_time_axis.cc | 20 +++++++++++++------- gtk2_ardour/route_time_axis.h | 5 +++++ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index 7f9575f015..1157826b0d 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -265,12 +265,20 @@ RouteTimeAxisView::post_construct () /* map current state of the route */ update_diskstream_display (); + setup_processor_menu_and_curves (); + reset_processor_automation_curves (); +} +/** Set up the processor menu for the current set of processors, and + * display automation curves for any parameters which have data. + */ +void +RouteTimeAxisView::setup_processor_menu_and_curves () +{ _subplugin_menu_map.clear (); subplugin_menu.items().clear (); _route->foreach_processor (sigc::mem_fun (*this, &RouteTimeAxisView::add_processor_to_subplugin_menu)); _route->foreach_processor (sigc::mem_fun (*this, &RouteTimeAxisView::add_existing_processor_automation_curves)); - reset_processor_automation_curves (); } gint @@ -1840,6 +1848,7 @@ RouteTimeAxisView::find_processor_automation_node (boost::shared_ptr return 0; } +/** Add an AutomationTimeAxisView to display automation for a processor's parameter */ void RouteTimeAxisView::add_processor_automation_curve (boost::shared_ptr processor, Evoral::Parameter what) { @@ -1894,7 +1903,8 @@ RouteTimeAxisView::add_existing_processor_automation_curves (boost::weak_ptr processor (p.lock ()); - if (!processor) { + if (!processor || boost::dynamic_pointer_cast (processor)) { + /* The Amp processor is a special case and is dealt with separately */ return; } @@ -2090,11 +2100,7 @@ RouteTimeAxisView::processors_changed (RouteProcessorChange c) (*i)->valid = false; } - _subplugin_menu_map.clear (); - subplugin_menu.items().clear (); - - _route->foreach_processor (sigc::mem_fun (*this, &RouteTimeAxisView::add_processor_to_subplugin_menu)); - _route->foreach_processor (sigc::mem_fun (*this, &RouteTimeAxisView::add_existing_processor_automation_curves)); + setup_processor_menu_and_curves (); bool deleted_processor_automation = false; diff --git a/gtk2_ardour/route_time_axis.h b/gtk2_ardour/route_time_axis.h index e087199c87..beae6b5201 100644 --- a/gtk2_ardour/route_time_axis.h +++ b/gtk2_ardour/route_time_axis.h @@ -240,6 +240,8 @@ protected: void create_gain_automation_child (const Evoral::Parameter &, bool); + void setup_processor_menu_and_curves (); + boost::shared_ptr gain_track; StreamView* _view; @@ -270,6 +272,9 @@ protected: void set_track_mode (ARDOUR::TrackMode, bool apply_to_selection = false); + /** Information about all automatable processor parameters that apply to + * this route. The Amp processor is not included in this list. + */ std::list processor_automation; typedef std::vector > ProcessorAutomationCurves; -- cgit v1.2.3