2 Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
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.
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.
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.
20 /** @file src/film_editor.h
21 * @brief A wx widget to edit a film's metadata, and perform various functions.
25 #include <wx/spinctrl.h>
26 #include <wx/filepicker.h>
27 #include <wx/collpane.h>
28 #include <boost/signals2.hpp>
30 #include "content_menu.h"
40 class FilmEditorPanel;
41 class SubtitleContent;
44 * @brief A wx widget to edit a film's metadata, and perform various functions.
46 class FilmEditor : public wxPanel
49 FilmEditor (wxWindow *);
51 void set_film (boost::shared_ptr<Film>);
52 void set_selection (boost::weak_ptr<Content>);
54 boost::signals2::signal<void (boost::filesystem::path)> FileChanged;
56 /* Stuff for panels */
58 wxNotebook* content_notebook () const {
59 return _content_notebook;
62 boost::shared_ptr<Film> film () const {
66 ContentList selected_content ();
67 VideoContentList selected_video_content ();
68 AudioContentList selected_audio_content ();
69 SubtitleContentList selected_subtitle_content ();
70 FFmpegContentList selected_ffmpeg_content ();
72 void content_add_file_clicked ();
75 void make_dcp_panel ();
76 void make_content_panel ();
77 void connect_to_widgets ();
79 /* Handle changes to the view */
81 void use_isdcf_name_toggled ();
82 void edit_isdcf_button_clicked ();
83 void content_selection_changed ();
84 void content_add_folder_clicked ();
85 void content_remove_clicked ();
86 void content_earlier_clicked ();
87 void content_later_clicked ();
88 void content_files_dropped (wxDropFilesEvent& event);
89 void container_changed ();
90 void dcp_content_type_changed ();
91 void scaler_changed ();
92 void j2k_bandwidth_changed ();
93 void frame_rate_choice_changed ();
94 void frame_rate_spin_changed ();
95 void best_frame_rate_clicked ();
96 void content_timeline_clicked ();
97 void audio_channels_changed ();
98 void resolution_changed ();
99 void sequence_video_changed ();
100 void content_right_click (wxListEvent &);
101 void three_d_changed ();
102 void standard_changed ();
103 void signed_toggled ();
104 void encrypted_toggled ();
106 /* Handle changes to the model */
107 void film_changed (Film::Property);
108 void film_content_changed (int);
109 void use_isdcf_name_changed ();
111 void set_general_sensitivity (bool);
112 void setup_dcp_name ();
113 void setup_content ();
114 void setup_container ();
115 void setup_content_sensitivity ();
116 void setup_frame_rate_widget ();
118 void active_jobs_changed (bool);
119 void config_changed ();
121 FilmEditorPanel* _video_panel;
122 FilmEditorPanel* _audio_panel;
123 FilmEditorPanel* _subtitle_panel;
124 FilmEditorPanel* _timing_panel;
125 std::list<FilmEditorPanel *> _panels;
127 wxNotebook* _main_notebook;
128 wxNotebook* _content_notebook;
131 wxPanel* _content_panel;
132 wxSizer* _content_sizer;
134 /** The film we are editing */
135 boost::shared_ptr<Film> _film;
137 wxStaticText* _dcp_name;
138 wxCheckBox* _use_isdcf_name;
139 wxChoice* _container;
140 wxListCtrl* _content;
141 wxButton* _content_add_file;
142 wxButton* _content_add_folder;
143 wxButton* _content_remove;
144 wxButton* _content_earlier;
145 wxButton* _content_later;
146 wxButton* _content_timeline;
147 wxCheckBox* _sequence_video;
148 wxButton* _edit_isdcf_button;
150 wxSpinCtrl* _j2k_bandwidth;
151 wxChoice* _dcp_content_type;
152 wxChoice* _frame_rate_choice;
153 wxSpinCtrl* _frame_rate_spin;
154 wxSizer* _frame_rate_sizer;
155 wxSpinCtrl* _audio_channels;
156 wxButton* _best_frame_rate;
157 wxCheckBox* _three_d;
158 wxChoice* _resolution;
161 wxCheckBox* _encrypted;
165 std::vector<Ratio const *> _ratios;
167 bool _generally_sensitive;
168 TimelineDialog* _timeline_dialog;