Doc fixes.
[libdcp.git] / src / asset.cc
index d4214d5fca4729c624c9f52262dbebfa3a06a608..4a111a19d3fe20696469046ff013dc7531ddecf1 100644 (file)
 
 */
 
+/** @file  src/asset.cc
+ *  @brief Parent class for assets of DCPs.
+ */
+
+#include <iostream>
 #include <boost/filesystem.hpp>
 #include "AS_DCP.h"
 #include "KM_util.h"
@@ -28,16 +33,11 @@ using namespace std;
 using namespace boost;
 using namespace libdcp;
 
-/** Construct an Asset.
- *  @param p Pathname of MXF file.
- *  @param fps Frames per second.
- *  @param len Length in frames.
- */
-
-Asset::Asset (string p, int fps, int len)
-       : _mxf_path (p)
+Asset::Asset (string mxf_path, sigc::signal1<void, float>* progress, int fps, int length)
+       : _mxf_path (mxf_path)
+       , _progress (progress)
        , _fps (fps)
-       , _length (len)
+       , _length (length)
        , _uuid (make_uuid ())
 {
        
@@ -46,11 +46,13 @@ Asset::Asset (string p, int fps, int len)
 void
 Asset::write_to_pkl (ostream& s) const
 {
-       s << "      <Id>urn:uuid:" << _uuid << "</Id>\n"
+       s << "    <Asset>\n"
+         << "      <Id>urn:uuid:" << _uuid << "</Id>\n"
          << "      <AnnotationText>" << filesystem::path(_mxf_path).filename() << "</AnnotationText>\n"
          << "      <Hash>" << _digest << "</Hash>\n"
          << "      <Size>" << filesystem::file_size(_mxf_path) << "</Size>\n"
-         << "      <Type>application/mxf</Type>\n";
+         << "      <Type>application/mxf</Type>\n"
+         << "    </Asset>\n";
 }
 
 void
@@ -77,5 +79,7 @@ Asset::fill_writer_info (ASDCP::WriterInfo* writer_info) const
        writer_info->ProductName = Tags::instance()->product_name.c_str();
 
        writer_info->LabelSetType = ASDCP::LS_MXF_SMPTE;
-       Kumu::GenRandomUUID (writer_info->AssetUUID);
+       unsigned int c;
+       Kumu::hex2bin (_uuid.c_str(), writer_info->AssetUUID, Kumu::UUID_Length, &c);
+       assert (c == Kumu::UUID_Length);
 }