X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fautomation_controller.cc;h=6f62608f0a8c789f067a3bc1ae897841c1bd15f1;hb=ee42a6dd97045253d1a9bb32fc2e571d235f9967;hp=dc9b8bb2c40e494bac82209367e0cbf9a0a86bf6;hpb=d357eca668044badcb4bab318e2e74cfffa9a0b0;p=ardour.git diff --git a/gtk2_ardour/automation_controller.cc b/gtk2_ardour/automation_controller.cc index dc9b8bb2c4..6f62608f0a 100644 --- a/gtk2_ardour/automation_controller.cc +++ b/gtk2_ardour/automation_controller.cc @@ -19,8 +19,10 @@ */ #include -#include "ardour/automation_event.h" +#include "ardour/automation_list.h" #include "ardour/automation_control.h" +#include "ardour/event_type_map.h" +#include "ardour/automatable.h" #include "ardour_ui.h" #include "utils.h" #include "automation_controller.h" @@ -63,13 +65,15 @@ AutomationController::~AutomationController() boost::shared_ptr AutomationController::create( boost::shared_ptr parent, - boost::shared_ptr cl, + const Evoral::Parameter& param, boost::shared_ptr ac) { - Gtk::Adjustment* adjustment = manage(new Gtk::Adjustment(cl->default_value(), cl->get_min_y(), cl->get_max_y())); + Gtk::Adjustment* adjustment = manage(new Gtk::Adjustment(param.normal(), param.min(), param.max())); if (!ac) { - PBD::warning << "Creating AutomationController for " << cl->parameter().symbol() << endmsg; - ac = boost::dynamic_pointer_cast(parent->control_factory(cl)); + PBD::warning << "Creating AutomationController for " << EventTypeMap::instance().to_symbol(param) << endmsg; + ac = boost::dynamic_pointer_cast(parent->control_factory(param)); + } else { + assert(ac->parameter() == param); } return boost::shared_ptr(new AutomationController(ac, adjustment)); }