summaryrefslogtreecommitdiff
path: root/src/cpl.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-01-28 14:52:32 +0000
committerCarl Hetherington <cth@carlh.net>2014-01-28 14:52:32 +0000
commit4126980a15f4f6bb981d0793bd37483456c5bc79 (patch)
treefbc22b199fc7c747aa74e03ef22e65d0d61b2d1c /src/cpl.cc
parentd88c2244d4f90d54164fcc856c3ba73809756381 (diff)
Misc fixes.
Diffstat (limited to 'src/cpl.cc')
-rw-r--r--src/cpl.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/cpl.cc b/src/cpl.cc
index 99c14d40..fc1b878c 100644
--- a/src/cpl.cc
+++ b/src/cpl.cc
@@ -47,9 +47,18 @@ using namespace dcp;
CPL::CPL (string annotation_text, ContentKind content_kind)
: _annotation_text (annotation_text)
+ /* default _content_title_text to _annotation_text */
+ , _content_title_text (annotation_text)
, _content_kind (content_kind)
+ , _content_version_id ("urn:uuid:" + make_uuid ())
{
-
+ /* default _content_version_id to and _content_version_label to
+ a random ID and the current time.
+ */
+ time_t now = time (0);
+ struct tm* tm = localtime (&now);
+ _content_version_id = "urn:uuid:" + make_uuid() + tm_to_string (tm);
+ _content_version_label_text = _content_version_id;
}
/** Construct a CPL object from a XML file */
@@ -114,7 +123,7 @@ CPL::write_xml (boost::filesystem::path file, Standard standard, XMLMetadata met
root->add_child("IssueDate")->add_child_text (metadata.issue_date);
root->add_child("Issuer")->add_child_text (metadata.issuer);
root->add_child("Creator")->add_child_text (metadata.creator);
- root->add_child("ContentTitleText")->add_child_text (_content_version_label_text);
+ root->add_child("ContentTitleText")->add_child_text (_content_title_text);
root->add_child("ContentKind")->add_child_text (content_kind_to_string (_content_kind));
{
xmlpp::Node* cv = root->add_child ("ContentVersion");