From a0e7285ae99ca4630a8096884f05ad4e1b3fc204 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 26 Aug 2020 23:24:58 +0200 Subject: [PATCH] Tidy up a bit; vertical white space, group metadata together, order accessors the same as members, getter before setter. --- src/cpl.h | 84 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 46 insertions(+), 38 deletions(-) diff --git a/src/cpl.h b/src/cpl.h index 1132952a..b7055e5d 100644 --- a/src/cpl.h +++ b/src/cpl.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2014-2019 Carl Hetherington + Copyright (C) 2014-2020 Carl Hetherington This file is part of libdcp. @@ -31,31 +31,37 @@ files in the program, then also delete it here. */ + /** @file src/cpl.h * @brief CPL class. */ + #ifndef LIBDCP_CPL_H #define LIBDCP_CPL_H -#include "types.h" + +#include "asset.h" #include "certificate.h" #include "key.h" -#include "asset.h" -#include +#include "types.h" +#include #include #include -#include +#include #include + namespace dcp { + class ReelMXF; class Reel; class MXFMetadata; class CertificateChain; class DecryptedKDM; + /** @class CPL * @brief A Composition Playlist. */ @@ -74,11 +80,27 @@ public: void add (boost::shared_ptr reel); void add (DecryptedKDM const &); - /** @return contents of the <AnnotationText> node */ - std::string annotation_text () const { - return _annotation_text; + /** @return the reels in this CPL */ + std::list > reels () const { + return _reels; } + /** @return the ReelMXFs in this CPL in all reels */ + std::list > reel_mxfs () const; + std::list > reel_mxfs (); + + bool encrypted () const; + + void write_xml ( + boost::filesystem::path file, + Standard standard, + boost::shared_ptr + ) const; + + void resolve_refs (std::list >); + + int64_t duration () const; + void set_issuer (std::string issuer) { _issuer = issuer; } @@ -91,6 +113,11 @@ public: _issue_date = issue_date; } + /** @return contents of the <AnnotationText> node */ + std::string annotation_text () const { + return _annotation_text; + } + void set_annotation_text (std::string at) { _annotation_text = at; } @@ -104,11 +131,6 @@ public: _content_title_text = ct; } - /** Set the contents of the ContentVersion tag */ - void set_content_version (ContentVersion v) { - _content_version = v; - } - /** @return the type of the content, used by media servers * to categorise things (e.g. feature, trailer, etc.) */ @@ -116,30 +138,13 @@ public: return _content_kind; } - /** @return the reels in this CPL */ - std::list > reels () const { - return _reels; + ContentVersion content_version () const { + return _content_version; } - /** @return the ReelMXFs in this CPL in all reels. - */ - std::list > reel_mxfs () const; - std::list > reel_mxfs (); - - bool encrypted () const; - - void write_xml ( - boost::filesystem::path file, - Standard standard, - boost::shared_ptr - ) const; - - void resolve_refs (std::list >); - - int64_t duration () const; - - boost::optional standard () const { - return _standard; + /** Set the contents of the ContentVersion tag */ + void set_content_version (ContentVersion v) { + _content_version = v; } std::list ratings () const { @@ -150,8 +155,8 @@ public: _ratings = r; } - ContentVersion content_version () const { - return _content_version; + boost::optional standard () const { + return _standard; } static std::string static_pkl_type (Standard standard); @@ -168,13 +173,16 @@ private: std::string _content_title_text; ///< <ContentTitleText> ContentKind _content_kind; ///< <ContentKind> ContentVersion _content_version; ///< <ContentVersion> - std::list > _reels; std::list _ratings; + std::list > _reels; + /** Standard of CPL that was read in */ boost::optional _standard; }; + } + #endif -- 2.30.2