finally get to the bottom of where NO_PLUGIN_STATE needs to be in order to be useful
This commit is contained in:
parent
90f5eb4a31
commit
9cb678ebcc
@ -1717,6 +1717,7 @@ AUPlugin::set_state(const XMLNode& node, int version)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NO_PLUGIN_STATE
|
||||||
if (node.children().empty()) {
|
if (node.children().empty()) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -1752,6 +1753,7 @@ AUPlugin::set_state(const XMLNode& node, int version)
|
|||||||
}
|
}
|
||||||
CFRelease (propertyList);
|
CFRelease (propertyList);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
Plugin::set_state (node, version);
|
Plugin::set_state (node, version);
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
#include "pbd/compose.h"
|
#include "pbd/compose.h"
|
||||||
#include "pbd/error.h"
|
#include "pbd/error.h"
|
||||||
#include "pbd/xml++.h"
|
#include "pbd/xml++.h"
|
||||||
|
#include "pbd/stacktrace.h"
|
||||||
|
|
||||||
#include "midi++/manager.h"
|
#include "midi++/manager.h"
|
||||||
|
|
||||||
@ -360,6 +361,7 @@ LadspaPlugin::set_state (const XMLNode& node, int version)
|
|||||||
return set_state_2X (node, version);
|
return set_state_2X (node, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NO_PLUGIN_STATE
|
||||||
XMLNodeList nodes;
|
XMLNodeList nodes;
|
||||||
XMLProperty *prop;
|
XMLProperty *prop;
|
||||||
XMLNodeConstIterator iter;
|
XMLNodeConstIterator iter;
|
||||||
@ -367,6 +369,7 @@ LadspaPlugin::set_state (const XMLNode& node, int version)
|
|||||||
const char *port;
|
const char *port;
|
||||||
const char *data;
|
const char *data;
|
||||||
uint32_t port_id;
|
uint32_t port_id;
|
||||||
|
#endif
|
||||||
LocaleGuard lg (X_("POSIX"));
|
LocaleGuard lg (X_("POSIX"));
|
||||||
|
|
||||||
if (node.name() != state_node_name()) {
|
if (node.name() != state_node_name()) {
|
||||||
@ -374,6 +377,8 @@ LadspaPlugin::set_state (const XMLNode& node, int version)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NO_PLUGIN_STATE
|
||||||
|
|
||||||
nodes = node.children ("Port");
|
nodes = node.children ("Port");
|
||||||
|
|
||||||
for (iter = nodes.begin(); iter != nodes.end(); ++iter) {
|
for (iter = nodes.begin(); iter != nodes.end(); ++iter) {
|
||||||
@ -396,6 +401,7 @@ LadspaPlugin::set_state (const XMLNode& node, int version)
|
|||||||
sscanf (port, "%" PRIu32, &port_id);
|
sscanf (port, "%" PRIu32, &port_id);
|
||||||
set_parameter (port_id, atof(data));
|
set_parameter (port_id, atof(data));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
latency_compute_run ();
|
latency_compute_run ();
|
||||||
|
|
||||||
@ -405,6 +411,7 @@ LadspaPlugin::set_state (const XMLNode& node, int version)
|
|||||||
int
|
int
|
||||||
LadspaPlugin::set_state_2X (const XMLNode& node, int /* version */)
|
LadspaPlugin::set_state_2X (const XMLNode& node, int /* version */)
|
||||||
{
|
{
|
||||||
|
#ifndef NO_PLUGIN_STATE
|
||||||
XMLNodeList nodes;
|
XMLNodeList nodes;
|
||||||
XMLProperty *prop;
|
XMLProperty *prop;
|
||||||
XMLNodeConstIterator iter;
|
XMLNodeConstIterator iter;
|
||||||
@ -412,6 +419,7 @@ LadspaPlugin::set_state_2X (const XMLNode& node, int /* version */)
|
|||||||
const char *port;
|
const char *port;
|
||||||
const char *data;
|
const char *data;
|
||||||
uint32_t port_id;
|
uint32_t port_id;
|
||||||
|
#endif
|
||||||
LocaleGuard lg (X_("POSIX"));
|
LocaleGuard lg (X_("POSIX"));
|
||||||
|
|
||||||
if (node.name() != state_node_name()) {
|
if (node.name() != state_node_name()) {
|
||||||
@ -419,6 +427,7 @@ LadspaPlugin::set_state_2X (const XMLNode& node, int /* version */)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NO_PLUGIN_STATE
|
||||||
nodes = node.children ("port");
|
nodes = node.children ("port");
|
||||||
|
|
||||||
for(iter = nodes.begin(); iter != nodes.end(); ++iter){
|
for(iter = nodes.begin(); iter != nodes.end(); ++iter){
|
||||||
@ -443,6 +452,7 @@ LadspaPlugin::set_state_2X (const XMLNode& node, int /* version */)
|
|||||||
}
|
}
|
||||||
|
|
||||||
latency_compute_run ();
|
latency_compute_run ();
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1233,6 +1233,8 @@ LV2Plugin::set_state(const XMLNode& node, int version)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NO_PLUGIN_STATE
|
||||||
|
|
||||||
if (version < 3000) {
|
if (version < 3000) {
|
||||||
nodes = node.children("port");
|
nodes = node.children("port");
|
||||||
} else {
|
} else {
|
||||||
@ -1288,6 +1290,7 @@ LV2Plugin::set_state(const XMLNode& node, int version)
|
|||||||
}
|
}
|
||||||
|
|
||||||
latency_compute_run();
|
latency_compute_run();
|
||||||
|
#endif
|
||||||
|
|
||||||
return Plugin::set_state(node, version);
|
return Plugin::set_state(node, version);
|
||||||
}
|
}
|
||||||
|
@ -882,7 +882,12 @@ PluginInsert::set_control_ids (const XMLNode& node, int version)
|
|||||||
|
|
||||||
if ((prop = (*iter)->property (X_("parameter"))) != 0) {
|
if ((prop = (*iter)->property (X_("parameter"))) != 0) {
|
||||||
uint32_t p = atoi (prop->value());
|
uint32_t p = atoi (prop->value());
|
||||||
|
|
||||||
|
/* this may create the new controllable */
|
||||||
|
|
||||||
boost::shared_ptr<Evoral::Control> c = control (Evoral::Parameter (PluginAutomation, 0, p));
|
boost::shared_ptr<Evoral::Control> c = control (Evoral::Parameter (PluginAutomation, 0, p));
|
||||||
|
|
||||||
|
#ifndef NO_PLUGIN_STATE
|
||||||
if (!c) {
|
if (!c) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -890,6 +895,7 @@ PluginInsert::set_control_ids (const XMLNode& node, int version)
|
|||||||
if (ac) {
|
if (ac) {
|
||||||
ac->set_state (**iter, version);
|
ac->set_state (**iter, version);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2558,27 +2558,9 @@ Route::set_processor_state (const XMLNode& node)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (boost::dynamic_pointer_cast<PluginInsert>(processor)) {
|
if (processor->set_state (**niter, Stateful::current_state_version) != 0) {
|
||||||
cerr << "Working on plugin processor state for " << processor->name() << endl;
|
/* This processor could not be configured. Turn it into a UnknownProcessor */
|
||||||
#ifndef NO_PLUGIN_STATE
|
processor.reset (new UnknownProcessor (_session, **niter));
|
||||||
cerr << "plugin state allowed\n";
|
|
||||||
if (processor->set_state (**niter, Stateful::current_state_version) != 0) {
|
|
||||||
/* This processor could not be configured. Turn it into a UnknownProcessor */
|
|
||||||
processor.reset (new UnknownProcessor (_session, **niter));
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
cerr << "plugin state dis-allowed\n";
|
|
||||||
/* plugin, with NO_PLUGIN_STATE defined
|
|
||||||
* =>::set_state() not allowed. Do not
|
|
||||||
* display a message here - things will
|
|
||||||
* get too verbose.
|
|
||||||
*/
|
|
||||||
#endif
|
|
||||||
} else {
|
|
||||||
if (processor->set_state (**niter, Stateful::current_state_version) != 0) {
|
|
||||||
/* This processor could not be configured. Turn it into a UnknownProcessor */
|
|
||||||
processor.reset (new UnknownProcessor (_session, **niter));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* we have to note the monitor send here, otherwise a new one will be created
|
/* we have to note the monitor send here, otherwise a new one will be created
|
||||||
|
@ -197,14 +197,15 @@ int
|
|||||||
VSTPlugin::set_state (const XMLNode& node, int version)
|
VSTPlugin::set_state (const XMLNode& node, int version)
|
||||||
{
|
{
|
||||||
LocaleGuard lg (X_("POSIX"));
|
LocaleGuard lg (X_("POSIX"));
|
||||||
|
int ret = -1;
|
||||||
|
|
||||||
if (node.name() != state_node_name()) {
|
if (node.name() != state_node_name()) {
|
||||||
error << _("Bad node sent to VSTPlugin::set_state") << endmsg;
|
error << _("Bad node sent to VSTPlugin::set_state") << endmsg;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NO_PLUGIN_STATE
|
||||||
XMLNode* child;
|
XMLNode* child;
|
||||||
int ret = -1;
|
|
||||||
|
|
||||||
if ((child = find_named_node (node, X_("chunk"))) != 0) {
|
if ((child = find_named_node (node, X_("chunk"))) != 0) {
|
||||||
|
|
||||||
@ -237,6 +238,7 @@ VSTPlugin::set_state (const XMLNode& node, int version)
|
|||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
Plugin::set_state (node, version);
|
Plugin::set_state (node, version);
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user