diff options
| author | Carl Hetherington <cth@carlh.net> | 2017-01-05 16:39:52 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2017-01-05 16:39:52 +0000 |
| commit | 9173d049cc256efebb6a5bf07ee98e14dc24a350 (patch) | |
| tree | e3ae8218ea6cf2dd275d510cad0a76637b19003c | |
| parent | cafb88eff225fe37c5ae9e8cd594987edeba023b (diff) | |
Fix insensitive subtitle controls after adding a VF.
| -rw-r--r-- | src/lib/dcp_content.cc | 10 | ||||
| -rw-r--r-- | src/lib/dcp_content.h | 1 | ||||
| -rw-r--r-- | src/wx/subtitle_panel.cc | 2 |
3 files changed, 13 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; 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 @@ -225,6 +225,8 @@ SubtitlePanel::film_content_changed (int property) } setup_sensitivity (); + } else if (property == DCPContentProperty::HAS_SUBTITLES) { + setup_sensitivity (); } } |
