summaryrefslogtreecommitdiff
path: root/libs/ardour/vst_plugin.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2012-08-09 17:59:43 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2012-08-09 17:59:43 +0000
commite61c2aeda34b345e5edcf71d195ee6e140b44850 (patch)
tree73297825fd400223134b9342f3febefc069bafd9 /libs/ardour/vst_plugin.cc
parent5ce7e740c4f4703d13f7db34dd435058cf6b1be3 (diff)
test a different approach to propagating plugin parameter changes (VST only for now)
git-svn-id: svn://localhost/ardour2/branches/3.0@13122 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/vst_plugin.cc')
-rw-r--r--libs/ardour/vst_plugin.cc22
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