hans' patches for MIDI note resizing++
[ardour.git] / gtk2_ardour / automation_controller.cc
index 3cb4cc5a1e8fa86db2bc0b0f548b79208ae1d3a2..8483bab3933217d49e8175433b7a3015eba261bb 100644 (file)
@@ -61,12 +61,12 @@ AutomationController::~AutomationController()
 }
 
 boost::shared_ptr<AutomationController>
-AutomationController::create(Session& s, boost::shared_ptr<AutomationList> al, boost::shared_ptr<AutomationControl> ac)
+AutomationController::create(boost::shared_ptr<Automatable> parent, boost::shared_ptr<AutomationList> al, boost::shared_ptr<AutomationControl> ac)
 {
        Gtk::Adjustment* adjustment = manage(new Gtk::Adjustment(al->default_value(), al->get_min_y(), al->get_max_y()));
        if (!ac) {
-               PBD::warning << "Creating AutomationController for " << al->param_id().to_string() << endmsg;
-               ac = boost::shared_ptr<AutomationControl>(new AutomationControl(s, al));
+               PBD::warning << "Creating AutomationController for " << al->parameter().to_string() << endmsg;
+               ac = parent->control_factory(al);
        }
        return boost::shared_ptr<AutomationController>(new AutomationController(ac, adjustment));
 }
@@ -76,7 +76,7 @@ AutomationController::update_label(char* label, int label_len)
 {
        if (label && label_len)
                // Hack to display CC rounded to int
-               if (_controllable->list()->param_id().type() == MidiCCAutomation)
+               if (_controllable->parameter().type() == MidiCCAutomation)
                        snprintf(label, label_len, "%d", (int)_controllable->get_value());
                else
                        snprintf(label, label_len, "%.3f", _controllable->get_value());