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