/*
- Copyright (C) 2008 Paul Davis
+ Copyright (C) 2008 Paul Davis
Author: Sakari Bergen
This program is free software; you can redistribute it and/or modify it
using namespace ARDOUR;
SessionMetadata::SessionMetadata ()
-{
+{
/*** General ***/
map.insert (Property ("comment", ""));
map.insert (Property ("copyright", ""));
if (value.empty()) {
return 0;
}
-
+
XMLNode val ("value", value);
XMLNode * node = new XMLNode (name);
node->add_child_copy (val);
-
+
return node;
}
std::cerr << "Programming error in SessionMetadata::get_value" << std::endl;
return "";
}
-
+
return it->second;
}
std::cerr << "Programming error in SessionMetadata::set_value" << std::endl;
return;
}
-
+
it->second = value;
}
{
XMLNode * node = new XMLNode ("Metadata");
XMLNode * prop;
-
+
for (PropertyMap::const_iterator it = map.begin(); it != map.end(); ++it) {
if ((prop = get_xml (it->first))) {
node->add_child_nocopy (*prop);
}
}
-
+
return *node;
}
int
-SessionMetadata::set_state (const XMLNode & state)
+SessionMetadata::set_state (const XMLNode & state, int /*version*/)
{
const XMLNodeList & children = state.children();
ustring name;
ustring value;
XMLNode * node;
-
+
for (XMLNodeConstIterator it = children.begin(); it != children.end(); it++) {
node = *it;
if (node->children().empty()) {
continue;
}
-
+
name = node->name();
node = *node->children().begin();
value = node->content();
-
+
set_value (name, value);
}
-
+
return 0;
}