diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-05-04 11:13:04 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-05-04 11:13:04 +0100 |
| commit | af87bfc82beee0b0600558c84c3843dfd5a252f6 (patch) | |
| tree | 6f0cb5a87ba4662ac1e23fae67589be9d374e4f6 /src/dcp.cc | |
| parent | 09ad2806848f5c3609b7915da504f94db099e3af (diff) | |
Split metadata into XML and MXF bits; remove singleton.
Diffstat (limited to 'src/dcp.cc')
| -rw-r--r-- | src/dcp.cc | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -58,21 +58,21 @@ DCP::DCP (string directory) } void -DCP::write_xml () const +DCP::write_xml (XMLMetadata const & metadata) const { for (list<shared_ptr<const CPL> >::const_iterator i = _cpls.begin(); i != _cpls.end(); ++i) { - (*i)->write_xml (); + (*i)->write_xml (metadata); } string pkl_uuid = make_uuid (); - string pkl_path = write_pkl (pkl_uuid); + string pkl_path = write_pkl (pkl_uuid, metadata); write_volindex (); - write_assetmap (pkl_uuid, boost::filesystem::file_size (pkl_path)); + write_assetmap (pkl_uuid, boost::filesystem::file_size (pkl_path), metadata); } std::string -DCP::write_pkl (string pkl_uuid) const +DCP::write_pkl (string pkl_uuid, XMLMetadata const & metadata) const { assert (!_cpls.empty ()); @@ -88,9 +88,9 @@ DCP::write_pkl (string pkl_uuid) const << " <Id>urn:uuid:" << pkl_uuid << "</Id>\n" /* XXX: this is a bit of a hack */ << " <AnnotationText>" << _cpls.front()->name() << "</AnnotationText>\n" - << " <IssueDate>" << Metadata::instance()->issue_date << "</IssueDate>\n" - << " <Issuer>" << Metadata::instance()->issuer << "</Issuer>\n" - << " <Creator>" << Metadata::instance()->creator << "</Creator>\n" + << " <IssueDate>" << metadata.issue_date << "</IssueDate>\n" + << " <Issuer>" << metadata.issuer << "</Issuer>\n" + << " <Creator>" << metadata.creator << "</Creator>\n" << " <AssetList>\n"; list<shared_ptr<const Asset> > a = assets (); @@ -123,7 +123,7 @@ DCP::write_volindex () const } void -DCP::write_assetmap (string pkl_uuid, int pkl_length) const +DCP::write_assetmap (string pkl_uuid, int pkl_length, XMLMetadata const & metadata) const { boost::filesystem::path p; p /= _directory; @@ -133,10 +133,10 @@ DCP::write_assetmap (string pkl_uuid, int pkl_length) const am << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" << "<AssetMap xmlns=\"http://www.smpte-ra.org/schemas/429-9/2007/AM\">\n" << " <Id>urn:uuid:" << make_uuid() << "</Id>\n" - << " <Creator>" << Metadata::instance()->creator << "</Creator>\n" + << " <Creator>" << metadata.creator << "</Creator>\n" << " <VolumeCount>1</VolumeCount>\n" - << " <IssueDate>" << Metadata::instance()->issue_date << "</IssueDate>\n" - << " <Issuer>" << Metadata::instance()->issuer << "</Issuer>\n" + << " <IssueDate>" << metadata.issue_date << "</IssueDate>\n" + << " <Issuer>" << metadata.issuer << "</Issuer>\n" << " <AssetList>\n"; am << " <Asset>\n" |
