summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2017-01-05 16:39:52 +0000
committerCarl Hetherington <cth@carlh.net>2017-01-05 16:39:52 +0000
commit9173d049cc256efebb6a5bf07ee98e14dc24a350 (patch)
treee3ae8218ea6cf2dd275d510cad0a76637b19003c /src/lib
parentcafb88eff225fe37c5ae9e8cd594987edeba023b (diff)
Fix insensitive subtitle controls after adding a VF.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/dcp_content.cc10
-rw-r--r--src/lib/dcp_content.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/dcp_content.cc b/src/lib/dcp_content.cc
index 2eead3ee0..b5c1e647c 100644
--- a/src/lib/dcp_content.cc
+++ b/src/lib/dcp_content.cc
@@ -60,6 +60,7 @@ int const DCPContentProperty::REFERENCE_VIDEO = 602;
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)
@@ -143,6 +144,7 @@ DCPContent::examine (shared_ptr<Job> job)
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 ();
Content::examine (job);
@@ -163,12 +165,16 @@ DCPContent::examine (shared_ptr<Job> job)
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 ();
@@ -178,6 +184,10 @@ DCPContent::examine (shared_ptr<Job> job)
_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);
}
diff --git a/src/lib/dcp_content.h b/src/lib/dcp_content.h
index ae8efa65e..18d198fe8 100644
--- a/src/lib/dcp_content.h
+++ b/src/lib/dcp_content.h
@@ -38,6 +38,7 @@ public:
static int const REFERENCE_AUDIO;
static int const REFERENCE_SUBTITLE;
static int const NAME;
+ static int const HAS_SUBTITLES;
};
class ContentPart;