#include <glibmm/fileutils.h>
#include <glibmm/miscutils.h>
+#include "pbd/floating.h"
#include "pbd/locale_guard.h"
#include "pbd/pathscanner.h"
}
void
-VSTPlugin::set_parameter (uint32_t which, float val)
+VSTPlugin::set_parameter (uint32_t which, float newval)
{
- float v = get_parameter (which);
+ float oldval = get_parameter (which);
- cerr << name() << " setting parameter #" << which << " to " << val << " current " << v << " == ? " << (v == val) << endl;
-
- if (get_parameter (which) == val) {
+ if (PBD::floateq (oldval, newval, 1)) {
return;
}
- _plugin->setParameter (_plugin, which, val);
- Plugin::set_parameter (which, val);
+ _plugin->setParameter (_plugin, which, newval);
+
+ float curval = get_parameter (which);
+
+ if (!PBD::floateq (curval, oldval, 1)) {
+ /* value has changed, follow rest of the notification path */
+ Plugin::set_parameter (which, newval);
+ }
}
uint32_t