From af87bfc82beee0b0600558c84c3843dfd5a252f6 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 4 May 2013 11:13:04 +0100 Subject: Split metadata into XML and MXF bits; remove singleton. --- src/dcp.cc | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/dcp.cc') diff --git a/src/dcp.cc b/src/dcp.cc index e74e0d95..7af3f353 100644 --- a/src/dcp.cc +++ b/src/dcp.cc @@ -58,21 +58,21 @@ DCP::DCP (string directory) } void -DCP::write_xml () const +DCP::write_xml (XMLMetadata const & metadata) const { for (list >::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 << " urn:uuid:" << pkl_uuid << "\n" /* XXX: this is a bit of a hack */ << " " << _cpls.front()->name() << "\n" - << " " << Metadata::instance()->issue_date << "\n" - << " " << Metadata::instance()->issuer << "\n" - << " " << Metadata::instance()->creator << "\n" + << " " << metadata.issue_date << "\n" + << " " << metadata.issuer << "\n" + << " " << metadata.creator << "\n" << " \n"; list > 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 << "\n" << "\n" << " urn:uuid:" << make_uuid() << "\n" - << " " << Metadata::instance()->creator << "\n" + << " " << metadata.creator << "\n" << " 1\n" - << " " << Metadata::instance()->issue_date << "\n" - << " " << Metadata::instance()->issuer << "\n" + << " " << metadata.issue_date << "\n" + << " " << metadata.issuer << "\n" << " \n"; am << " \n" -- cgit v1.2.3