#include trimming.
[dcpomatic.git] / src / wx / film_editor.h
1 /*
2     Copyright (C) 2012-2014 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 <boost/signals2.hpp>
26 #include "lib/film.h"
27
28 class wxNotebook;
29 class wxSpinCtrl;
30 class Film;
31 class Ratio;
32 class ContentPanel;
33
34 /** @class FilmEditor
35  *  @brief A wx widget to edit a film's metadata, and perform various functions.
36  */
37 class FilmEditor : public wxPanel
38 {
39 public:
40         FilmEditor (boost::shared_ptr<Film>, wxWindow *);
41
42         void set_film (boost::shared_ptr<Film>);
43
44         boost::signals2::signal<void (boost::filesystem::path)> FileChanged;
45
46         /* Stuff for panels */
47
48         ContentPanel* content_panel () const {
49                 return _content_panel;
50         }
51         
52         boost::shared_ptr<Film> film () const {
53                 return _film;
54         }
55
56 private:
57         void make_dcp_panel ();
58         void connect_to_widgets ();
59         
60         /* Handle changes to the view */
61         void name_changed ();
62         void use_isdcf_name_toggled ();
63         void edit_isdcf_button_clicked ();
64         void container_changed ();
65         void dcp_content_type_changed ();
66         void scaler_changed ();
67         void j2k_bandwidth_changed ();
68         void frame_rate_choice_changed ();
69         void frame_rate_spin_changed ();
70         void best_frame_rate_clicked ();
71         void content_timeline_clicked ();
72         void audio_channels_changed ();
73         void resolution_changed ();
74         void three_d_changed ();
75         void standard_changed ();
76         void signed_toggled ();
77         void burn_subtitles_toggled ();
78         void encrypted_toggled ();
79
80         /* Handle changes to the model */
81         void film_changed (Film::Property);
82         void film_content_changed (int);
83
84         void set_general_sensitivity (bool);
85         void setup_dcp_name ();
86         void setup_container ();
87         void setup_frame_rate_widget ();
88         
89         void active_jobs_changed (bool);
90         void config_changed ();
91
92         wxNotebook* _main_notebook;
93         wxPanel* _dcp_panel;
94         wxSizer* _dcp_sizer;
95         ContentPanel* _content_panel;
96
97         /** The film we are editing */
98         boost::shared_ptr<Film> _film;
99         wxTextCtrl* _name;
100         wxStaticText* _dcp_name;
101         wxCheckBox* _use_isdcf_name;
102         wxChoice* _container;
103         wxButton* _edit_isdcf_button;
104         wxChoice* _scaler;
105         wxSpinCtrl* _j2k_bandwidth;
106         wxChoice* _dcp_content_type;
107         wxChoice* _frame_rate_choice;
108         wxSpinCtrl* _frame_rate_spin;
109         wxSizer* _frame_rate_sizer;
110         wxSpinCtrl* _audio_channels;
111         wxButton* _best_frame_rate;
112         wxCheckBox* _three_d;
113         wxChoice* _resolution;
114         wxChoice* _standard;
115         wxCheckBox* _signed;
116         wxCheckBox* _burn_subtitles;
117         wxCheckBox* _encrypted;
118
119         std::vector<Ratio const *> _ratios;
120
121         bool _generally_sensitive;
122 };