Another not-quite-there-but-better commit.
[ardour.git] / libs / ardour / ladspa_plugin.cc
index 0c2104ca7ae225a0cbf32782566aeb18af7a6ff9..42a593afd96da4389fca335f7af8ac1a71781ca4 100644 (file)
@@ -136,8 +136,6 @@ LadspaPlugin::init (void *mod, uint32_t index, nframes_t rate)
                }
        }
 
-       Plugin::setup_controls ();
-
        latency_compute_run ();
 }
 
@@ -318,11 +316,13 @@ LadspaPlugin::set_parameter (uint32_t which, float val)
 {
        if (which < descriptor->PortCount) {
                shadow_data[which] = (LADSPA_Data) val;
-               ParameterChanged (which, val); /* EMIT SIGNAL */
+#if 0
+               ParameterChanged (ParamID(PluginAutomation, which), val); /* EMIT SIGNAL */
 
                if (which < parameter_count() && controls[which]) {
                        controls[which]->Changed ();
                }
+#endif
                
        } else {
                warning << string_compose (_("illegal parameter number used with plugin \"%1\". This may"
@@ -491,20 +491,23 @@ LadspaPlugin::get_parameter_descriptor (uint32_t which, ParameterDescriptor& des
        return 0;
 }
 
-
 string
-LadspaPlugin::describe_parameter (uint32_t which)
+LadspaPlugin::describe_parameter (ParamID which)
 {
-       if (which < parameter_count()) {
-               return port_names()[which];
+       if (which.type() == PluginAutomation && which.id() < parameter_count()) {
+               return port_names()[which.id()];
        } else {
                return "??";
        }
 }
 
 ARDOUR::nframes_t
-LadspaPlugin::latency () const
+LadspaPlugin::signal_latency () const
 {
+       if (_user_latency) {
+               return _user_latency;
+       }
+
        if (latency_control_port) {
                return (nframes_t) floor (*latency_control_port);
        } else {
@@ -512,16 +515,16 @@ LadspaPlugin::latency () const
        }
 }
 
-set<uint32_t>
+set<ParamID>
 LadspaPlugin::automatable () const
 {
-       set<uint32_t> ret;
+       set<ParamID> ret;
 
        for (uint32_t i = 0; i < parameter_count(); ++i){
                if (LADSPA_IS_PORT_INPUT(port_descriptor (i)) && 
                    LADSPA_IS_PORT_CONTROL(port_descriptor (i))){
                        
-                       ret.insert (ret.end(), i);
+                       ret.insert (ret.end(), ParamID(PluginAutomation, i));
                }
        }