2 Copyright (C) 2012-2019 Carl Hetherington <cth@carlh.net>
4 This file is part of DCP-o-matic.
6 DCP-o-matic is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 DCP-o-matic is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
21 #include "text_panel.h"
22 #include "film_editor.h"
24 #include "text_view.h"
25 #include "content_panel.h"
26 #include "fonts_dialog.h"
27 #include "dcp_text_track_dialog.h"
28 #include "subtitle_appearance_dialog.h"
29 #include "static_text.h"
30 #include "check_box.h"
31 #include "dcpomatic_button.h"
32 #include "lib/ffmpeg_content.h"
33 #include "lib/string_text_file_content.h"
34 #include "lib/ffmpeg_subtitle_stream.h"
35 #include "lib/dcp_subtitle_content.h"
36 #include "lib/string_text_file_decoder.h"
37 #include "lib/dcp_subtitle_decoder.h"
38 #include "lib/dcp_content.h"
39 #include "lib/text_content.h"
40 #include "lib/decoder_factory.h"
41 #include <wx/spinctrl.h>
42 #include <boost/foreach.hpp>
48 using boost::shared_ptr;
49 using boost::optional;
50 using boost::dynamic_pointer_cast;
52 /** @param t Original text type of the content, if known */
53 TextPanel::TextPanel (ContentPanel* p, TextType t)
54 : ContentSubPanel (p, std_to_wx(text_type_to_name(t)))
55 , _dcp_track_label (0)
63 wxString refer = _("Use this DCP's subtitle as OV and make VF");
64 if (t == TEXT_CLOSED_CAPTION) {
65 refer = _("Use this DCP's closed caption as OV and make VF");
68 _reference = new CheckBox (this, refer);
69 _reference_note = new StaticText (this, wxT(""));
70 _reference_note->Wrap (200);
71 wxFont font = _reference_note->GetFont();
72 font.SetStyle(wxFONTSTYLE_ITALIC);
73 font.SetPointSize(font.GetPointSize() - 1);
74 _reference_note->SetFont(font);
76 _use = new CheckBox (this, _("Use as"));
77 _type = new wxChoice (this, wxID_ANY);
78 _type->Append (_("open subtitles"));
79 _type->Append (_("closed captions"));
81 _burn = new CheckBox (this, _("Burn subtitles into image"));
83 _offset_label = create_label (this, _("Offset"), true);
84 _x_offset_label = create_label (this, _("X"), true);
85 _x_offset = new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(64, -1));
86 _x_offset_pc_label = new StaticText (this, _("%"));
87 _y_offset_label = create_label (this, _("Y"), true);
88 _y_offset = new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(64, -1));
89 _y_offset_pc_label = new StaticText (this, _("%"));
91 _scale_label = create_label (this, _("Scale"), true);
92 _x_scale_label = create_label (this, _("X"), true);
93 _x_scale = new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(64, -1));
94 _x_scale_pc_label = new StaticText (this, _("%"));
95 _y_scale_label = create_label (this, S_("Coord|Y"), true);
96 _y_scale = new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(64, -1));
97 _y_scale_pc_label = new StaticText (this, _("%"));
99 _line_spacing_label = create_label (this, _("Line spacing"), true);
100 _line_spacing = new wxSpinCtrl (this);
101 _line_spacing_pc_label = new StaticText (this, _("%"));
103 _stream_label = create_label (this, _("Stream"), true);
104 _stream = new wxChoice (this, wxID_ANY);
106 _text_view_button = new Button (this, _("View..."));
107 _fonts_dialog_button = new Button (this, _("Fonts..."));
108 _appearance_dialog_button = new Button (this, _("Appearance..."));
110 _x_offset->SetRange (-100, 100);
111 _y_offset->SetRange (-100, 100);
112 _x_scale->SetRange (10, 1000);
113 _y_scale->SetRange (10, 1000);
114 _line_spacing->SetRange (10, 1000);
116 _reference->Bind (wxEVT_CHECKBOX, boost::bind (&TextPanel::reference_clicked, this));
117 _use->Bind (wxEVT_CHECKBOX, boost::bind (&TextPanel::use_toggled, this));
118 _type->Bind (wxEVT_CHOICE, boost::bind (&TextPanel::type_changed, this));
119 _burn->Bind (wxEVT_CHECKBOX, boost::bind (&TextPanel::burn_toggled, this));
120 _x_offset->Bind (wxEVT_SPINCTRL, boost::bind (&TextPanel::x_offset_changed, this));
121 _y_offset->Bind (wxEVT_SPINCTRL, boost::bind (&TextPanel::y_offset_changed, this));
122 _x_scale->Bind (wxEVT_SPINCTRL, boost::bind (&TextPanel::x_scale_changed, this));
123 _y_scale->Bind (wxEVT_SPINCTRL, boost::bind (&TextPanel::y_scale_changed, this));
124 _line_spacing->Bind (wxEVT_SPINCTRL, boost::bind (&TextPanel::line_spacing_changed, this));
125 _stream->Bind (wxEVT_CHOICE, boost::bind (&TextPanel::stream_changed, this));
126 _text_view_button->Bind (wxEVT_BUTTON, boost::bind (&TextPanel::text_view_clicked, this));
127 _fonts_dialog_button->Bind (wxEVT_BUTTON, boost::bind (&TextPanel::fonts_dialog_clicked, this));
128 _appearance_dialog_button->Bind (wxEVT_BUTTON, boost::bind (&TextPanel::appearance_dialog_clicked, this));
131 content_selection_changed ();
135 TextPanel::setup_visibility ()
137 switch (current_type()) {
138 case TEXT_OPEN_SUBTITLE:
139 if (_dcp_track_label) {
140 _dcp_track_label->Destroy ();
141 _dcp_track_label = 0;
144 _dcp_track->Destroy ();
147 if (!_language_label) {
148 _language_label = create_label (this, _("Language"), true);
149 add_label_to_sizer (_grid, _language_label, true, wxGBPosition(_language_row, 0));
152 _language = new wxTextCtrl (this, wxID_ANY);
153 _language->Bind (wxEVT_TEXT, boost::bind(&TextPanel::language_changed, this));
154 _grid->Add (_language, wxGBPosition(_language_row, 1), wxDefaultSpan, wxEXPAND);
155 film_content_changed (TextContentProperty::LANGUAGE);
158 case TEXT_CLOSED_CAPTION:
159 if (_language_label) {
160 _language_label->Destroy ();
164 _language->Destroy ();
167 if (!_dcp_track_label) {
168 _dcp_track_label = create_label (this, _("CCAP track"), true);
169 add_label_to_sizer (_grid, _dcp_track_label, true, wxGBPosition(_language_row, 0));
172 _dcp_track = new wxChoice (this, wxID_ANY);
173 _dcp_track->Bind (wxEVT_CHOICE, boost::bind(&TextPanel::dcp_track_changed, this));
174 _grid->Add (_dcp_track, wxGBPosition(_language_row, 1), wxDefaultSpan, wxEXPAND);
175 update_dcp_tracks ();
176 film_content_changed (TextContentProperty::DCP_TRACK);
187 TextPanel::add_to_grid ()
189 Config::Interface const interface = Config::instance()->interface_complexity();
193 _reference->Show (interface == Config::INTERFACE_FULL);
194 _reference_note->Show (interface == Config::INTERFACE_FULL);
196 if (interface == Config::INTERFACE_FULL) {
197 wxBoxSizer* reference_sizer = new wxBoxSizer (wxVERTICAL);
198 reference_sizer->Add (_reference, 0);
199 reference_sizer->Add (_reference_note, 0);
200 _grid->Add (reference_sizer, wxGBPosition(r, 0), wxGBSpan(1, 4));
204 wxBoxSizer* use = new wxBoxSizer (wxHORIZONTAL);
205 use->Add (_use, 0, wxEXPAND | wxRIGHT, DCPOMATIC_SIZER_GAP);
206 use->Add (_type, 1, wxEXPAND, 0);
207 _grid->Add (use, wxGBPosition (r, 0), wxGBSpan (1, 2));
210 _grid->Add (_burn, wxGBPosition (r, 0), wxGBSpan (1, 2));
213 add_label_to_sizer (_grid, _offset_label, true, wxGBPosition (r, 0));
214 wxBoxSizer* offset = new wxBoxSizer (wxHORIZONTAL);
215 add_label_to_sizer (offset, _x_offset_label, true);
216 offset->Add (_x_offset, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, DCPOMATIC_SIZER_X_GAP);
217 offset->Add (_x_offset_pc_label, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, DCPOMATIC_SIZER_X_GAP * 2);
218 add_label_to_sizer (offset, _y_offset_label, true);
219 offset->Add (_y_offset, 0);
220 add_label_to_sizer (offset, _y_offset_pc_label, false);
221 _grid->Add (offset, wxGBPosition (r, 1));
224 add_label_to_sizer (_grid, _scale_label, true, wxGBPosition (r, 0));
225 wxBoxSizer* scale = new wxBoxSizer (wxHORIZONTAL);
226 add_label_to_sizer (scale, _x_scale_label, true);
227 scale->Add (_x_scale, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, DCPOMATIC_SIZER_X_GAP);
228 scale->Add (_x_scale_pc_label, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, DCPOMATIC_SIZER_X_GAP * 2);
229 add_label_to_sizer (scale, _y_scale_label, true);
230 scale->Add (_y_scale, 0);
231 add_label_to_sizer (scale, _y_scale_pc_label, false);
232 _grid->Add (scale, wxGBPosition (r, 1));
236 add_label_to_sizer (_grid, _line_spacing_label, true, wxGBPosition (r, 0));
237 wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
238 s->Add (_line_spacing);
239 add_label_to_sizer (s, _line_spacing_pc_label, false);
240 _grid->Add (s, wxGBPosition (r, 1));
248 add_label_to_sizer (_grid, _stream_label, true, wxGBPosition (r, 0));
249 _grid->Add (_stream, wxGBPosition (r, 1));
253 wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
255 s->Add (_text_view_button, 1, wxALL, DCPOMATIC_SIZER_GAP);
256 s->Add (_fonts_dialog_button, 1, wxALL, DCPOMATIC_SIZER_GAP);
257 s->Add (_appearance_dialog_button, 1, wxALL, DCPOMATIC_SIZER_GAP);
259 _grid->Add (s, wxGBPosition (r, 0), wxGBSpan (1, 2));
265 TextPanel::update_dcp_track_selection ()
267 DCPOMATIC_ASSERT (_dcp_track);
269 optional<DCPTextTrack> selected;
271 BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_text()) {
272 shared_ptr<TextContent> t = i->text_of_original_type(_original_type);
274 optional<DCPTextTrack> dt = t->dcp_track();
275 if (dt && selected && *dt != *selected) {
277 } else if (!selected) {
284 BOOST_FOREACH (DCPTextTrack i, _parent->film()->closed_caption_tracks()) {
285 if (!many && selected && *selected == i) {
286 _dcp_track->SetSelection (n);
291 if (!selected || many) {
292 _dcp_track->SetSelection (wxNOT_FOUND);
297 TextPanel::update_dcp_tracks ()
299 DCPOMATIC_ASSERT (_dcp_track);
301 _dcp_track->Clear ();
302 BOOST_FOREACH (DCPTextTrack i, _parent->film()->closed_caption_tracks()) {
303 /* XXX: don't display the "magic" track which has empty name and language;
304 this is a nasty hack (see also Film::closed_caption_tracks)
306 if (!i.name.empty() || !i.language.empty()) {
307 _dcp_track->Append (std_to_wx(i.summary()));
311 if (_parent->film()->closed_caption_tracks().size() < 6) {
312 _dcp_track->Append (_("Add new..."));
315 update_dcp_track_selection ();
319 TextPanel::dcp_track_changed ()
321 optional<DCPTextTrack> track;
323 if (_dcp_track->GetSelection() == int(_dcp_track->GetCount()) - 1) {
324 DCPTextTrackDialog* d = new DCPTextTrackDialog (this);
325 if (d->ShowModal() == wxID_OK) {
330 /* Find the DCPTextTrack that was selected */
331 BOOST_FOREACH (DCPTextTrack i, _parent->film()->closed_caption_tracks()) {
332 if (i.summary() == wx_to_std(_dcp_track->GetStringSelection())) {
339 BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_text()) {
340 shared_ptr<TextContent> t = i->text_of_original_type(_original_type);
341 if (t && t->type() == TEXT_CLOSED_CAPTION) {
342 t->set_dcp_track(*track);
347 update_dcp_tracks ();
351 TextPanel::film_changed (Film::Property property)
353 if (property == Film::CONTENT || property == Film::REEL_TYPE) {
354 setup_sensitivity ();
359 TextPanel::film_content_changed (int property)
361 FFmpegContentList fc = _parent->selected_ffmpeg ();
362 ContentList sc = _parent->selected_text ();
364 shared_ptr<FFmpegContent> fcs;
365 if (fc.size() == 1) {
369 shared_ptr<Content> scs;
370 if (sc.size() == 1) {
374 shared_ptr<TextContent> text;
376 text = scs->text_of_original_type(_original_type);
379 if (property == FFmpegContentProperty::SUBTITLE_STREAMS) {
382 vector<shared_ptr<FFmpegSubtitleStream> > s = fcs->subtitle_streams ();
383 for (vector<shared_ptr<FFmpegSubtitleStream> >::iterator i = s.begin(); i != s.end(); ++i) {
384 _stream->Append (std_to_wx ((*i)->name), new wxStringClientData (std_to_wx ((*i)->identifier ())));
387 if (fcs->subtitle_stream()) {
388 checked_set (_stream, fcs->subtitle_stream()->identifier ());
390 _stream->SetSelection (wxNOT_FOUND);
393 setup_sensitivity ();
394 } else if (property == TextContentProperty::USE) {
395 checked_set (_use, text ? text->use() : false);
396 setup_sensitivity ();
397 } else if (property == TextContentProperty::TYPE) {
399 switch (text->type()) {
400 case TEXT_OPEN_SUBTITLE:
401 _type->SetSelection (0);
403 case TEXT_CLOSED_CAPTION:
404 _type->SetSelection (1);
407 DCPOMATIC_ASSERT (false);
410 _type->SetSelection (0);
412 setup_sensitivity ();
414 } else if (property == TextContentProperty::BURN) {
415 checked_set (_burn, text ? text->burn() : false);
416 } else if (property == TextContentProperty::X_OFFSET) {
417 checked_set (_x_offset, text ? lrint (text->x_offset() * 100) : 0);
418 } else if (property == TextContentProperty::Y_OFFSET) {
419 checked_set (_y_offset, text ? lrint (text->y_offset() * 100) : 0);
420 } else if (property == TextContentProperty::X_SCALE) {
421 checked_set (_x_scale, text ? lrint (text->x_scale() * 100) : 100);
422 } else if (property == TextContentProperty::Y_SCALE) {
423 checked_set (_y_scale, text ? lrint (text->y_scale() * 100) : 100);
424 } else if (property == TextContentProperty::LINE_SPACING) {
425 checked_set (_line_spacing, text ? lrint (text->line_spacing() * 100) : 100);
426 } else if (property == TextContentProperty::LANGUAGE) {
428 checked_set (_language, text ? text->language() : "");
430 } else if (property == TextContentProperty::DCP_TRACK) {
432 update_dcp_track_selection ();
434 } else if (property == DCPContentProperty::REFERENCE_TEXT) {
436 shared_ptr<DCPContent> dcp = dynamic_pointer_cast<DCPContent> (scs);
437 checked_set (_reference, dcp ? dcp->reference_text(_original_type) : false);
439 checked_set (_reference, false);
442 setup_sensitivity ();
443 } else if (property == DCPContentProperty::TEXTS) {
444 setup_sensitivity ();
449 TextPanel::use_toggled ()
451 BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_text()) {
452 i->text_of_original_type(_original_type)->set_use (_use->GetValue());
456 /** @return the text type that is currently selected in the drop-down */
458 TextPanel::current_type () const
460 switch (_type->GetSelection()) {
462 return TEXT_OPEN_SUBTITLE;
464 return TEXT_CLOSED_CAPTION;
471 TextPanel::type_changed ()
473 BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_text()) {
474 i->text_of_original_type(_original_type)->set_type (current_type ());
481 TextPanel::burn_toggled ()
483 BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_text ()) {
484 i->text_of_original_type(_original_type)->set_burn (_burn->GetValue());
489 TextPanel::setup_sensitivity ()
492 /* We currently assume that FFmpeg subtitles are bitmapped */
494 /* DCP subs can't have their line spacing changed */
496 ContentList sel = _parent->selected_text ();
497 BOOST_FOREACH (shared_ptr<Content> i, sel) {
498 /* These are the content types that could include subtitles */
499 shared_ptr<const FFmpegContent> fc = boost::dynamic_pointer_cast<const FFmpegContent> (i);
500 shared_ptr<const StringTextFileContent> sc = boost::dynamic_pointer_cast<const StringTextFileContent> (i);
501 shared_ptr<const DCPContent> dc = boost::dynamic_pointer_cast<const DCPContent> (i);
502 shared_ptr<const DCPSubtitleContent> dsc = boost::dynamic_pointer_cast<const DCPSubtitleContent> (i);
504 if (!fc->text.empty()) {
508 } else if (dc || dsc) {
512 /* XXX: in the future there could be bitmap subs from DCPs */
517 /* Decide whether we can reference these subs */
519 shared_ptr<DCPContent> dcp;
520 if (sel.size() == 1) {
521 dcp = dynamic_pointer_cast<DCPContent> (sel.front ());
525 bool const can_reference = dcp && dcp->can_reference_text (_parent->film(), _original_type, why_not);
526 setup_refer_button (_reference, _reference_note, dcp, can_reference, why_not);
528 bool const reference = _reference->GetValue ();
530 TextType const type = current_type ();
534 _type->Append (_("open subtitles"));
535 if (ffmpeg_subs == 0) {
536 _type->Append (_("closed captions"));
540 case TEXT_OPEN_SUBTITLE:
541 _type->SetSelection (0);
543 case TEXT_CLOSED_CAPTION:
544 if (_type->GetCount() > 1) {
545 _type->SetSelection (1);
552 /* Set up sensitivity */
553 _use->Enable (!reference && any_subs > 0);
554 bool const use = _use->GetValue ();
555 _type->Enable (!reference && any_subs > 0 && use);
556 _burn->Enable (!reference && any_subs > 0 && use && type == TEXT_OPEN_SUBTITLE);
557 _x_offset->Enable (!reference && any_subs > 0 && use && type == TEXT_OPEN_SUBTITLE);
558 _y_offset->Enable (!reference && any_subs > 0 && use && type == TEXT_OPEN_SUBTITLE);
559 _x_scale->Enable (!reference && any_subs > 0 && use && type == TEXT_OPEN_SUBTITLE);
560 _y_scale->Enable (!reference && any_subs > 0 && use && type == TEXT_OPEN_SUBTITLE);
561 _line_spacing->Enable (!reference && use && type == TEXT_OPEN_SUBTITLE && dcp_subs < any_subs);
562 _stream->Enable (!reference && ffmpeg_subs == 1);
563 /* Ideally we would check here to see if the FFmpeg content has "string" subs (i.e. not bitmaps) */
564 _text_view_button->Enable (!reference && any_subs > 0 && ffmpeg_subs == 0);
565 _fonts_dialog_button->Enable (!reference && any_subs > 0 && ffmpeg_subs == 0 && type == TEXT_OPEN_SUBTITLE);
566 _appearance_dialog_button->Enable (!reference && any_subs > 0 && use && type == TEXT_OPEN_SUBTITLE);
570 TextPanel::stream_changed ()
572 FFmpegContentList fc = _parent->selected_ffmpeg ();
573 if (fc.size() != 1) {
577 shared_ptr<FFmpegContent> fcs = fc.front ();
579 vector<shared_ptr<FFmpegSubtitleStream> > a = fcs->subtitle_streams ();
580 vector<shared_ptr<FFmpegSubtitleStream> >::iterator i = a.begin ();
581 string const s = string_client_data (_stream->GetClientObject (_stream->GetSelection ()));
582 while (i != a.end() && (*i)->identifier () != s) {
587 fcs->set_subtitle_stream (*i);
592 TextPanel::x_offset_changed ()
594 BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_text ()) {
595 i->text_of_original_type(_original_type)->set_x_offset (_x_offset->GetValue() / 100.0);
600 TextPanel::y_offset_changed ()
602 BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_text ()) {
603 i->text_of_original_type(_original_type)->set_y_offset (_y_offset->GetValue() / 100.0);
608 TextPanel::x_scale_changed ()
610 ContentList c = _parent->selected_text ();
612 c.front()->text_of_original_type(_original_type)->set_x_scale (_x_scale->GetValue() / 100.0);
617 TextPanel::y_scale_changed ()
619 BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_text ()) {
620 i->text_of_original_type(_original_type)->set_y_scale (_y_scale->GetValue() / 100.0);
625 TextPanel::line_spacing_changed ()
627 BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_text ()) {
628 i->text_of_original_type(_original_type)->set_line_spacing (_line_spacing->GetValue() / 100.0);
633 TextPanel::language_changed ()
635 DCPOMATIC_ASSERT (_language);
636 BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_text ()) {
637 i->text_of_original_type(_original_type)->set_language (wx_to_std (_language->GetValue()));
642 TextPanel::content_selection_changed ()
644 film_content_changed (FFmpegContentProperty::SUBTITLE_STREAMS);
645 film_content_changed (TextContentProperty::USE);
646 film_content_changed (TextContentProperty::BURN);
647 film_content_changed (TextContentProperty::X_OFFSET);
648 film_content_changed (TextContentProperty::Y_OFFSET);
649 film_content_changed (TextContentProperty::X_SCALE);
650 film_content_changed (TextContentProperty::Y_SCALE);
651 film_content_changed (TextContentProperty::LINE_SPACING);
652 film_content_changed (TextContentProperty::LANGUAGE);
653 film_content_changed (TextContentProperty::FONTS);
654 film_content_changed (TextContentProperty::TYPE);
655 film_content_changed (TextContentProperty::DCP_TRACK);
656 film_content_changed (DCPContentProperty::REFERENCE_TEXT);
660 TextPanel::text_view_clicked ()
663 _text_view->Destroy ();
667 ContentList c = _parent->selected_text ();
668 DCPOMATIC_ASSERT (c.size() == 1);
670 shared_ptr<Decoder> decoder = decoder_factory (_parent->film(), c.front(), false);
673 _text_view = new TextView (this, _parent->film(), c.front(), c.front()->text_of_original_type(_original_type), decoder, _parent->film_viewer());
679 TextPanel::fonts_dialog_clicked ()
682 _fonts_dialog->Destroy ();
686 ContentList c = _parent->selected_text ();
687 DCPOMATIC_ASSERT (c.size() == 1);
689 _fonts_dialog = new FontsDialog (this, c.front(), c.front()->text_of_original_type(_original_type));
690 _fonts_dialog->Show ();
694 TextPanel::reference_clicked ()
696 ContentList c = _parent->selected ();
701 shared_ptr<DCPContent> d = dynamic_pointer_cast<DCPContent> (c.front ());
706 d->set_reference_text (_original_type, _reference->GetValue ());
710 TextPanel::appearance_dialog_clicked ()
712 ContentList c = _parent->selected_text ();
713 DCPOMATIC_ASSERT (c.size() == 1);
715 SubtitleAppearanceDialog* d = new SubtitleAppearanceDialog (this, _parent->film(), c.front(), c.front()->text_of_original_type(_original_type));
716 if (d->ShowModal () == wxID_OK) {