}
if (statbuf.st_size != 0) {
- cerr << string_compose (_("Loading system configuration file %1"), rcfile) << endl;
+ info << string_compose (_("Loading system configuration file %1"), rcfile) << endl;
if (!tree.read (rcfile.c_str())) {
error << string_compose(_("Ardour: cannot read system configuration file \"%1\""), rcfile) << endmsg;
return -1;
}
- if (set_state (*tree.root())) {
+ if (set_state (*tree.root(), Stateful::current_state_version)) {
error << string_compose(_("Ardour: system configuration file \"%1\" not loaded successfully."), rcfile) << endmsg;
return -1;
}
}
if (statbuf.st_size != 0) {
- cerr << string_compose (_("Loading user configuration file %1"), rcfile) << endl;
+ info << string_compose (_("Loading user configuration file %1"), rcfile) << endl;
if (!tree.read (rcfile)) {
error << string_compose(_("Ardour: cannot read configuration file \"%1\""), rcfile) << endmsg;
return -1;
}
- if (set_state (*tree.root())) {
+ if (set_state (*tree.root(), Stateful::current_state_version)) {
error << string_compose(_("Ardour: user configuration file \"%1\" not loaded successfully."), rcfile) << endmsg;
return -1;
}
root = new XMLNode("Ardour");
- MIDI::Manager::PortMap::const_iterator i;
- const MIDI::Manager::PortMap& ports = MIDI::Manager::instance()->get_midi_ports();
+ const MIDI::Manager::PortList& ports = MIDI::Manager::instance()->get_midi_ports();
- for (i = ports.begin(); i != ports.end(); ++i) {
- root->add_child_nocopy(i->second->get_state());
+ for (MIDI::Manager::PortList::const_iterator i = ports.begin(); i != ports.end(); ++i) {
+ root->add_child_nocopy((*i)->get_state());
}
root->add_child_nocopy (get_variables ());
}
int
-RCConfiguration::set_state (const XMLNode& root, int version)
+RCConfiguration::set_state (const XMLNode& root, int /*version*/)
{
if (root.name() != "Ardour") {
return -1;
MIDI::Port::Descriptor desc (*node);
map<string,XMLNode>::iterator x;
+
if ((x = midi_ports.find (desc.tag)) != midi_ports.end()) {
- midi_ports.erase (x);
+ warning << string_compose (_("Duplicate MIDI port definition found (tag=\"%1\") - ignored"),
+ desc.tag) << endmsg;
+ continue;
}
midi_ports.insert (pair<string,XMLNode>(desc.tag,*node));
}