From 9173d049cc256efebb6a5bf07ee98e14dc24a350 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 5 Jan 2017 16:39:52 +0000 Subject: [PATCH] Fix insensitive subtitle controls after adding a VF. --- src/lib/dcp_content.cc | 10 ++++++++++ src/lib/dcp_content.h | 1 + src/wx/subtitle_panel.cc | 2 ++ 3 files changed, 13 insertions(+) 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 film, boost::filesystem::path p) : Content (film) @@ -143,6 +144,7 @@ DCPContent::examine (shared_ptr job) bool const needed_assets = needs_assets (); bool const needed_kdm = needs_kdm (); string const old_name = name (); + bool had_subtitles = static_cast (subtitle); job->set_progress_unknown (); Content::examine (job); @@ -163,12 +165,16 @@ DCPContent::examine (shared_ptr 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 (subtitle); _encrypted = examiner->encrypted (); _needs_assets = examiner->needs_assets (); _kdm_valid = examiner->kdm_valid (); @@ -178,6 +184,10 @@ DCPContent::examine (shared_ptr 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; diff --git a/src/wx/subtitle_panel.cc b/src/wx/subtitle_panel.cc index 91e2847dd..810cdf488 100644 --- a/src/wx/subtitle_panel.cc +++ b/src/wx/subtitle_panel.cc @@ -224,6 +224,8 @@ SubtitlePanel::film_content_changed (int property) checked_set (_reference, false); } + setup_sensitivity (); + } else if (property == DCPContentProperty::HAS_SUBTITLES) { setup_sensitivity (); } } -- 2.30.2