4th parameter of time is ticks (1 tick = 4ms) not milliseconds
[libdcp.git] / src / asset.h
index ce742d11e0ce0c3ea1bab033c7e220a45f5a24d7..0c8df0c85b6621022b627394e3678125639fd69d 100644 (file)
 
 */
 
+/** @file  src/asset.h
+ *  @brief Parent class for assets of DCPs.
+ */
+
 #ifndef LIBDCP_ASSET_H
 #define LIBDCP_ASSET_H
 
 #include <string>
+#include <boost/filesystem.hpp>
 #include <sigc++/sigc++.h>
+#include "types.h"
 
 namespace ASDCP {
        class WriterInfo;
@@ -30,25 +36,53 @@ namespace ASDCP {
 namespace libdcp
 {
 
+/** @brief Parent class for assets of DCPs
+ *
+ *  These are collections of pictures or sound.
+ */
 class Asset
 {
 public:
-       Asset (std::string, int, int);
+       /** Construct an Asset.
+        *  @param directory Directory where our XML or MXF file is.
+        *  @param file_name Name of our file within directory.
+        */
+       Asset (std::string directory, std::string file_name);
+
+       /** Write details of the asset to a CPL stream.
+        *  @param s Stream.
+        */
+       virtual void write_to_cpl (std::ostream& s) const = 0;
 
-       virtual void write_to_cpl (std::ostream &) const = 0;
-       void write_to_pkl (std::ostream &) const;
-       void write_to_assetmap (std::ostream &) const;
+       /** Write details of the asset to a PKL stream.
+        *  @param s Stream.
+        */
+       void write_to_pkl (std::ostream& s) const;
 
-       sigc::signal1<void, float> Progress;
+       /** Write details of the asset to a ASSETMAP stream.
+        *  @param s Stream.
+        */
+       void write_to_assetmap (std::ostream& s) const;
+
+       virtual std::list<std::string> equals (boost::shared_ptr<const Asset> other, EqualityOptions opt) const = 0;
 
 protected:
-       void fill_writer_info (ASDCP::WriterInfo *) const;
+       friend class PictureAsset;
+       friend class SoundAsset;
+       
+       std::string digest () const;
+       boost::filesystem::path path () const;
 
-       std::string _mxf_path;
-       int _fps;
-       int _length;
+       /** Directory that our MXF or XML file is in */
+       std::string _directory;
+       /** Name of our MXF or XML file */
+       std::string _file_name;
+       /** Our UUID */
        std::string _uuid;
-       std::string _digest;
+
+private:       
+       /** Digest of our MXF or XML file */
+       mutable std::string _digest;
 };
 
 }