Supporters update.
[dcpomatic.git] / src / wx / text_panel.h
1 /*
2     Copyright (C) 2012-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 "lib/job.h"
23 #include "content_sub_panel.h"
24 #include "wx_ptr.h"
25
26
27 class CheckBox;
28 class wxSpinCtrl;
29 class LanguageTagWidget;
30 class TextView;
31 class FontsDialog;
32 class SpinCtrl;
33 class SubtitleAnalysis;
34
35
36 class TextPanel : public ContentSubPanel
37 {
38 public:
39         TextPanel (ContentPanel *, TextType t);
40
41         void create () override;
42         void film_changed(FilmProperty) override;
43         void film_content_changed (int) override;
44         void content_selection_changed () override;
45
46 private:
47         void use_toggled ();
48         void type_changed ();
49         void burn_toggled ();
50         void x_offset_changed ();
51         void y_offset_changed ();
52         void x_scale_changed ();
53         void y_scale_changed ();
54         void line_spacing_changed ();
55         void dcp_track_changed ();
56         void stream_changed ();
57         void text_view_clicked ();
58         void fonts_dialog_clicked ();
59         void reference_clicked ();
60         void appearance_dialog_clicked ();
61         void outline_subtitles_changed ();
62         TextType current_type () const;
63         void update_dcp_tracks ();
64         void update_dcp_track_selection ();
65         void add_to_grid () override;
66         void try_to_load_analysis ();
67         void analysis_finished(Job::Result result);
68         void language_changed ();
69         void language_is_additional_changed ();
70
71         void setup_sensitivity ();
72         void setup_visibility ();
73
74         void update_outline_subtitles_in_viewer ();
75         void clear_outline_subtitles ();
76
77         CheckBox* _reference;
78         wxStaticText* _reference_note;
79         CheckBox* _outline_subtitles = nullptr;
80         CheckBox* _use;
81         wxChoice* _type;
82         CheckBox* _burn;
83         wxStaticText* _offset_label;
84         wxStaticText* _x_offset_label;
85         wxStaticText* _x_offset_pc_label;
86         wxStaticText* _y_offset_label;
87         wxStaticText* _y_offset_pc_label;
88         SpinCtrl* _x_offset;
89         SpinCtrl* _y_offset;
90         wxStaticText* _scale_label;
91         wxStaticText* _x_scale_label;
92         wxStaticText* _x_scale_pc_label;
93         wxStaticText* _y_scale_label;
94         wxStaticText* _y_scale_pc_label;
95         SpinCtrl* _x_scale;
96         SpinCtrl* _y_scale;
97         wxStaticText* _line_spacing_label;
98         wxStaticText* _line_spacing_pc_label;
99         SpinCtrl* _line_spacing;
100         wxStaticText* _dcp_track_label = nullptr;
101         wxChoice* _dcp_track = nullptr;
102         wxStaticText* _stream_label;
103         wxChoice* _stream;
104         wxButton* _text_view_button;
105         wx_ptr<TextView> _text_view;
106         wxButton* _fonts_dialog_button;
107         wx_ptr<FontsDialog> _fonts_dialog;
108         wxButton* _appearance_dialog_button;
109         TextType _original_type;
110         wxStaticText* _language_label = nullptr;
111         LanguageTagWidget* _language = nullptr;
112         wxSizer* _language_sizer = nullptr;
113         wxChoice* _language_type = nullptr;
114
115         int _outline_subtitles_row;
116         int _ccap_track_or_language_row;
117
118         std::weak_ptr<Content> _analysis_content;
119         boost::signals2::scoped_connection _analysis_finished_connection;
120         std::shared_ptr<SubtitleAnalysis> _analysis;
121         bool _loading_analysis = false;
122 };