Basic multiple selection for cropping.
[dcpomatic.git] / src / wx / film_editor.h
1 /*
2     Copyright (C) 2012-2013 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
32 class wxNotebook;
33 class wxListCtrl;
34 class wxListEvent;
35 class Film;
36 class TimelineDialog;
37 class Ratio;
38 class Timecode;
39 class FilmEditorPanel;
40 class SubtitleContent;
41
42 /** @class FilmEditor
43  *  @brief A wx widget to edit a film's metadata, and perform various functions.
44  */
45 class FilmEditor : public wxPanel
46 {
47 public:
48         FilmEditor (boost::shared_ptr<Film>, wxWindow *);
49
50         void set_film (boost::shared_ptr<Film>);
51         void set_selection (boost::weak_ptr<Content>);
52
53         boost::signals2::signal<void (boost::filesystem::path)> FileChanged;
54
55         /* Stuff for panels */
56         
57         wxNotebook* content_notebook () const {
58                 return _content_notebook;
59         }
60
61         boost::shared_ptr<Film> film () const {
62                 return _film;
63         }
64
65         ContentList selected_content ();
66         VideoContentList selected_video_content ();
67         AudioContentList selected_audio_content ();
68         SubtitleContentList selected_subtitle_content ();
69         FFmpegContentList selected_ffmpeg_content ();
70         
71 private:
72         void make_dcp_panel ();
73         void make_content_panel ();
74         void connect_to_widgets ();
75         
76         /* Handle changes to the view */
77         void name_changed ();
78         void use_dci_name_toggled ();
79         void edit_dci_button_clicked ();
80         void content_selection_changed ();
81         void content_add_file_clicked ();
82         void content_add_folder_clicked ();
83         void content_remove_clicked ();
84         void content_earlier_clicked ();
85         void content_later_clicked ();
86         void container_changed ();
87         void dcp_content_type_changed ();
88         void scaler_changed ();
89         void j2k_bandwidth_changed ();
90         void frame_rate_changed ();
91         void best_frame_rate_clicked ();
92         void content_timeline_clicked ();
93         void audio_channels_changed ();
94         void resolution_changed ();
95         void sequence_video_changed ();
96         void content_right_click (wxListEvent &);
97         void three_d_changed ();
98         void standard_changed ();
99         void encrypted_toggled ();
100
101         /* Handle changes to the model */
102         void film_changed (Film::Property);
103         void film_content_changed (int);
104
105         void set_general_sensitivity (bool);
106         void setup_dcp_name ();
107         void setup_content ();
108         void setup_container ();
109         void setup_content_sensitivity ();
110         
111         void active_jobs_changed (bool);
112
113         FilmEditorPanel* _video_panel;
114         FilmEditorPanel* _audio_panel;
115         FilmEditorPanel* _subtitle_panel;
116         FilmEditorPanel* _timing_panel;
117         std::list<FilmEditorPanel *> _panels;
118
119         wxNotebook* _main_notebook;
120         wxNotebook* _content_notebook;
121         wxPanel* _dcp_panel;
122         wxSizer* _dcp_sizer;
123         wxPanel* _content_panel;
124         wxSizer* _content_sizer;
125
126         /** The film we are editing */
127         boost::shared_ptr<Film> _film;
128         wxTextCtrl* _name;
129         wxStaticText* _dcp_name;
130         wxCheckBox* _use_dci_name;
131         wxChoice* _container;
132         wxListCtrl* _content;
133         wxButton* _content_add_file;
134         wxButton* _content_add_folder;
135         wxButton* _content_remove;
136         wxButton* _content_earlier;
137         wxButton* _content_later;
138         wxButton* _content_timeline;
139         wxCheckBox* _sequence_video;
140         wxButton* _edit_dci_button;
141         wxChoice* _scaler;
142         wxSpinCtrl* _j2k_bandwidth;
143         wxChoice* _dcp_content_type;
144         wxChoice* _frame_rate;
145         wxSpinCtrl* _audio_channels;
146         wxButton* _best_frame_rate;
147         wxCheckBox* _three_d;
148         wxChoice* _resolution;
149         wxChoice* _standard;
150         wxCheckBox* _encrypted;
151
152         ContentMenu _menu;
153
154         std::vector<Ratio const *> _ratios;
155
156         bool _generally_sensitive;
157         TimelineDialog* _timeline_dialog;
158 };