Working decryption via KDM.
[libdcp.git] / src / reel.h
index 28d827f8c3fbedbd195f9bc8957b49c3b7d607fd..cc356b696cc04c0c6e180b5bdeca3697c8e9852b 100644 (file)
 
 #include <list>
 #include <boost/shared_ptr.hpp>
+#include <boost/function.hpp>
+#include <libxml++/libxml++.h>
 #include "types.h"
 
+namespace xmlpp {
+       class Node;
+}
+
 namespace libdcp {
 
-class PictureAsset;    
-class SoundAsset;      
-class SubtitleAsset;   
+class PictureAsset;
+class SoundAsset;
+class SubtitleAsset;
+class KDM;     
 
+/** @brief A reel within a DCP; the part which actually contains picture, sound and subtitle data */   
 class Reel
 {
 public:
        Reel (
-               boost::shared_ptr<const PictureAsset> picture,
-               boost::shared_ptr<const SoundAsset> sound,
-               boost::shared_ptr<const SubtitleAsset> subtitle
+               boost::shared_ptr<PictureAsset> picture,
+               boost::shared_ptr<SoundAsset> sound,
+               boost::shared_ptr<SubtitleAsset> subtitle
                )
                : _main_picture (picture)
                , _main_sound (sound)
@@ -43,7 +51,7 @@ public:
        boost::shared_ptr<const PictureAsset> main_picture () const {
                return _main_picture;
        }
-       
+
        boost::shared_ptr<const SoundAsset> main_sound () const {
                return _main_sound;
        }
@@ -52,16 +60,18 @@ public:
                return _main_subtitle;
        }
 
-       void write_to_cpl (std::ostream & s) const;
-       void write_to_pkl (std::ostream & s) const;
-       void write_to_assetmap (std::ostream & s) const;
+       void write_to_cpl (xmlpp::Node *) const;
+
+       bool encrypted () const;
+       
+       bool equals (boost::shared_ptr<const Reel> other, EqualityOptions opt, boost::function<void (NoteType, std::string)> notes) const;
 
-       std::list<std::string> equals (boost::shared_ptr<const Reel> other, EqualityOptions opt) const;
+       void add_kdm (KDM const &);
 
 private:
-       boost::shared_ptr<const PictureAsset> _main_picture;
-       boost::shared_ptr<const SoundAsset> _main_sound;
-       boost::shared_ptr<const SubtitleAsset> _main_subtitle;
+       boost::shared_ptr<PictureAsset> _main_picture;
+       boost::shared_ptr<SoundAsset> _main_sound;
+       boost::shared_ptr<SubtitleAsset> _main_subtitle;
 };
 
 }