Setup Butler::_prepare_only_proxy on construction.
[dcpomatic.git] / src / wx / subtitle_appearance_dialog.h
1 /*
2     Copyright (C) 2015-2021 Carl Hetherington <cth@carlh.net>
3
4     This file is part of DCP-o-matic.
5
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.
10
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.
15
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/>.
18
19 */
20
21
22 #include "timecode.h"
23 #include "lib/change_signaller.h"
24 #include "lib/rgba.h"
25 #include "lib/warnings.h"
26 DCPOMATIC_DISABLE_WARNINGS
27 #include <wx/wx.h>
28 DCPOMATIC_ENABLE_WARNINGS
29 #include <boost/signals2.hpp>
30
31
32 class wxRadioButton;
33 class wxColourPickerCtrl;
34 class wxGridBagSizer;
35 class Content;
36 class RGBAColourPicker;
37 class FFmpegSubtitleStream;
38 class wxCheckBox;
39 class wxWidget;
40 class Film;
41 class Job;
42
43
44 class SubtitleAppearanceDialog : public wxDialog
45 {
46 public:
47         SubtitleAppearanceDialog (wxWindow* parent, std::shared_ptr<const Film> film, std::shared_ptr<Content> content, std::shared_ptr<TextContent> caption);
48
49         void apply ();
50
51 private:
52         void setup_sensitivity ();
53         void restore ();
54         wxCheckBox* set_to (wxWindow* w, int& r);
55         void content_change (ChangeType type);
56         void active_jobs_changed (boost::optional<std::string> last);
57         void add_colours ();
58
59         std::weak_ptr<const Film> _film;
60         wxCheckBox* _force_colour;
61         wxColourPickerCtrl* _colour;
62         wxCheckBox* _force_effect;
63         wxChoice* _effect;
64         wxCheckBox* _force_effect_colour;
65         wxColourPickerCtrl* _effect_colour;
66         wxCheckBox* _force_fade_in;
67         Timecode<dcpomatic::ContentTime>* _fade_in;
68         wxCheckBox* _force_fade_out;
69         Timecode<dcpomatic::ContentTime>* _fade_out;
70         wxSpinCtrl* _outline_width;
71         wxGridBagSizer* _table;
72         std::map<RGBA, RGBAColourPicker*> _pickers;
73
74         wxBoxSizer* _overall_sizer;
75         wxScrolled<wxPanel>* _colours_panel;
76         wxStaticText* _finding = nullptr;
77         wxFlexGridSizer* _colour_table;
78
79         std::shared_ptr<Content> _content;
80         std::shared_ptr<TextContent> _text;
81         std::shared_ptr<FFmpegSubtitleStream> _stream;
82
83         boost::signals2::scoped_connection _content_connection;
84         boost::signals2::scoped_connection _job_manager_connection;
85
86         std::weak_ptr<Job> _job;
87
88         static int const NONE;
89         static int const OUTLINE;
90         static int const SHADOW;
91 };