ignore negative value locates and MMC locate commands
[ardour.git] / libs / ardour / vst_plugin.cc
index 1eb553c073b3901c6076f29cf33c78e945345cec..24020e835672f4c2d2de5029706082e600b887a7 100644 (file)
@@ -25,7 +25,6 @@
 
 #include "pbd/floating.h"
 #include "pbd/locale_guard.h"
-#include "pbd/pathscanner.h"
 
 #include "ardour/vst_plugin.h"
 #include "ardour/vestige/aeffectx.h"
@@ -250,6 +249,7 @@ VSTPlugin::get_parameter_descriptor (uint32_t which, ParameterDescriptor& desc)
 {
        VstParameterProperties prop;
 
+       memset (&prop, 0, sizeof (VstParameterProperties));
        desc.min_unbound = false;
        desc.max_unbound = false;
        prop.flags = 0;
@@ -257,6 +257,7 @@ VSTPlugin::get_parameter_descriptor (uint32_t which, ParameterDescriptor& desc)
        if (_plugin->dispatcher (_plugin, effGetParameterProperties, which, 0, &prop, 0)) {
 
                /* i have yet to find or hear of a VST plugin that uses this */
+               /* RG: faust2vsti does use this :) */
 
                if (prop.flags & kVstParameterUsesIntegerMinMax) {
                        desc.lower = prop.minInteger;
@@ -287,6 +288,10 @@ VSTPlugin::get_parameter_descriptor (uint32_t which, ParameterDescriptor& desc)
                        desc.largestep = desc.step * 10.0f;
                }
 
+               if (strlen(prop.label) == 0) {
+                       _plugin->dispatcher (_plugin, effGetParamName, which, 0, prop.label, 0);
+               }
+
                desc.toggled = prop.flags & kVstParameterIsSwitch;
                desc.logarithmic = false;
                desc.sr_dependent = false;
@@ -573,7 +578,7 @@ VSTPlugin::connect_and_run (BufferSet& bufs,
                bool valid = false;
                const uint32_t buf_index_in = in_map.get(DataType::MIDI, 0, &valid);
                if (valid) {
-                       v = bufs.get_vst_midi (0);
+                       v = bufs.get_vst_midi (buf_index_in);
                }
                valid = false;
                const uint32_t buf_index_out = out_map.get(DataType::MIDI, 0, &valid);