Merge branch 'master' of /home/carl/git/dvdomatic
[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 "lib/trim_action.h"
29 #include "lib/film.h"
30
31 class Film;
32
33 /** @class FilmEditor
34  *  @brief A wx widget to edit a film's metadata, and perform various functions.
35  */
36 class FilmEditor : public wxPanel
37 {
38 public:
39         FilmEditor (Film *, wxWindow *);
40
41         void set_film (Film *);
42         void setup_visibility ();
43
44         sigc::signal1<void, std::string> FileChanged;
45
46 private:
47         /* Handle changes to the view */
48         void name_changed (wxCommandEvent &);
49         void left_crop_changed (wxCommandEvent &);
50         void right_crop_changed (wxCommandEvent &);
51         void top_crop_changed (wxCommandEvent &);
52         void bottom_crop_changed (wxCommandEvent &);
53         void content_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_gain_calculate_button_clicked (wxCommandEvent &);
61         void audio_delay_changed (wxCommandEvent &);
62         void with_subtitles_toggled (wxCommandEvent &);
63         void subtitle_offset_changed (wxCommandEvent &);
64         void subtitle_scale_changed (wxCommandEvent &);
65         void still_duration_changed (wxCommandEvent &);
66
67         /* Handle changes to the model */
68         void film_changed (Film::Property);
69
70         /* Button clicks */
71         void edit_filters_clicked (wxCommandEvent &);
72         void change_dcp_range_clicked (wxCommandEvent &);
73
74         void set_things_sensitive (bool);
75         void setup_formats ();
76         void setup_subtitle_button ();
77         
78         wxControl* video_control (wxControl *);
79         wxControl* still_control (wxControl *);
80
81         Film::Property _ignore_changes;
82
83         /** The film we are editing */
84         Film* _film;
85         /** The Film's name */
86         wxTextCtrl* _name;
87         wxCheckBox* _use_dci_name;
88         wxButton* _edit_dci_button;
89         /** The Film's format */
90         wxComboBox* _format;
91         /** The Film's content file */
92         wxFilePickerCtrl* _content;
93         /** The Film's left crop */
94         wxSpinCtrl* _left_crop;
95         /** The Film's right crop */
96         wxSpinCtrl* _right_crop;
97         /** The Film's top crop */
98         wxSpinCtrl* _top_crop;
99         /** The Film's bottom crop */
100         wxSpinCtrl* _bottom_crop;
101         /** Currently-applied filters */
102         wxStaticText* _filters;
103         /** Button to open the filters dialogue */
104         wxButton* _filters_button;
105         /** The Film's scaler */
106         wxComboBox* _scaler;
107         /** The Film's audio gain */
108         wxSpinCtrl* _audio_gain;
109         /** A button to open the gain calculation dialogue */
110         wxButton* _audio_gain_calculate_button;
111         /** The Film's audio delay */
112         wxSpinCtrl* _audio_delay;
113         wxCheckBox* _with_subtitles;
114         wxSpinCtrl* _subtitle_offset;
115         wxSpinCtrl* _subtitle_scale;
116         /** The Film's DCP content type */
117         wxComboBox* _dcp_content_type;
118         /** The Film's frames per second */
119         wxStaticText* _frames_per_second;
120         /** The Film's original size */
121         wxStaticText* _original_size;
122         /** The Film's length */
123         wxStaticText* _length;
124         /** The Film's audio details */
125         wxStaticText* _audio;
126         /** The Film's duration for still sources */
127         wxSpinCtrl* _still_duration;
128
129         /** Display of the range of frames that will be used */
130         wxStaticText* _dcp_range;
131         /** Button to change the range */
132         wxButton* _change_dcp_range_button;
133         /** Selector to generate an A/B comparison DCP */
134         wxCheckBox* _dcp_ab;
135
136         std::list<wxControl*> _video_controls;
137         std::list<wxControl*> _still_controls;
138
139         std::vector<Format const *> _formats;
140
141         wxSizer* _sizer;
142 };