summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-08-30 16:33:18 +0100
committerCarl Hetherington <cth@carlh.net>2013-08-30 16:33:18 +0100
commitd0e025d26cab0eecfea1528343638dac69f363cd (patch)
tree883ea9ba28850cd4cc32a9a62da5537163ecf578 /src
parente97ac27b357a05072326a42bdb9fc1b8df04810a (diff)
Remove generic name from CPL.
Diffstat (limited to 'src')
-rw-r--r--src/cpl.cc35
-rw-r--r--src/cpl.h27
-rw-r--r--src/dcp.cc2
3 files changed, 31 insertions, 33 deletions
diff --git a/src/cpl.cc b/src/cpl.cc
index d3ae3e8c..f1c224b3 100644
--- a/src/cpl.cc
+++ b/src/cpl.cc
@@ -44,9 +44,10 @@ using boost::lexical_cast;
using boost::optional;
using namespace libdcp;
-CPL::CPL (string name, ContentKind content_kind)
- : _name (name)
- , _content_kind (content_kind)
+CPL::CPL (string annotation_text_, string content_title_text_, ContentKind content_kind_)
+ : annotation_text (annotation_text_)
+ , content_title_text (content_title_text_)
+ , content_kind (content_kind_)
{
_id = make_uuid ();
}
@@ -57,7 +58,7 @@ CPL::CPL (string name, ContentKind content_kind)
* @param require_mxfs true to throw an exception if a required MXF file does not exist.
*/
CPL::CPL (boost::filesystem::path file, list<PathAssetMap> asset_maps, bool require_mxfs)
- : _content_kind (FEATURE)
+ : content_kind (FEATURE)
{
/* Read the XML */
shared_ptr<parse::CPL> cpl;
@@ -69,8 +70,9 @@ CPL::CPL (boost::filesystem::path file, list<PathAssetMap> asset_maps, bool requ
/* Now cherry-pick the required bits into our own data structure */
- _name = cpl->annotation_text;
- _content_kind = cpl->content_kind;
+ annotation_text = cpl->annotation_text;
+ content_title_text = cpl->content_title_text;
+ content_kind = cpl->content_kind;
/* Trim urn:uuid: off the front */
_id = cpl->id.substr (9);
@@ -217,12 +219,12 @@ CPL::write_xml (boost::filesystem::path directory, bool interop, XMLMetadata con
}
root->add_child("Id")->add_child_text ("urn:uuid:" + _id);
- root->add_child("AnnotationText")->add_child_text (_name);
+ root->add_child("AnnotationText")->add_child_text (annotation_text);
root->add_child("IssueDate")->add_child_text (metadata.issue_date);
root->add_child("Issuer")->add_child_text (metadata.issuer);
root->add_child("Creator")->add_child_text (metadata.creator);
- root->add_child("ContentTitleText")->add_child_text (_name);
- root->add_child("ContentKind")->add_child_text (content_kind_to_string (_content_kind));
+ root->add_child("ContentTitleText")->add_child_text (content_title_text);
+ root->add_child("ContentKind")->add_child_text (content_kind_to_string (content_kind));
{
xmlpp::Node* cv = root->add_child ("ContentVersion");
cv->add_child ("Id")->add_child_text ("urn:uri:" + _id + "_" + metadata.issue_date);
@@ -293,14 +295,21 @@ CPL::write_to_assetmap (xmlpp::Node* node) const
bool
CPL::equals (CPL const & other, EqualityOptions opt, boost::function<void (NoteType, string)> note) const
{
- if (_name != other._name && !opt.cpl_names_can_differ) {
+ if (annotation_text != other.annotation_text && !opt.cpl_names_can_differ) {
stringstream s;
- s << "names differ: " << _name << " vs " << other._name << "\n";
+ s << "annotation texts differ: " << annotation_text << " vs " << other.annotation_text << "\n";
note (ERROR, s.str ());
return false;
}
- if (_content_kind != other._content_kind) {
+ if (content_title_text != other.content_title_text && !opt.cpl_names_can_differ) {
+ stringstream s;
+ s << "content title texts differ: " << content_title_text << " vs " << other.content_title_text << "\n";
+ note (ERROR, s.str ());
+ return false;
+ }
+
+ if (content_kind != other.content_kind) {
note (ERROR, "content kinds differ");
return false;
}
@@ -378,7 +387,7 @@ CPL::make_kdm (
}
kdm_required_extensions->add_child("CompositionPlaylistId")->add_child_text("urn:uuid:" + _id);
- kdm_required_extensions->add_child("ContentTitleText")->add_child_text(_name);
+ kdm_required_extensions->add_child("ContentTitleText")->add_child_text(content_title_text);
kdm_required_extensions->add_child("ContentAuthenticator")->add_child_text(certificates.leaf()->thumbprint());
kdm_required_extensions->add_child("ContentKeysNotValidBefore")->add_child_text("XXX");
kdm_required_extensions->add_child("ContentKeysNotValidAfter")->add_child_text("XXX");
diff --git a/src/cpl.h b/src/cpl.h
index 8605a9bd..dfc05c8e 100644
--- a/src/cpl.h
+++ b/src/cpl.h
@@ -48,29 +48,15 @@ class KDM;
class CPL
{
public:
- CPL (std::string name, ContentKind content_kind);
+ CPL (std::string annotation_text, std::string content_title_text, ContentKind content_kind);
CPL (boost::filesystem::path file, std::list<PathAssetMap> asset_maps, bool require_mxfs = true);
void add_reel (boost::shared_ptr<Reel> reel);
- /** @return the type of the content, used by media servers
- * to categorise things (e.g. feature, trailer, etc.)
- */
- ContentKind content_kind () const {
- return _content_kind;
- }
-
std::list<boost::shared_ptr<Reel> > reels () const {
return _reels;
}
- /** @return the CPL's name, as will be presented on projector
- * media servers and theatre management systems.
- */
- std::string name () const {
- return _name;
- }
-
std::list<boost::shared_ptr<const Asset> > assets () const;
bool encrypted () const;
@@ -97,14 +83,17 @@ public:
) const;
void add_kdm (KDM const &);
+
+ /* Properties */
+
+ std::string annotation_text;
+ std::string content_title_text;
+ /** The type of the content, used by media servers to categorise things (e.g. feature, trailer, etc.) */
+ ContentKind content_kind;
private:
std::pair<std::string, boost::shared_ptr<const parse::AssetMapAsset> > asset_from_id (std::list<PathAssetMap>, std::string id) const;
- /** the name of the DCP */
- std::string _name;
- /** the content kind of the CPL */
- ContentKind _content_kind;
/** reels */
std::list<boost::shared_ptr<Reel> > _reels;
diff --git a/src/dcp.cc b/src/dcp.cc
index 60035cc5..c16c1333 100644
--- a/src/dcp.cc
+++ b/src/dcp.cc
@@ -105,7 +105,7 @@ DCP::write_pkl (string pkl_uuid, bool interop, XMLMetadata const & metadata, sha
pkl->add_child("Id")->add_child_text ("urn:uuid:" + pkl_uuid);
/* XXX: this is a bit of a hack */
- pkl->add_child("AnnotationText")->add_child_text(_cpls.front()->name());
+ pkl->add_child("AnnotationText")->add_child_text(_cpls.front()->annotation_text);
pkl->add_child("IssueDate")->add_child_text (metadata.issue_date);
pkl->add_child("Issuer")->add_child_text (metadata.issuer);
pkl->add_child("Creator")->add_child_text (metadata.creator);