/*
- Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
-#include <list>
-#include <boost/shared_ptr.hpp>
+#ifndef LIBDCP_REEL_H
+#define LIBDCP_REEL_H
+
+#include "key.h"
#include "types.h"
+#include "ref.h"
+#include <libxml++/libxml++.h>
+#include <boost/shared_ptr.hpp>
+#include <boost/function.hpp>
+#include <list>
+
+namespace cxml {
+ class Node;
+}
-namespace libdcp {
+namespace dcp {
-class PictureAsset;
-class SoundAsset;
-class SubtitleAsset;
+class DecryptedKDM;
+class ReelAsset;
+class ReelPictureAsset;
+class ReelSoundAsset;
+class ReelSubtitleAsset;
+class Content;
-class Reel
+/** @brief A reel within a DCP; the part which actually refers to picture, sound and subtitle data */
+class Reel : public Object
{
public:
+ Reel () {}
+
Reel (
- boost::shared_ptr<const PictureAsset> picture,
- boost::shared_ptr<const SoundAsset> sound,
- boost::shared_ptr<const SubtitleAsset> subtitle
+ boost::shared_ptr<ReelPictureAsset> picture,
+ boost::shared_ptr<ReelSoundAsset> sound,
+ boost::shared_ptr<ReelSubtitleAsset> subtitle
)
: _main_picture (picture)
, _main_sound (sound)
, _main_subtitle (subtitle)
{}
+
+ Reel (boost::shared_ptr<const cxml::Node>);
- boost::shared_ptr<const PictureAsset> main_picture () const {
+ boost::shared_ptr<ReelPictureAsset> main_picture () const {
return _main_picture;
}
-
- boost::shared_ptr<const SoundAsset> main_sound () const {
+
+ boost::shared_ptr<ReelSoundAsset> main_sound () const {
return _main_sound;
}
- boost::shared_ptr<const SubtitleAsset> main_subtitle () const {
+ boost::shared_ptr<ReelSubtitleAsset> main_subtitle () const {
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 add (boost::shared_ptr<ReelAsset> asset);
+
+ void write_to_cpl (xmlpp::Element* node, Standard standard) const;
- std::list<std::string> equals (boost::shared_ptr<const Reel> other, EqualityOptions opt) const;
+ bool encrypted () const;
+
+ bool equals (boost::shared_ptr<const Reel> other, EqualityOptions opt, NoteHandler notes) const;
+
+ void add (DecryptedKDM const &);
+
+ void resolve_refs (std::list<boost::shared_ptr<Object> >);
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<ReelPictureAsset> _main_picture;
+ boost::shared_ptr<ReelSoundAsset> _main_sound;
+ boost::shared_ptr<ReelSubtitleAsset> _main_subtitle;
};
}
+
+#endif