X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fautomation_controller.cc;h=6f62608f0a8c789f067a3bc1ae897841c1bd15f1;hb=ee42a6dd97045253d1a9bb32fc2e571d235f9967;hp=0bf1482224c2a5f983d6d1c56552c972ebf3c97e;hpb=68e943265edf04e63a8e8b8f62bab20f99d9c637;p=ardour.git diff --git a/gtk2_ardour/automation_controller.cc b/gtk2_ardour/automation_controller.cc index 0bf1482224..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" @@ -61,12 +63,17 @@ AutomationController::~AutomationController() } boost::shared_ptr -AutomationController::create(boost::shared_ptr parent, boost::shared_ptr al, boost::shared_ptr ac) +AutomationController::create( + boost::shared_ptr parent, + const Evoral::Parameter& param, + boost::shared_ptr ac) { - Gtk::Adjustment* adjustment = manage(new Gtk::Adjustment(al->default_value(), al->get_min_y(), al->get_max_y())); + Gtk::Adjustment* adjustment = manage(new Gtk::Adjustment(param.normal(), param.min(), param.max())); if (!ac) { - PBD::warning << "Creating AutomationController for " << al->parameter().to_string() << endmsg; - ac = parent->control_factory(al); + 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)); } @@ -109,13 +116,13 @@ AutomationController::value_adjusted() void AutomationController::start_touch() { - _controllable->list()->start_touch(); + _controllable->start_touch(); } void AutomationController::end_touch() { - _controllable->list()->stop_touch(); + _controllable->stop_touch(); } void @@ -123,7 +130,7 @@ AutomationController::automation_state_changed () { ENSURE_GUI_THREAD(mem_fun(*this, &AutomationController::automation_state_changed)); - bool x = (_controllable->list()->automation_state() != Off); + bool x = (_controllable->automation_state() != Off); /* start watching automation so that things move */