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"
39 class FilmEditorPanel;
40 class SubtitleContent;
43 * @brief A wx widget to edit a film's metadata, and perform various functions.
45 class FilmEditor : public wxPanel
48 FilmEditor (boost::shared_ptr<Film>, wxWindow *);
50 void set_film (boost::shared_ptr<Film>);
51 void set_selection (boost::weak_ptr<Content>);
53 boost::signals2::signal<void (boost::filesystem::path)> FileChanged;
55 /* Stuff for panels */
57 wxNotebook* content_notebook () const {
58 return _content_notebook;
61 boost::shared_ptr<Film> film () const {
65 ContentList selected_content ();
66 VideoContentList selected_video_content ();
67 AudioContentList selected_audio_content ();
68 SubtitleContentList selected_subtitle_content ();
69 FFmpegContentList selected_ffmpeg_content ();
72 void make_dcp_panel ();
73 void make_content_panel ();
74 void connect_to_widgets ();
76 /* Handle changes to the view */
78 void use_isdcf_name_toggled ();
79 void edit_isdcf_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_choice_changed ();
91 void frame_rate_spin_changed ();
92 void best_frame_rate_clicked ();
93 void content_timeline_clicked ();
94 void audio_channels_changed ();
95 void resolution_changed ();
96 void sequence_video_changed ();
97 void content_right_click (wxListEvent &);
98 void three_d_changed ();
99 void standard_changed ();
100 void signed_toggled ();
101 void burn_subtitles_toggled ();
102 void encrypted_toggled ();
104 /* Handle changes to the model */
105 void film_changed (Film::Property);
106 void film_content_changed (int);
108 void set_general_sensitivity (bool);
109 void setup_dcp_name ();
110 void setup_content ();
111 void setup_container ();
112 void setup_content_sensitivity ();
113 void setup_frame_rate_widget ();
115 void active_jobs_changed (bool);
116 void config_changed ();
118 FilmEditorPanel* _video_panel;
119 FilmEditorPanel* _audio_panel;
120 FilmEditorPanel* _subtitle_panel;
121 FilmEditorPanel* _timing_panel;
122 std::list<FilmEditorPanel *> _panels;
124 wxNotebook* _main_notebook;
125 wxNotebook* _content_notebook;
128 wxPanel* _content_panel;
129 wxSizer* _content_sizer;
131 /** The film we are editing */
132 boost::shared_ptr<Film> _film;
134 wxStaticText* _dcp_name;
135 wxCheckBox* _use_isdcf_name;
136 wxChoice* _container;
137 wxListCtrl* _content;
138 wxButton* _content_add_file;
139 wxButton* _content_add_folder;
140 wxButton* _content_remove;
141 wxButton* _content_earlier;
142 wxButton* _content_later;
143 wxButton* _content_timeline;
144 wxCheckBox* _sequence_video;
145 wxButton* _edit_isdcf_button;
147 wxSpinCtrl* _j2k_bandwidth;
148 wxChoice* _dcp_content_type;
149 wxChoice* _frame_rate_choice;
150 wxSpinCtrl* _frame_rate_spin;
151 wxSizer* _frame_rate_sizer;
152 wxSpinCtrl* _audio_channels;
153 wxButton* _best_frame_rate;
154 wxCheckBox* _three_d;
155 wxChoice* _resolution;
158 wxCheckBox* _burn_subtitles;
159 wxCheckBox* _encrypted;
163 std::vector<Ratio const *> _ratios;
165 bool _generally_sensitive;
166 TimelineDialog* _timeline_dialog;