#include "pbd/compose.h"
#include "pbd/error.h"
#include "pbd/xml++.h"
+#include "pbd/stacktrace.h"
#include "midi++/manager.h"
LadspaPlugin::set_parameter (uint32_t which, float val)
{
if (which < _descriptor->PortCount) {
+
+ if (get_parameter (which) == val) {
+ return;
+ }
+
_shadow_data[which] = (LADSPA_Data) val;
#if 0
#endif
} else {
- warning << string_compose (_("illegal parameter number used with plugin \"%1\". This may"
- "indicate a change in the plugin design, and presets may be"
+ warning << string_compose (_("illegal parameter number used with plugin \"%1\". This may "
+ "indicate a change in the plugin design, and presets may be "
"invalid"), name())
<< endmsg;
}
return set_state_2X (node, version);
}
+#ifndef NO_PLUGIN_STATE
XMLNodeList nodes;
XMLProperty *prop;
XMLNodeConstIterator iter;
const char *port;
const char *data;
uint32_t port_id;
+#endif
LocaleGuard lg (X_("POSIX"));
if (node.name() != state_node_name()) {
return -1;
}
+#ifndef NO_PLUGIN_STATE
+
nodes = node.children ("Port");
for (iter = nodes.begin(); iter != nodes.end(); ++iter) {
sscanf (port, "%" PRIu32, &port_id);
set_parameter (port_id, atof(data));
}
+#endif
latency_compute_run ();
int
LadspaPlugin::set_state_2X (const XMLNode& node, int /* version */)
{
+#ifndef NO_PLUGIN_STATE
XMLNodeList nodes;
XMLProperty *prop;
XMLNodeConstIterator iter;
const char *port;
const char *data;
uint32_t port_id;
+#endif
LocaleGuard lg (X_("POSIX"));
if (node.name() != state_node_name()) {
return -1;
}
+#ifndef NO_PLUGIN_STATE
nodes = node.children ("port");
for(iter = nodes.begin(); iter != nodes.end(); ++iter){
}
latency_compute_run ();
+#endif
return 0;
}