diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-01-10 21:05:54 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-01-10 21:05:54 +0000 |
| commit | 1ee5cc88cb32927f95358e2d03985caf5a1d8e05 (patch) | |
| tree | dd7a17fbcae7179d79249d5bde08319d6159cf7f /src/package.h | |
| parent | 0ffc4c35a9ae232f3bed9329997c043c42372f6f (diff) | |
Move some more stuff up to Package.
Diffstat (limited to 'src/package.h')
| -rw-r--r-- | src/package.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/package.h b/src/package.h index ac33ac9f..b0733b53 100644 --- a/src/package.h +++ b/src/package.h @@ -22,6 +22,7 @@ #include "package_base.h" #include "dc_cpl.h" +#include "util.h" #include <boost/foreach.hpp> namespace dcp { @@ -63,7 +64,40 @@ public: } } + std::list<boost::shared_ptr<T> > cpls () const + { + return _cpls; + } + + void add_cpl (boost::shared_ptr<T> cpl) { + _cpls.push_back (cpl); + } + protected: + + /** Write all the XML files for this package. + * @param standand INTEROP, SMPTE or IMP + * @param metadata Metadata to use for PKL and asset map files. + * @param signer Signer to use, or 0. + */ + void do_write_xml ( + Standard standard, + dcp::XMLMetadata metadata, + boost::shared_ptr<const CertificateChain> signer + ) + { + BOOST_FOREACH (boost::shared_ptr<T> i, _cpls) { + std::string const filename = "cpl_" + i->id() + ".xml"; + i->write_xml (_directory / filename, standard, signer); + } + + std::string const pkl_uuid = make_uuid (); + boost::filesystem::path const pkl_path = write_pkl (standard, pkl_uuid, metadata, signer); + + write_volindex (standard); + write_assetmap (standard, pkl_uuid, boost::filesystem::file_size (pkl_path), metadata); + } + /** the CPLs that make up this package */ std::list<boost::shared_ptr<T> > _cpls; }; |
