It builds again.
[libdcp.git] / src / asset.h
index f3546cd86318cb6bf88ab172ed1b10a1cc4f6248..e8867ae551f7aa65363b3e53a87b47c79a5792cc 100644 (file)
 
 */
 
+/** @file  src/asset.h
+ *  @brief Asset class.
+ */ 
+
 #ifndef LIBDCP_ASSET_H
 #define LIBDCP_ASSET_H
 
 #include "object.h"
+#include "types.h"
+#include <boost/filesystem.hpp>
+#include <boost/function.hpp>
+
+namespace xmlpp {
+       class Node;
+}
 
 namespace dcp {
 
 /** @class Asset
- *  @brief Parent class for DCP assets, i.e. picture/sound/subtitles, CPLs and PKLs.
+ *  @brief Parent class for DCP assets, i.e. picture/sound/subtitles and CPLs.
+ *
+ *  Note that this class is not used for ReelAssets; they are just for the metadata
+ *  that gets put into <Reel>s.
  */
-       
 class Asset : public Object
 {
 public:
        Asset ();
+       Asset (boost::filesystem::path file);
        Asset (std::string id);
 
+       virtual std::string pkl_type () const = 0;
+       virtual bool equals (boost::shared_ptr<const Asset> other, EqualityOptions opt, boost::function<void (NoteType, std::string)> note) const;
+       
+       /** Write details of the asset to a PKL AssetList node.
+        *  @param node Parent node.
+        */
+       void write_to_pkl (xmlpp::Node* node) const;
+       void write_to_assetmap (xmlpp::Node* node) const;
+
+       boost::filesystem::path file () const {
+               return _file;
+       }
+
+       void set_file (boost::filesystem::path file) {
+               _file = file;
+       }
+
+       std::string hash () const;
+
+protected:
+       friend class MXFWriter;
+       
+       boost::filesystem::path _file;
+       mutable std::string _hash;
 };
 
 }