From e2b29fb7033ff554988ce1bfc781822a821cfa15 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 28 Feb 2023 14:17:04 +0100 Subject: Add include_mca_subdescriptors option to CPL::write_xml(). --- src/cpl.cc | 8 ++++---- src/cpl.h | 7 +++++-- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/cpl.cc b/src/cpl.cc index f3cebe37..33a690f3 100644 --- a/src/cpl.cc +++ b/src/cpl.cc @@ -182,7 +182,7 @@ CPL::set (std::vector> reels) void -CPL::write_xml (boost::filesystem::path file, shared_ptr signer) const +CPL::write_xml(boost::filesystem::path file, shared_ptr signer, bool include_mca_subdescriptors) const { xmlpp::Document doc; xmlpp::Element* root; @@ -227,7 +227,7 @@ CPL::write_xml (boost::filesystem::path file, shared_ptr for (auto i: _reels) { auto asset_list = i->write_to_cpl (reel_list, _standard); if (first && _standard == Standard::SMPTE) { - maybe_write_composition_metadata_asset (asset_list); + maybe_write_composition_metadata_asset(asset_list, include_mca_subdescriptors); first = false; } } @@ -430,7 +430,7 @@ CPL::write_mca_subdescriptors(xmlpp::Element* parent, shared_ptrmain_sound()) { auto asset = _reels.front()->main_sound()->asset(); - if (asset) { + if (asset && include_mca_subdescriptors) { write_mca_subdescriptors(meta, asset); } } diff --git a/src/cpl.h b/src/cpl.h index 629a296a..71ac8545 100644 --- a/src/cpl.h +++ b/src/cpl.h @@ -124,10 +124,13 @@ public: * * @param file Filename to write * @param signer Signer to sign the CPL, or 0 to add no signature + * @param include_mca_subdescriptors true to add a MCASubDescriptors tag to metadata, + * false to omit it. */ void write_xml ( boost::filesystem::path file, - std::shared_ptr + std::shared_ptr, + bool include_mca_subdescriptors = true ) const; void resolve_refs (std::vector>); @@ -344,7 +347,7 @@ protected: private: friend struct ::verify_invalid_language3; - void maybe_write_composition_metadata_asset (xmlpp::Element* node) const; + void maybe_write_composition_metadata_asset(xmlpp::Element* node, bool include_mca_subdescriptors) const; void read_composition_metadata_asset (cxml::ConstNodePtr node); void write_mca_subdescriptors(xmlpp::Element* parent, std::shared_ptr asset) const; -- cgit v1.2.3