*/
+/** @file src/asset.h
+ * @brief Parent class for assets of DCPs.
+ */
+
#ifndef LIBDCP_ASSET_H
#define LIBDCP_ASSET_H
#include <string>
#include <sigc++/sigc++.h>
+#include "types.h"
namespace ASDCP {
class WriterInfo;
namespace libdcp
{
-/** Parent class for assets (picture / sound collections) */
+/** @brief Parent class for assets of DCPs
+ *
+ * These are collections of pictures or sound.
+ */
class Asset
{
public:
- Asset (std::string, sigc::signal1<void, float>*, int, int);
+ /** Construct an Asset.
+ * @param directory Directory where MXF file is.
+ * @param mxf_name Name of MXF file.
+ * @param progress Signal to inform of progress.
+ * @param fps Frames per second.
+ * @param length Length in frames.
+ */
+ Asset (std::string directory, std::string mxf_path, sigc::signal1<void, float>* progress, int fps, int length);
+
+ /** Write details of the asset to a CPL stream.
+ * @param s Stream.
+ */
+ virtual void write_to_cpl (std::ostream& s) const = 0;
+
+ /** Write details of the asset to a PKL stream.
+ * @param s Stream.
+ */
+ void write_to_pkl (std::ostream& s) const;
- 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 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;
protected:
- void fill_writer_info (ASDCP::WriterInfo *) const;
+ friend class PictureAsset;
+ friend class SoundAsset;
+
+ /** Fill in a ADSCP::WriteInfo struct.
+ * @param w struct to fill in.
+ */
+ void fill_writer_info (ASDCP::WriterInfo* w) const;
+
+ boost::filesystem::path mxf_path () const;
+ std::string digest () const;
- /** Path to our MXF file */
- std::string _mxf_path;
+ /** Directory that our MXF file is in */
+ std::string _directory;
+ /** Name of our MXF file */
+ std::string _mxf_name;
/** Signal to emit to report progress */
sigc::signal1<void, float>* _progress;
/** Frames per second */
int _length;
/** Our UUID */
std::string _uuid;
+
+private:
/** Digest of our MXF */
- std::string _digest;
+ mutable std::string _digest;
};
}