int const DCPContentProperty::REFERENCE_AUDIO = 603;
int const DCPContentProperty::REFERENCE_SUBTITLE = 604;
int const DCPContentProperty::NAME = 605;
+int const DCPContentProperty::HAS_SUBTITLES = 606;
DCPContent::DCPContent (shared_ptr<const Film> film, boost::filesystem::path p)
: Content (film)
DCPContent::read_directory (boost::filesystem::path p)
{
for (boost::filesystem::directory_iterator i(p); i != boost::filesystem::directory_iterator(); ++i) {
- if (boost::filesystem::is_regular_file (i->path ())) {
- _paths.push_back (i->path ());
+ if (boost::filesystem::is_regular_file (i->path())) {
+ _paths.push_back (i->path());
} else if (boost::filesystem::is_directory (i->path ())) {
- read_directory (i->path ());
+ read_directory (i->path());
}
}
}
bool const needed_assets = needs_assets ();
bool const needed_kdm = needs_kdm ();
string const old_name = name ();
+ bool had_subtitles = static_cast<bool> (subtitle);
- job->set_progress_unknown ();
+ if (job) {
+ job->set_progress_unknown ();
+ }
Content::examine (job);
shared_ptr<DCPExaminer> examiner (new DCPExaminer (shared_from_this ()));
signal_changed (AudioContentProperty::STREAMS);
+ bool has_subtitles = false;
{
boost::mutex::scoped_lock lm (_mutex);
_name = examiner->name ();
if (examiner->has_subtitles ()) {
subtitle.reset (new SubtitleContent (this));
+ } else {
+ subtitle.reset ();
}
+ has_subtitles = static_cast<bool> (subtitle);
_encrypted = examiner->encrypted ();
_needs_assets = examiner->needs_assets ();
_kdm_valid = examiner->kdm_valid ();
_reel_lengths = examiner->reel_lengths ();
}
+ if (had_subtitles != has_subtitles) {
+ signal_changed (DCPContentProperty::HAS_SUBTITLES);
+ }
+
if (needed_assets != needs_assets ()) {
signal_changed (DCPContentProperty::NEEDS_ASSETS);
}
vector<boost::filesystem::path>
DCPContent::directories () const
{
- return dcp::DCP::directories_from_files (paths ());
+ return dcp::DCP::directories_from_files (paths());
}
void
{
shared_ptr<DCPDecoder> decoder;
try {
- decoder.reset (new DCPDecoder (shared_from_this(), film()->log()));
+ decoder.reset (new DCPDecoder (shared_from_this(), film()->log(), false));
} catch (dcp::DCPReadError) {
/* We couldn't read the DCP, so it's probably missing */
return false;
{
shared_ptr<DCPDecoder> decoder;
try {
- decoder.reset (new DCPDecoder (shared_from_this(), film()->log()));
+ decoder.reset (new DCPDecoder (shared_from_this(), film()->log(), false));
} catch (dcp::DCPReadError) {
/* We couldn't read the DCP, so it's probably missing */
return false;