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
This commit is contained in:
Carl Hetherington 2011-07-02 23:36:01 +00:00
parent 757d9565ca
commit 75eeb68e37
2 changed files with 18 additions and 7 deletions

View File

@ -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<Processor>
return 0;
}
/** Add an AutomationTimeAxisView to display automation for a processor's parameter */
void
RouteTimeAxisView::add_processor_automation_curve (boost::shared_ptr<Processor> processor, Evoral::Parameter what)
{
@ -1894,7 +1903,8 @@ RouteTimeAxisView::add_existing_processor_automation_curves (boost::weak_ptr<Pro
{
boost::shared_ptr<Processor> processor (p.lock ());
if (!processor) {
if (!processor || boost::dynamic_pointer_cast<Amp> (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;

View File

@ -240,6 +240,8 @@ protected:
void create_gain_automation_child (const Evoral::Parameter &, bool);
void setup_processor_menu_and_curves ();
boost::shared_ptr<AutomationTimeAxisView> 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<ProcessorAutomationInfo*> processor_automation;
typedef std::vector<boost::shared_ptr<AutomationLine> > ProcessorAutomationCurves;