+ XMLNode * io;
+ bool name_ok = false;
+ bool id_ok = false;
+
+ if (!(io = xml_track.child ("IO"))) {
+ return false;
+ }
+
+ XMLPropertyList const & props = io->properties();
+
+ for (XMLPropertyList::const_iterator it = props.begin(); it != props.end(); ++it) {
+ string prop = (*it)->name();
+ if (!prop.compare ("gain") || !prop.compare ("iolimits")) {
+ // All ok
+ } else if (!prop.compare("name")) {
+ name = (*it)->value();
+ name_ok = true;
+ } else if (!prop.compare("id")) {
+ PBD::ID id;
+ (*it)->set_value (id.to_s());
+ id_ok = true;
+ } else if (!prop.compare("inputs")) {
+ // TODO Handle this properly!
+ /* Input and output ports are counted and added empty, so that no in/output connecting function fails. */
+ uint32_t num_inputs = std::count ((*it)->value().begin(), (*it)->value().end(), '{');
+ std::string value;
+ for (uint32_t i = 0; i < num_inputs; i++) { value += "{}"; }
+ (*it)->set_value (value);
+ } else if (!prop.compare("outputs")) {
+ // TODO See comments above
+ uint32_t num_outputs = std::count ((*it)->value().begin(), (*it)->value().end(), '{');
+ std::string value;
+ for (uint32_t i = 0; i < num_outputs; i++) { value += "{}"; }
+ (*it)->set_value (value);
+ } else {
+ std::cerr << string_compose (X_("AudioTrackImporter: did not recognise XML-property \"%1\""), prop) << endmsg;
+ }
+ }
+
+ if (!name_ok) {
+ error << X_("AudioTrackImporter: did not find necessary XML-property \"name\"") << endmsg;
+ return false;
+ }
+
+ if (!id_ok) {
+ error << X_("AudioTrackImporter: did not find necessary XML-property \"id\"") << endmsg;
+ return false;
+ }
+
+ XMLNodeList const & controllables = io->children (Controllable::xml_node_name);
+ for (XMLNodeList::const_iterator it = controllables.begin(); it != controllables.end(); ++it) {
+ parse_controllable (**it);
+ }
+
+ XMLNodeList const & processors = io->children ("Processor");
+ for (XMLNodeList::const_iterator it = processors.begin(); it != processors.end(); ++it) {
+ parse_processor (**it);
+ }
+
+ XMLNodeList const & automations = io->children ("Automation");
+ for (XMLNodeList::const_iterator it = automations.begin(); it != automations.end(); ++it) {
+ parse_automation (**it);
+ }
+
+ return true;