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