X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fsubtitle_appearance_dialog.cc;h=e21093798646641ab390ddfeb43130f744996b19;hb=28111007e2e6fd62f5810be780706ae1618bd33f;hp=339388be6e14e0eb25141f2efc8a49ea358599f3;hpb=4fb4b414b70cb38d405b6c3dd6c12b6a4d918d40;p=dcpomatic.git diff --git a/src/wx/subtitle_appearance_dialog.cc b/src/wx/subtitle_appearance_dialog.cc index 339388be6..e21093798 100644 --- a/src/wx/subtitle_appearance_dialog.cc +++ b/src/wx/subtitle_appearance_dialog.cc @@ -29,17 +29,24 @@ #include "lib/ffmpeg_content.h" #include "lib/examine_ffmpeg_subtitles_job.h" #include "lib/job_manager.h" +#include "lib/warnings.h" +DCPOMATIC_DISABLE_WARNINGS #include #include #include #include +DCPOMATIC_ENABLE_WARNINGS using std::map; using std::string; -using boost::shared_ptr; +using std::shared_ptr; using boost::bind; -using boost::dynamic_pointer_cast; +using std::dynamic_pointer_cast; using boost::optional; +using namespace dcpomatic; +#if BOOST_VERSION >= 106100 +using namespace boost::placeholders; +#endif int const SubtitleAppearanceDialog::NONE = 0; int const SubtitleAppearanceDialog::OUTLINE = 1; @@ -58,7 +65,7 @@ SubtitleAppearanceDialog::SubtitleAppearanceDialog (wxWindow* parent, shared_ptr /* XXX: assuming that all FFmpeg streams have bitmap subs */ if (_stream->colours().empty()) { _job_manager_connection = JobManager::instance()->ActiveJobsChanged.connect(boost::bind(&SubtitleAppearanceDialog::active_jobs_changed, this, _1)); - JobManager::instance()->add(shared_ptr(new ExamineFFmpegSubtitlesJob(film, ff))); + _job = JobManager::instance()->add(shared_ptr(new ExamineFFmpegSubtitlesJob(film, ff))); } } @@ -107,7 +114,10 @@ SubtitleAppearanceDialog::SubtitleAppearanceDialog (wxWindow* parent, shared_ptr t->SetLabelMarkup (_("New colour")); _colour_table->Add (t, 1, wxALIGN_CENTER); - add_colours (); + shared_ptr job = _job.lock (); + if (!job || job->finished()) { + add_colours (); + } _colours_panel->SetSizer (_colour_table); @@ -150,13 +160,13 @@ SubtitleAppearanceDialog::SubtitleAppearanceDialog (wxWindow* parent, shared_ptr _force_effect->SetValue (static_cast(effect)); if (effect) { switch (*effect) { - case dcp::NONE: + case dcp::Effect::NONE: _effect->SetSelection (NONE); break; - case dcp::BORDER: + case dcp::Effect::BORDER: _effect->SetSelection (OUTLINE); break; - case dcp::SHADOW: + case dcp::Effect::SHADOW: _effect->SetSelection (SHADOW); break; } @@ -235,13 +245,13 @@ SubtitleAppearanceDialog::apply () if (_force_effect->GetValue()) { switch (_effect->GetSelection()) { case NONE: - _caption->set_effect (dcp::NONE); + _caption->set_effect (dcp::Effect::NONE); break; case OUTLINE: - _caption->set_effect (dcp::BORDER); + _caption->set_effect (dcp::Effect::BORDER); break; case SHADOW: - _caption->set_effect (dcp::SHADOW); + _caption->set_effect (dcp::Effect::SHADOW); break; } } else {