summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-07-17 17:47:28 +0100
committerCarl Hetherington <cth@carlh.net>2012-07-17 17:47:28 +0100
commitb6718fb437f242fd5127194d4c94e39d71c5e1ad (patch)
treee6c0fb61d5252bb72969cdeaa752875bb06e14e3 /src
parent1c22ef308a1d62b4c6935ede8233b1fea082b0ca (diff)
Some comments; fix up a UUID I think.
Diffstat (limited to 'src')
-rw-r--r--src/asset.cc11
-rw-r--r--src/asset.h9
-rw-r--r--src/dcp.cc21
-rw-r--r--src/dcp.h7
4 files changed, 46 insertions, 2 deletions
diff --git a/src/asset.cc b/src/asset.cc
index 4e3bb0e1..e2624712 100644
--- a/src/asset.cc
+++ b/src/asset.cc
@@ -44,6 +44,9 @@ Asset::Asset (string p, int fps, int len)
}
+/** Write details of the asset to a PKL stream.
+ * @param s Stream.
+ */
void
Asset::write_to_pkl (ostream& s) const
{
@@ -56,6 +59,9 @@ Asset::write_to_pkl (ostream& s) const
<< " </Asset>\n";
}
+/** Write details of the asset to a ASSETMAP stream.
+ * @param s Stream.
+ */
void
Asset::write_to_assetmap (ostream& s) const
{
@@ -72,6 +78,7 @@ Asset::write_to_assetmap (ostream& s) const
<< " </Asset>\n";
}
+/** Fill in a ADSCP::WriteInfo struct */
void
Asset::fill_writer_info (ASDCP::WriterInfo* writer_info) const
{
@@ -80,5 +87,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);
}
diff --git a/src/asset.h b/src/asset.h
index ce742d11..fb701570 100644
--- a/src/asset.h
+++ b/src/asset.h
@@ -30,6 +30,7 @@ namespace ASDCP {
namespace libdcp
{
+/** Parent class for assets (picture / sound collections) */
class Asset
{
public:
@@ -39,15 +40,23 @@ public:
void write_to_pkl (std::ostream &) const;
void write_to_assetmap (std::ostream &) const;
+ /** Emitted with a parameter between 0 and 1 to indicate progress in constructing
+ * this asset.
+ */
sigc::signal1<void, float> Progress;
protected:
void fill_writer_info (ASDCP::WriterInfo *) const;
+ /** Path to our MXF file */
std::string _mxf_path;
+ /** Frames per second */
int _fps;
+ /** Length in frames */
int _length;
+ /** Our UUID */
std::string _uuid;
+ /** Digest of our MXF */
std::string _digest;
};
diff --git a/src/dcp.cc b/src/dcp.cc
index 758e357b..b691d146 100644
--- a/src/dcp.cc
+++ b/src/dcp.cc
@@ -35,6 +35,10 @@ using namespace libdcp;
/** Construct a DCP.
* @param d Directory to write files to.
+ * @param n Name.
+ * @param c Content type.
+ * @param fps Frames per second.
+ * @param length Length in frames.
*/
DCP::DCP (string d, string n, ContentType c, int fps, int length)
: _directory (d)
@@ -45,6 +49,9 @@ DCP::DCP (string d, string n, ContentType c, int fps, int length)
{
}
+/** Add a sound asset.
+ * @param files Pathnames of WAV files to use in the order Left, Right, Centre, Lfe (sub), Left surround, Right surround.
+ */
void
DCP::add_sound_asset (list<string> const & files)
{
@@ -54,6 +61,9 @@ DCP::add_sound_asset (list<string> const & files)
_assets.push_back (shared_ptr<SoundAsset> (new SoundAsset (files, p.string(), _fps, _length)));
}
+/** Add a picture asset.
+ * @param files Pathnames of JPEG2000 files, in frame order.
+ */
void
DCP::add_picture_asset (list<string> const & files, int w, int h)
{
@@ -168,6 +178,7 @@ DCP::write_pkl (string pkl_uuid, string cpl_uuid, string cpl_digest, int cpl_len
return p.string ();
}
+/** Write the VOLINDEX file */
void
DCP::write_volindex () const
{
@@ -182,6 +193,12 @@ DCP::write_volindex () const
<< "</VolumeIndex>\n";
}
+/** Write the ASSETMAP file.
+ * @param cpl_uuid UUID of our CPL.
+ * @param cpl_length Length of our CPL in bytes.
+ * @param pkl_uuid UUID of our PKL.
+ * @param pkl_length Length of our PKL in bytes.
+ */
void
DCP::write_assetmap (string cpl_uuid, int cpl_length, string pkl_uuid, int pkl_length) const
{
@@ -232,7 +249,9 @@ DCP::write_assetmap (string cpl_uuid, int cpl_length, string pkl_uuid, int pkl_l
<< "</AssetMap>\n";
}
-
+/** @param t A content type.
+ * @return A string representation suitable for use in a CPL.
+ */
string
DCP::content_type_string (ContentType t)
{
diff --git a/src/dcp.h b/src/dcp.h
index 2c320451..6896267c 100644
--- a/src/dcp.h
+++ b/src/dcp.h
@@ -26,6 +26,7 @@ namespace libdcp
class Asset;
+/** A class to create a DCP */
class DCP
{
public:
@@ -59,11 +60,17 @@ private:
static std::string content_type_string (ContentType);
+ /** the directory that we are writing to */
std::string _directory;
+ /** the name of the DCP */
std::string _name;
+ /** the content type of the DCP */
ContentType _content_type;
+ /** frames per second */
int _fps;
+ /** length in frames */
int _length;
+ /** assets */
std::list<boost::shared_ptr<Asset> > _assets;
};