Tidy up a bit; vertical white space, group metadata together,
authorCarl Hetherington <cth@carlh.net>
Wed, 26 Aug 2020 21:24:58 +0000 (23:24 +0200)
committerCarl Hetherington <cth@carlh.net>
Sun, 20 Sep 2020 17:30:46 +0000 (19:30 +0200)
order accessors the same as members, getter before setter.

src/cpl.h

index 1132952a65d1c16699885a7d82af4b2b81799fb4..b7055e5d7beebc94219f51205196cc8620626ace 100644 (file)
--- a/src/cpl.h
+++ b/src/cpl.h
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2014-2019 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2014-2020 Carl Hetherington <cth@carlh.net>
 
     This file is part of libdcp.
 
     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 <boost/shared_ptr.hpp>
+#include "types.h"
+#include <boost/filesystem.hpp>
 #include <boost/function.hpp>
 #include <boost/optional.hpp>
-#include <boost/filesystem.hpp>
+#include <boost/shared_ptr.hpp>
 #include <list>
 
+
 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> reel);
        void add (DecryptedKDM const &);
 
-       /** @return contents of the &lt;AnnotationText&gt; node */
-       std::string annotation_text () const {
-               return _annotation_text;
+       /** @return the reels in this CPL */
+       std::list<boost::shared_ptr<Reel> > reels () const {
+               return _reels;
        }
 
+       /** @return the ReelMXFs in this CPL in all reels */
+       std::list<boost::shared_ptr<const ReelMXF> > reel_mxfs () const;
+       std::list<boost::shared_ptr<ReelMXF> > reel_mxfs ();
+
+       bool encrypted () const;
+
+       void write_xml (
+               boost::filesystem::path file,
+               Standard standard,
+               boost::shared_ptr<const CertificateChain>
+               ) const;
+
+       void resolve_refs (std::list<boost::shared_ptr<Asset> >);
+
+       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 &lt;AnnotationText&gt; 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<boost::shared_ptr<Reel> > reels () const {
-               return _reels;
+       ContentVersion content_version () const {
+               return _content_version;
        }
 
-       /** @return the ReelMXFs in this CPL in all reels.
-        */
-       std::list<boost::shared_ptr<const ReelMXF> > reel_mxfs () const;
-       std::list<boost::shared_ptr<ReelMXF> > reel_mxfs ();
-
-       bool encrypted () const;
-
-       void write_xml (
-               boost::filesystem::path file,
-               Standard standard,
-               boost::shared_ptr<const CertificateChain>
-               ) const;
-
-       void resolve_refs (std::list<boost::shared_ptr<Asset> >);
-
-       int64_t duration () const;
-
-       boost::optional<Standard> standard () const {
-               return _standard;
+       /** Set the contents of the ContentVersion tag */
+       void set_content_version (ContentVersion v) {
+               _content_version = v;
        }
 
        std::list<Rating> ratings () const {
@@ -150,8 +155,8 @@ public:
                _ratings = r;
        }
 
-       ContentVersion content_version () const {
-               return _content_version;
+       boost::optional<Standard> standard () const {
+               return _standard;
        }
 
        static std::string static_pkl_type (Standard standard);
@@ -168,13 +173,16 @@ private:
        std::string _content_title_text;            ///< &lt;ContentTitleText&gt;
        ContentKind _content_kind;                  ///< &lt;ContentKind&gt;
        ContentVersion _content_version;            ///< &lt;ContentVersion&gt;
-       std::list<boost::shared_ptr<Reel> > _reels;
        std::list<Rating> _ratings;
 
+       std::list<boost::shared_ptr<Reel> > _reels;
+
        /** Standard of CPL that was read in */
        boost::optional<Standard> _standard;
 };
 
+
 }
 
+
 #endif