#include <dcp/exceptions.h>
#include <libxml++/libxml++.h>
#include <iterator>
+#include <iostream>
#include "i18n.h"
using boost::shared_ptr;
using boost::optional;
-int const DCPContentProperty::CAN_BE_PLAYED = 600;
+int const DCPContentProperty::CAN_BE_PLAYED = 600;
+int const DCPContentProperty::REFERENCE_VIDEO = 601;
+int const DCPContentProperty::REFERENCE_AUDIO = 602;
+int const DCPContentProperty::REFERENCE_SUBTITLE = 603;
DCPContent::DCPContent (shared_ptr<const Film> film, boost::filesystem::path p)
: Content (film)
, _has_subtitles (false)
, _encrypted (false)
, _kdm_valid (false)
+ , _reference_video (false)
+ , _reference_audio (false)
+ , _reference_subtitle (false)
{
read_directory (p);
}
_kdm = dcp::EncryptedKDM (node->string_child ("KDM"));
}
_kdm_valid = node->bool_child ("KDMValid");
+ _reference_video = node->optional_bool_child ("ReferenceVideo").get_value_or (false);
+ _reference_audio = node->optional_bool_child ("ReferenceAudio").get_value_or (false);
+ _reference_subtitle = node->optional_bool_child ("ReferenceSubtitle").get_value_or (false);
}
void
node->add_child("KDM")->add_child_text (_kdm->as_xml ());
}
node->add_child("KDMValid")->add_child_text (_kdm_valid ? "1" : "0");
+ node->add_child("ReferenceVideo")->add_child_text (_reference_video ? "1" : "0");
+ node->add_child("ReferenceAudio")->add_child_text (_reference_audio ? "1" : "0");
+ node->add_child("ReferenceSubtitle")->add_child_text (_reference_subtitle ? "1" : "0");
}
DCPTime
DCPContent::identifier () const
{
SafeStringStream s;
- s << VideoContent::identifier() << "_" << SubtitleContent::identifier ();
+ s << VideoContent::identifier() << "_" << SubtitleContent::identifier () << " "
+ << (_reference_video ? "1" : "0")
+ << (_reference_subtitle ? "1" : "0");
return s.str ();
}
/* Default to no colour conversion for DCPs */
unset_colour_conversion ();
}
+
+void
+DCPContent::set_reference_video (bool r)
+{
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+ _reference_video = r;
+ }
+
+ signal_changed (DCPContentProperty::REFERENCE_VIDEO);
+}
+
+void
+DCPContent::set_reference_audio (bool r)
+{
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+ _reference_audio = r;
+ }
+
+ signal_changed (DCPContentProperty::REFERENCE_AUDIO);
+}
+
+void
+DCPContent::set_reference_subtitle (bool r)
+{
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+ _reference_subtitle = r;
+ }
+
+ signal_changed (DCPContentProperty::REFERENCE_SUBTITLE);
+}