Normalize notes on all channels.
[ardour.git] / libs / ardour / plugin_insert.cc
index 26b6aacd2a0ba68b5d4ed0f4dcc2bd456b153692..599a929deaa3dcd62304ad96b9683392d69de629 100644 (file)
@@ -248,13 +248,8 @@ PluginInsert::create_automatable_parameters ()
                        ParameterDescriptor desc;
                        _plugins.front()->get_parameter_descriptor(i->id(), desc);
 
-                       /* the Parameter belonging to the actual plugin doesn't have its range set
-                          but we want the Controllable related to this Parameter to have those limits.
-                       */
-
-                       param.set_range (desc.lower, desc.upper, _plugins.front()->default_value(i->id()), desc.toggled);
                        can_automate (param);
-                       boost::shared_ptr<AutomationList> list(new AutomationList(param));
+                       boost::shared_ptr<AutomationList> list(new AutomationList(param, desc));
                        add_control (boost::shared_ptr<AutomationControl> (new PluginControl(this, param, desc, list)));
                } else if (i->type() == PluginPropertyAutomation) {
                        Evoral::Parameter param(*i);
@@ -262,7 +257,7 @@ PluginInsert::create_automatable_parameters ()
                        if (desc.datatype != Variant::NOTHING) {
                                boost::shared_ptr<AutomationList> list;
                                if (Variant::type_is_numeric(desc.datatype)) {
-                                       list = boost::shared_ptr<AutomationList>(new AutomationList(param));
+                                       list = boost::shared_ptr<AutomationList>(new AutomationList(param, desc));
                                }
                                add_control (boost::shared_ptr<AutomationControl> (new PluginPropertyControl(this, param, desc, list)));
                        }
@@ -600,7 +595,7 @@ PluginInsert::default_parameter_value (const Evoral::Parameter& param)
        if (_plugins.empty()) {
                fatal << _("programming error: ") << X_("PluginInsert::default_parameter_value() called with no plugin")
                      << endmsg;
-               /*NOTREACHED*/
+               abort(); /*NOTREACHED*/
        }
 
        return _plugins[0]->default_value (param.id());
@@ -646,7 +641,7 @@ PluginInsert::plugin_factory (boost::shared_ptr<Plugin> other)
        fatal << string_compose (_("programming error: %1"),
                          X_("unknown plugin type in PluginInsert::plugin_factory"))
              << endmsg;
-       /*NOTREACHED*/
+       abort(); /*NOTREACHED*/
        return boost::shared_ptr<Plugin> ((Plugin*) 0);
 }
 
@@ -1051,8 +1046,6 @@ PluginInsert::set_state(const XMLNode& node, int version)
 
                if ((*niter)->name() == plugin->state_node_name()) {
 
-                       plugin->set_state (**niter, version);
-
                        for (Plugins::iterator i = _plugins.begin(); i != _plugins.end(); ++i) {
                                (*i)->set_state (**niter, version);
                        }
@@ -1212,6 +1205,9 @@ PluginInsert::PluginControl::PluginControl (PluginInsert*                     p,
 {
        if (alist()) {
                alist()->reset_default (desc.normal);
+               if (desc.toggled) {
+                       list->set_interpolation(Evoral::ControlList::Discrete);
+               }
        }
 
        if (desc.toggled) {