diff options
Diffstat (limited to 'libs/ardour/vst_plugin.cc')
-rw-r--r-- | libs/ardour/vst_plugin.cc | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/libs/ardour/vst_plugin.cc b/libs/ardour/vst_plugin.cc index d3bcc6ecdd..3885bc2a1c 100644 --- a/libs/ardour/vst_plugin.cc +++ b/libs/ardour/vst_plugin.cc @@ -100,24 +100,22 @@ VSTPlugin::get_parameter (uint32_t which) const } 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) << " floateq ? " << floateq (v, val, 1) << " delta " - << std::setprecision(15) - << (v - val) << endl; - - if (PBD::floateq (get_parameter (which), val, 1)) { + if (PBD::floateq (oldval, newval, 1)) { return; } - _plugin->setParameter (_plugin, which, val); - - cerr << "\thaving set parameter to " << val << " new value is " << get_parameter (which) << endl; + _plugin->setParameter (_plugin, which, newval); + + float curval = get_parameter (which); - Plugin::set_parameter (which, val); + if (!PBD::floateq (curval, oldval, 1)) { + /* value has changed, follow rest of the notification path */ + Plugin::set_parameter (which, newval); + } } uint32_t |