projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
switch Evoral::Sequence debugging to use DEBUG_TRACE(); Sequence uses multiset<....
[ardour.git]
/
libs
/
ardour
/
session_metadata.cc
diff --git
a/libs/ardour/session_metadata.cc
b/libs/ardour/session_metadata.cc
index 7eb24e758648666d1617cb8e1d6d6731aaa2598b..10c39983df93fbd4b30c50e1e0a682808b1b850f 100644
(file)
--- 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
Author: Sakari Bergen
This program is free software; you can redistribute it and/or modify it
@@
-17,16
+17,17
@@
675 Mass Ave, Cambridge, MA 02139, USA.
*/
675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include
<ardour/session_metadata.h>
+#include
"ardour/session_metadata.h"
#include <iostream>
#include <sstream>
#include <iostream>
#include <sstream>
+using namespace std;
+using namespace Glib;
using namespace ARDOUR;
using namespace ARDOUR;
-
SessionMetadata::SessionMetadata ()
SessionMetadata::SessionMetadata ()
-{
+{
/*** General ***/
map.insert (Property ("comment", ""));
map.insert (Property ("copyright", ""));
/*** General ***/
map.insert (Property ("comment", ""));
map.insert (Property ("copyright", ""));
@@
-93,11
+94,11
@@
SessionMetadata::get_xml (const ustring & name)
if (value.empty()) {
return 0;
}
if (value.empty()) {
return 0;
}
-
+
XMLNode val ("value", value);
XMLNode * node = new XMLNode (name);
node->add_child_copy (val);
XMLNode val ("value", value);
XMLNode * node = new XMLNode (name);
node->add_child_copy (val);
-
+
return node;
}
return node;
}
@@
-110,7
+111,7
@@
SessionMetadata::get_value (const ustring & name) const
std::cerr << "Programming error in SessionMetadata::get_value" << std::endl;
return "";
}
std::cerr << "Programming error in SessionMetadata::get_value" << std::endl;
return "";
}
-
+
return it->second;
}
return it->second;
}
@@
-129,7
+130,7
@@
SessionMetadata::set_value (const ustring & name, const ustring & value)
std::cerr << "Programming error in SessionMetadata::set_value" << std::endl;
return;
}
std::cerr << "Programming error in SessionMetadata::set_value" << std::endl;
return;
}
-
+
it->second = value;
}
it->second = value;
}
@@
-151,37
+152,37
@@
SessionMetadata::get_state ()
{
XMLNode * node = new XMLNode ("Metadata");
XMLNode * prop;
{
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);
}
}
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
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;
{
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;
}
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();
name = node->name();
node = *node->children().begin();
value = node->content();
-
+
set_value (name, value);
}
set_value (name, value);
}
-
+
return 0;
}
return 0;
}