+ shared_ptr<FFmpegContent> ff = dynamic_pointer_cast<FFmpegContent> (content);
+ if (ff) {
+ _stream = ff->subtitle_stream ();
+ }
+
+ wxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL);
+ SetSizer (overall_sizer);
+
+ _table = new wxGridBagSizer (DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
+
+ overall_sizer->Add (_table, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
+
+ int r = 0;
+
+ add_label_to_sizer (_table, this, _("Colour"), true, wxGBPosition (r, 0));
+ _force_colour = set_to (_colour = new wxColourPickerCtrl (this, wxID_ANY), r);
+
+ add_label_to_sizer (_table, this, _("Effect"), true, wxGBPosition (r, 0));
+ _force_effect = set_to (_effect = new wxChoice (this, wxID_ANY), r);
+
+ add_label_to_sizer (_table, this, _("Effect colour"), true, wxGBPosition (r, 0));
+ _force_effect_colour = set_to (_effect_colour = new wxColourPickerCtrl (this, wxID_ANY), r);
+
+ add_label_to_sizer (_table, this, _("Outline width"), true, wxGBPosition (r, 0));
+ _outline_width = new wxSpinCtrl (this, wxID_ANY);
+ _table->Add (_outline_width, wxGBPosition (r, 1));
+ ++r;
+
+ add_label_to_sizer (_table, this, _("Fade in time"), true, wxGBPosition (r, 0));
+ _force_fade_in = set_to (_fade_in = new Timecode<ContentTime> (this), r);
+
+ add_label_to_sizer (_table, this, _("Fade out time"), true, wxGBPosition (r, 0));
+ _force_fade_out = set_to (_fade_out = new Timecode<ContentTime> (this), r);
+
+ if (_stream) {
+ wxScrolled<wxPanel>* colours_panel = new wxScrolled<wxPanel> (this);
+ colours_panel->EnableScrolling (false, true);
+ colours_panel->ShowScrollbars (wxSHOW_SB_NEVER, wxSHOW_SB_ALWAYS);
+ colours_panel->SetScrollRate (0, 16);
+
+ wxFlexGridSizer* table = new wxFlexGridSizer (2, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
+ table->AddGrowableCol (1, 1);
+
+ map<RGBA, RGBA> colours = _stream->colours ();
+
+ wxStaticText* t = new StaticText (colours_panel, "");
+ t->SetLabelMarkup (_("<b>Original colour</b>"));
+ table->Add (t, 1, wxEXPAND);
+ t = new StaticText (colours_panel, "", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE_HORIZONTAL);
+ t->SetLabelMarkup (_("<b>New colour</b>"));
+ table->Add (t, 1, wxALIGN_CENTER);
+
+ for (map<RGBA, RGBA>::const_iterator i = colours.begin(); i != colours.end(); ++i) {
+ wxPanel* from = new wxPanel (colours_panel, wxID_ANY);
+ from->SetBackgroundColour (wxColour (i->first.r, i->first.g, i->first.b, i->first.a));
+ table->Add (from, 1, wxEXPAND);
+ RGBAColourPicker* to = new RGBAColourPicker (colours_panel, i->second);
+ table->Add (to, 1, wxEXPAND);
+ _pickers[i->first] = to;
+ }
+
+ colours_panel->SetSizer (table);
+
+ overall_sizer->Add (colours_panel, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
+
+ wxButton* restore = new wxButton (this, wxID_ANY, _("Restore to original colours"));
+ restore->Bind (wxEVT_BUTTON, bind (&SubtitleAppearanceDialog::restore, this));
+ overall_sizer->Add (restore, 0, wxALL, DCPOMATIC_SIZER_X_GAP);
+ }
+
+ wxSizer* buttons = CreateSeparatedButtonSizer (wxOK);
+ if (buttons) {
+ overall_sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder());
+ }
+
+ overall_sizer->Layout ();
+ overall_sizer->SetSizeHints (this);
+
+ /* Keep these Appends() up to date with NONE/OUTLINE/SHADOW variables */
+ _effect->Append (_("None"));
+ _effect->Append (_("Outline"));
+ _effect->Append (_("Shadow"));;