Port filters dialog. Make command line loading work again.
[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 "lib/trim_action.h"
28 #include "lib/film.h"
29
30 class Film;
31
32 /** @class FilmEditor
33  *  @brief A wx widget to edit a film's metadata, and perform various functions.
34  */
35 class FilmEditor : public wxPanel
36 {
37 public:
38         FilmEditor (Film *, wxWindow *);
39
40         void set_film (Film *);
41         void setup_visibility ();
42
43         sigc::signal1<void, std::string> FileChanged;
44
45 private:
46         /* Handle changes to the view */
47         void name_changed (wxCommandEvent &);
48         void left_crop_changed (wxCommandEvent &);
49         void right_crop_changed (wxCommandEvent &);
50         void top_crop_changed (wxCommandEvent &);
51         void bottom_crop_changed (wxCommandEvent &);
52         void content_changed (wxCommandEvent &);
53         void frames_per_second_changed (wxCommandEvent &);
54         void format_changed (wxCommandEvent &);
55         void dcp_range_changed (int, TrimAction);
56         void dcp_content_type_changed (wxCommandEvent &);
57         void dcp_ab_toggled (wxCommandEvent &);
58         void scaler_changed (wxCommandEvent &);
59         void audio_gain_changed (wxCommandEvent &);
60         void audio_delay_changed (wxCommandEvent &);
61         void still_duration_changed (wxCommandEvent &);
62
63         /* Handle changes to the model */
64         void film_changed (Film::Property);
65
66         /* Button clicks */
67         void edit_filters_clicked (wxCommandEvent &);
68         void change_dcp_range_clicked (wxCommandEvent &);
69
70         void set_things_sensitive (bool);
71
72         wxControl* video_control (wxControl *);
73         wxControl* still_control (wxControl *);
74
75         bool _ignore_changes;
76
77         /** The film we are editing */
78         Film* _film;
79         /** The Film's name */
80         wxTextCtrl* _name;
81         /** The Film's frames per second */
82         wxTextCtrl* _frames_per_second;
83         /** The Film's format */
84         wxComboBox* _format;
85         /** The Film's content file */
86         wxFilePickerCtrl* _content;
87         /** The Film's left crop */
88         wxSpinCtrl* _left_crop;
89         /** The Film's right crop */
90         wxSpinCtrl* _right_crop;
91         /** The Film's top crop */
92         wxSpinCtrl* _top_crop;
93         /** The Film's bottom crop */
94         wxSpinCtrl* _bottom_crop;
95         /** Currently-applied filters */
96         wxStaticText* _filters;
97         /** Button to open the filters dialogue */
98         wxButton* _filters_button;
99         /** The Film's scaler */
100         wxComboBox* _scaler;
101         /** The Film's audio gain */
102         wxSpinCtrl* _audio_gain;
103         /** The Film's audio delay */
104         wxSpinCtrl* _audio_delay;
105         /** The Film's DCP content type */
106         wxComboBox* _dcp_content_type;
107         /** The Film's original size */
108         wxStaticText* _original_size;
109         /** The Film's length */
110         wxStaticText* _length;
111         /** The Film's audio details */
112         wxStaticText* _audio;
113         /** The Film's duration for still sources */
114         wxSpinCtrl* _still_duration;
115
116         /** Display of the range of frames that will be used */
117         wxStaticText* _dcp_range;
118         /** Button to change the range */
119         wxButton* _change_dcp_range_button;
120         /** Selector to generate an A/B comparison DCP */
121         wxCheckBox* _dcp_ab;
122
123         std::list<wxControl*> _video_controls;
124         std::list<wxControl*> _still_controls;
125
126         wxSizer* _sizer;
127 };