diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-05-26 16:38:06 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-05-26 16:38:06 +0100 |
| commit | 56287eb5f3c7fe1ddaf69bdf7b941648b132096f (patch) | |
| tree | 9cf7e5c529ec1ba1f1603578faa96a60dd65f375 /src/wx/subtitle_panel.cc | |
| parent | cd30cdbaf4188425ab0610b088dba81496144ccd (diff) | |
Fix subtitle appearance configuration with FFmpeg-text subs.
Diffstat (limited to 'src/wx/subtitle_panel.cc')
| -rw-r--r-- | src/wx/subtitle_panel.cc | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/src/wx/subtitle_panel.cc b/src/wx/subtitle_panel.cc index 31ee2c477..852d754d5 100644 --- a/src/wx/subtitle_panel.cc +++ b/src/wx/subtitle_panel.cc @@ -431,15 +431,33 @@ SubtitlePanel::appearance_dialog_clicked () ContentList c = _parent->selected_subtitle (); DCPOMATIC_ASSERT (c.size() == 1); - shared_ptr<TextSubtitleContent> sr = dynamic_pointer_cast<TextSubtitleContent> (c.front ()); - if (sr) { - TextSubtitleAppearanceDialog* d = new TextSubtitleAppearanceDialog (this, sr); + bool text = false; + bool image = false; + + if ( + dynamic_pointer_cast<TextSubtitleContent> (c.front()) || + dynamic_pointer_cast<DCPContent> (c.front()) || + dynamic_pointer_cast<DCPSubtitleContent> (c.front())) { + + text = true; + } + + shared_ptr<FFmpegContent> fc = dynamic_pointer_cast<FFmpegContent> (c.front()); + if (fc) { + if (fc->subtitle_stream()->has_text()) { + text = true; + } else if (fc->subtitle_stream()->has_image()) { + image = true; + } + } + + if (text) { + TextSubtitleAppearanceDialog* d = new TextSubtitleAppearanceDialog (this, c.front()->subtitle); if (d->ShowModal () == wxID_OK) { d->apply (); } d->Destroy (); - } else { - shared_ptr<FFmpegContent> fc = dynamic_pointer_cast<FFmpegContent> (c.front ()); + } else if (image) { DCPOMATIC_ASSERT (fc); ImageSubtitleColourDialog* d = new ImageSubtitleColourDialog (this, fc, fc->subtitle_stream ()); if (d->ShowModal() == wxID_OK) { |
