Some basics of AudioMapping.
[dcpomatic.git] / src / wx / film_editor.h
1 /*
2     Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
3
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.
8
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13
14     You should have received a copy of the GNU General Public License
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 */
19  
20 /** @file src/film_editor.h
21  *  @brief A wx widget to edit a film's metadata, and perform various functions.
22  */
23
24 #include <wx/wx.h>
25 #include <wx/spinctrl.h>
26 #include <wx/filepicker.h>
27 #include <wx/collpane.h>
28 #include <boost/signals2.hpp>
29 #include "lib/film.h"
30
31 class wxNotebook;
32 class wxListCtrl;
33 class wxListEvent;
34 class Film;
35 class AudioDialog;
36 class TimelineDialog;
37
38 /** @class FilmEditor
39  *  @brief A wx widget to edit a film's metadata, and perform various functions.
40  */
41 class FilmEditor : public wxPanel
42 {
43 public:
44         FilmEditor (boost::shared_ptr<Film>, wxWindow *);
45
46         void set_film (boost::shared_ptr<Film>);
47
48         boost::signals2::signal<void (std::string)> FileChanged;
49
50 private:
51         void make_film_panel ();
52         void make_content_panel ();
53         void make_video_panel ();
54         void make_audio_panel ();
55         void make_subtitle_panel ();
56         void connect_to_widgets ();
57         
58         /* Handle changes to the view */
59         void name_changed (wxCommandEvent &);
60         void use_dci_name_toggled (wxCommandEvent &);
61         void edit_dci_button_clicked (wxCommandEvent &);
62         void left_crop_changed (wxCommandEvent &);
63         void right_crop_changed (wxCommandEvent &);
64         void top_crop_changed (wxCommandEvent &);
65         void bottom_crop_changed (wxCommandEvent &);
66         void trust_content_headers_changed (wxCommandEvent &);
67         void content_selection_changed (wxListEvent &);
68         void content_activated (wxListEvent &);
69         void content_add_clicked (wxCommandEvent &);
70         void content_remove_clicked (wxCommandEvent &);
71         void content_properties_clicked (wxCommandEvent &);
72         void imagemagick_video_length_changed (wxCommandEvent &);
73         void format_changed (wxCommandEvent &);
74         void trim_type_changed (wxCommandEvent &);
75         void dcp_content_type_changed (wxCommandEvent &);
76         void ab_toggled (wxCommandEvent &);
77         void scaler_changed (wxCommandEvent &);
78         void audio_gain_changed (wxCommandEvent &);
79         void audio_gain_calculate_button_clicked (wxCommandEvent &);
80         void show_audio_clicked (wxCommandEvent &);
81         void audio_delay_changed (wxCommandEvent &);
82         void with_subtitles_toggled (wxCommandEvent &);
83         void subtitle_offset_changed (wxCommandEvent &);
84         void subtitle_scale_changed (wxCommandEvent &);
85         void colour_lut_changed (wxCommandEvent &);
86         void j2k_bandwidth_changed (wxCommandEvent &);
87         void dcp_frame_rate_changed (wxCommandEvent &);
88         void best_dcp_frame_rate_clicked (wxCommandEvent &);
89         void edit_filters_clicked (wxCommandEvent &);
90         void loop_content_toggled (wxCommandEvent &);
91         void loop_count_changed (wxCommandEvent &);
92         void content_timeline_clicked (wxCommandEvent &);
93
94         /* Handle changes to the model */
95         void film_changed (Film::Property);
96         void film_content_changed (boost::weak_ptr<Content>, int);
97
98         void set_things_sensitive (bool);
99         void setup_formats ();
100         void setup_subtitle_control_sensitivity ();
101         void setup_dcp_name ();
102         void setup_show_audio_sensitivity ();
103         void setup_scaling_description ();
104         void setup_notebook_size ();
105         void setup_frame_rate_description ();
106         void setup_content ();
107         void setup_format ();
108         void setup_length ();
109         void setup_content_information ();
110         void setup_content_button_sensitivity ();
111         void setup_loop_sensitivity ();
112         
113         void active_jobs_changed (bool);
114         boost::shared_ptr<Content> selected_content ();
115         void content_properties (boost::shared_ptr<Content>);
116
117         wxNotebook* _notebook;
118         wxPanel* _film_panel;
119         wxSizer* _film_sizer;
120         wxPanel* _content_panel;
121         wxSizer* _content_sizer;
122         wxPanel* _video_panel;
123         wxSizer* _video_sizer;
124         wxPanel* _audio_panel;
125         wxSizer* _audio_sizer;
126         wxPanel* _subtitle_panel;
127         wxSizer* _subtitle_sizer;
128
129         /** The film we are editing */
130         boost::shared_ptr<Film> _film;
131         /** The Film's name */
132         wxTextCtrl* _name;
133         wxStaticText* _dcp_name;
134         wxCheckBox* _use_dci_name;
135         wxListCtrl* _content;
136         wxButton* _content_add;
137         wxButton* _content_remove;
138         wxButton* _content_properties;
139         wxButton* _content_earlier;
140         wxButton* _content_later;
141         wxButton* _content_timeline;
142         wxTextCtrl* _content_information;
143         wxCheckBox* _loop_content;
144         wxSpinCtrl* _loop_count;
145         wxButton* _edit_dci_button;
146         wxChoice* _format;
147         wxStaticText* _format_description;
148         wxCheckBox* _trust_content_headers;
149         wxStaticText* _scaling_description;
150         wxSpinCtrl* _left_crop;
151         wxSpinCtrl* _right_crop;
152         wxSpinCtrl* _top_crop;
153         wxSpinCtrl* _bottom_crop;
154         wxStaticText* _filters;
155         wxButton* _filters_button;
156         wxChoice* _scaler;
157         wxSpinCtrl* _audio_gain;
158         wxButton* _audio_gain_calculate_button;
159         wxButton* _show_audio;
160         wxSpinCtrl* _audio_delay;
161         wxCheckBox* _with_subtitles;
162         wxSpinCtrl* _subtitle_offset;
163         wxSpinCtrl* _subtitle_scale;
164         wxChoice* _colour_lut;
165         wxSpinCtrl* _j2k_bandwidth;
166         wxChoice* _dcp_content_type;
167         wxChoice* _dcp_frame_rate;
168         wxButton* _best_dcp_frame_rate;
169         wxStaticText* _frame_rate_description;
170         wxStaticText* _length;
171         /** The Film's audio details */
172         wxStaticText* _audio;
173
174         wxChoice* _trim_type;
175         /** Selector to generate an A/B comparison DCP */
176         wxCheckBox* _ab;
177
178         std::vector<Format const *> _formats;
179
180         bool _generally_sensitive;
181         AudioDialog* _audio_dialog;
182         TimelineDialog* _timeline_dialog;
183 };