X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fsession_metadata.cc;h=10c39983df93fbd4b30c50e1e0a682808b1b850f;hb=9e0d03020ff47773f7d1c0414de1c74e6c9e0dac;hp=8805cf5a0d9e953e5091888900e1072f940c9f79;hpb=3b89d9eaa03406a5e03648f47734211f09b89d62;p=ardour.git diff --git a/libs/ardour/session_metadata.cc b/libs/ardour/session_metadata.cc index 8805cf5a0d..10c39983df 100644 --- a/libs/ardour/session_metadata.cc +++ b/libs/ardour/session_metadata.cc @@ -1,5 +1,5 @@ /* - 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 @@ -27,7 +27,7 @@ using namespace Glib; using namespace ARDOUR; SessionMetadata::SessionMetadata () -{ +{ /*** General ***/ map.insert (Property ("comment", "")); map.insert (Property ("copyright", "")); @@ -94,11 +94,11 @@ SessionMetadata::get_xml (const ustring & name) if (value.empty()) { return 0; } - + XMLNode val ("value", value); XMLNode * node = new XMLNode (name); node->add_child_copy (val); - + return node; } @@ -111,7 +111,7 @@ SessionMetadata::get_value (const ustring & name) const std::cerr << "Programming error in SessionMetadata::get_value" << std::endl; return ""; } - + return it->second; } @@ -130,7 +130,7 @@ SessionMetadata::set_value (const ustring & name, const ustring & value) std::cerr << "Programming error in SessionMetadata::set_value" << std::endl; return; } - + it->second = value; } @@ -152,37 +152,37 @@ SessionMetadata::get_state () { 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; }