/*
- Copyright (C) 2001 Paul Davis
+ Copyright (C) 2001 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
/* create an IOProcessor that proxies to an existing IO object */
-IOProcessor::IOProcessor (Session& s, boost::shared_ptr<IO> in, boost::shared_ptr<IO> out,
+IOProcessor::IOProcessor (Session& s, boost::shared_ptr<IO> in, boost::shared_ptr<IO> out,
const string& proc_name, DataType /*dtype*/)
: Processor(s, proc_name)
, _input (in)
IOProcessor::state (bool full_state)
{
XMLNode& node (Processor::state (full_state));
-
+
if (_own_input) {
node.add_property ("own-input", "yes");
if (_input) {
node.add_property ("input", _input->name());
}
}
-
+
if (_own_output) {
node.add_property ("own-output", "yes");
if (_output) {
}
int
-IOProcessor::set_state (const XMLNode& node)
+IOProcessor::set_state (const XMLNode& node, int version)
{
const XMLProperty *prop;
const XMLNode *io_node = 0;
- Processor::set_state(node);
+ Processor::set_state(node, version);
if ((prop = node.property ("own-input")) != 0) {
- _own_input = (prop->value() == "yes");
+ _own_input = string_is_affirmative (prop->value());
}
if ((prop = node.property ("own-output")) != 0) {
- _own_output = (prop->value() == "yes");
+ _own_output = string_is_affirmative (prop->value());
}
/* don't attempt to set state for a proxied IO that we don't own */
XMLNodeList nlist = node.children();
XMLNodeIterator niter;
-
+
if (_own_input) {
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
if ((*niter)->name() == "input") {
break;
}
}
-
+
if (io_node) {
- _input->set_state(*io_node);
-
+ _input->set_state(*io_node, version);
+
// legacy sessions: use IO name
if ((prop = node.property ("name")) == 0) {
set_name (_input->name());
}
-
+
} else {
/* no input */
}
}
-
+
if (_own_output) {
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
if ((*niter)->name() == "output") {
break;
}
}
-
+
if (io_node) {
- _output->set_state(*io_node);
-
+ _output->set_state(*io_node, version);
+
// legacy sessions: use IO name
if ((prop = node.property ("name")) == 0) {
set_name (_output->name());
}
}
-ChanCount
-IOProcessor::output_streams() const
-{
- return _output ? _output->n_ports() : ChanCount::ZERO;
-}
-
-ChanCount
-IOProcessor::input_streams () const
-{
- return _input ? _input->n_ports() : ChanCount::ZERO;
-}
-
ChanCount
IOProcessor::natural_output_streams() const
{