Include trimming.
[libdcp.git] / src / reel.h
index 083ecd0e8f5a7c814e154d8f6bdaf3709abb0611..52f41bfaa5c670c83565650c1e98057587dce37f 100644 (file)
     files in the program, then also delete it here.
 */
 
+
+/** @file  src/reel.cc
+ *  @brief Reel class
+ */
+
+
 #ifndef LIBDCP_REEL_H
 #define LIBDCP_REEL_H
 
+
+#include "decrypted_kdm.h"
 #include "key.h"
-#include "types.h"
 #include "ref.h"
-#include <memory>
 #include <boost/function.hpp>
+#include <memory>
+
 
 namespace cxml {
        class Node;
 }
 
+
 namespace xmlpp {
        class Element;
 }
 
+
+struct dcp_add_kdm_test;
+
+
 namespace dcp {
 
+
 class DecryptedKDM;
 class ReelAsset;
 class ReelPictureAsset;
@@ -60,6 +74,7 @@ class ReelClosedCaptionAsset;
 class ReelAtmosAsset;
 class Content;
 
+
 /** @brief A reel within a DCP; the part which actually refers to picture, sound, subtitle, marker and Atmos data */
 class Reel : public Object
 {
@@ -80,7 +95,7 @@ public:
                , _atmos (atmos)
        {}
 
-       explicit Reel (std::shared_ptr<const cxml::Node>);
+       explicit Reel (std::shared_ptr<const cxml::Node>, dcp::Standard standard);
 
        std::shared_ptr<ReelPictureAsset> main_picture () const {
                return _main_picture;
@@ -114,21 +129,28 @@ public:
 
        xmlpp::Element* write_to_cpl (xmlpp::Element* node, Standard standard) const;
 
-       bool encrypted () const;
+       bool any_encrypted () const;
+       bool all_encrypted () const;
 
-       bool equals (std::shared_ptr<const Reel> other, EqualityOptions opt, NoteHandler notes) const;
+       bool equals(std::shared_ptr<const Reel> other, EqualityOptions const& opt, NoteHandler notes) const;
 
        void add (DecryptedKDM const &);
 
        void resolve_refs (std::vector<std::shared_ptr<Asset>>);
 
 private:
+       friend struct ::dcp_add_kdm_test;
+
+       void give_kdm_to_assets (dcp::DecryptedKDM const& kdm);
+
        std::shared_ptr<ReelPictureAsset> _main_picture;
        std::shared_ptr<ReelSoundAsset> _main_sound;
        std::shared_ptr<ReelSubtitleAsset> _main_subtitle;
        std::shared_ptr<ReelMarkersAsset> _main_markers;
        std::vector<std::shared_ptr<ReelClosedCaptionAsset>> _closed_captions;
        std::shared_ptr<ReelAtmosAsset> _atmos;
+
+       std::vector<dcp::DecryptedKDM> _kdms;
 };
 
 }