Present fixed formats with video content and variable formats with stills.
[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 format_changed (wxCommandEvent &);
54         void dcp_range_changed (int, TrimAction);
55         void dcp_content_type_changed (wxCommandEvent &);
56         void dcp_ab_toggled (wxCommandEvent &);
57         void scaler_changed (wxCommandEvent &);
58         void audio_gain_changed (wxCommandEvent &);
59         void audio_gain_calculate_button_clicked (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         void setup_formats ();
72         
73         wxControl* video_control (wxControl *);
74         wxControl* still_control (wxControl *);
75
76         Film::Property _ignore_changes;
77
78         /** The film we are editing */
79         Film* _film;
80         /** The Film's name */
81         wxTextCtrl* _name;
82         /** The Film's format */
83         wxComboBox* _format;
84         /** The Film's content file */
85         wxFilePickerCtrl* _content;
86         /** The Film's left crop */
87         wxSpinCtrl* _left_crop;
88         /** The Film's right crop */
89         wxSpinCtrl* _right_crop;
90         /** The Film's top crop */
91         wxSpinCtrl* _top_crop;
92         /** The Film's bottom crop */
93         wxSpinCtrl* _bottom_crop;
94         /** Currently-applied filters */
95         wxStaticText* _filters;
96         /** Button to open the filters dialogue */
97         wxButton* _filters_button;
98         /** The Film's scaler */
99         wxComboBox* _scaler;
100         /** The Film's audio gain */
101         wxSpinCtrl* _audio_gain;
102         /** A button to open the gain calculation dialogue */
103         wxButton* _audio_gain_calculate_button;
104         /** The Film's audio delay */
105         wxSpinCtrl* _audio_delay;
106         /** The Film's DCP content type */
107         wxComboBox* _dcp_content_type;
108         /** The Film's frames per second */
109         wxStaticText* _frames_per_second;
110         /** The Film's original size */
111         wxStaticText* _original_size;
112         /** The Film's length */
113         wxStaticText* _length;
114         /** The Film's audio details */
115         wxStaticText* _audio;
116         /** The Film's duration for still sources */
117         wxSpinCtrl* _still_duration;
118
119         /** Display of the range of frames that will be used */
120         wxStaticText* _dcp_range;
121         /** Button to change the range */
122         wxButton* _change_dcp_range_button;
123         /** Selector to generate an A/B comparison DCP */
124         wxCheckBox* _dcp_ab;
125
126         std::list<wxControl*> _video_controls;
127         std::list<wxControl*> _still_controls;
128
129         std::vector<Format const *> _formats;
130
131         wxSizer* _sizer;
132 };