const string Processor::state_node_name = "Processor";
Processor::Processor(Session& session, const string& name, Placement p)
- : Automatable(session, name)
+ : SessionObject(session, name)
+ , AutomatableControls(session)
, _active(false)
, _next_ab_is_active(false)
, _configured(false)
}
}
-void
-Processor::set_active (bool yn)
-{
- _active = yn;
- ActiveChanged ();
-}
-
XMLNode&
Processor::get_state (void)
{
XMLNode& automation = Automatable::get_automation_state();
- for (set<ParamID>::iterator x = _visible_controls.begin(); x != _visible_controls.end(); ++x) {
+ for (set<Evoral::Parameter>::iterator x = _visible_controls.begin(); x != _visible_controls.end(); ++x) {
if (x != _visible_controls.begin()) {
sstr << ' ';
}
Processor::set_state (const XMLNode& node)
{
const XMLProperty *prop;
+ const XMLProperty *legacy_active = 0;
+ const XMLProperty *legacy_placement = 0;
// may not exist for legacy sessions
if ((prop = node.property ("name")) != 0) {
if ((prop = (*niter)->property ("path")) != 0) {
old_set_automation_state (*(*niter));
} else {
- set_automation_state (*(*niter), ParamID(PluginAutomation));
+ set_automation_state (*(*niter), Evoral::Parameter(PluginAutomation));
}
if ((prop = (*niter)->property ("visible")) != 0) {
break;
}
// FIXME: other automation types?
- mark_automation_visible (ParamID(PluginAutomation, what), true);
+ mark_automation_visible (Evoral::Parameter(PluginAutomation, 0, what), true);
}
}
} else if ((*niter)->name() == "extra") {
_extra_xml = new XMLNode (*(*niter));
+ } else if ((*niter)->name() == "Redirect") {
+ if ( !(legacy_active = (*niter)->property("active"))) {
+ error << string_compose(_("No %1 property flag in element %2"), "active", (*niter)->name()) << endl;
+ }
+ if ( !(legacy_placement = (*niter)->property("placement"))) {
+ error << string_compose(_("No %1 property flag in element %2"), "placement", (*niter)->name()) << endl;
+ }
}
}
if ((prop = node.property ("active")) == 0) {
- error << _("XML node describing a processor is missing the `active' field") << endmsg;
- return -1;
+ warning << _("XML node describing a processor is missing the `active' field, trying legacy active flag from child node") << endmsg;
+ if (legacy_active) {
+ prop = legacy_active;
+ } else {
+ error << _("No child node with active property") << endmsg;
+ return -1;
+ }
}
if (_active != (prop->value() == "yes")) {
_active = !_active;
ActiveChanged (); /* EMIT_SIGNAL */
- }
-
+ }
+
if ((prop = node.property ("placement")) == 0) {
- error << _("XML node describing a processor is missing the `placement' field") << endmsg;
- return -1;
+ warning << _("XML node describing a processor is missing the `placement' field, trying legacy placement flag from child node") << endmsg;
+ if (legacy_placement) {
+ prop = legacy_placement;
+ } else {
+ error << _("No child node with placement property") << endmsg;
+ return -1;
+ }
}
/* hack to handle older sessions before we only used EnumWriter */
return 0;
}
+bool
+Processor::configure_io (ChanCount in, ChanCount out)
+{
+ /* this class assumes static output stream count.
+ Derived classes must override, and must set "out"
+ to reflect "in" before calling this.
+ */
+
+ _configured_input = in;
+ _configured = true;
+
+ return true;
+}