2 Copyright (C) 2012-2013 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 (std::string)> FileChanged;
55 /* Stuff for panels */
57 wxNotebook* content_notebook () const {
58 return _content_notebook;
61 boost::shared_ptr<Film> film () const {
65 boost::shared_ptr<Content> selected_content ();
66 boost::shared_ptr<VideoContent> selected_video_content ();
67 boost::shared_ptr<AudioContent> selected_audio_content ();
68 boost::shared_ptr<SubtitleContent> selected_subtitle_content ();
71 void make_dcp_panel ();
72 void make_content_panel ();
73 void connect_to_widgets ();
75 /* Handle changes to the view */
77 void use_dci_name_toggled ();
78 void edit_dci_button_clicked ();
79 void content_selection_changed ();
80 void content_add_file_clicked ();
81 void content_add_folder_clicked ();
82 void content_remove_clicked ();
83 void container_changed ();
84 void dcp_content_type_changed ();
85 void scaler_changed ();
86 void j2k_bandwidth_changed ();
87 void frame_rate_changed ();
88 void best_frame_rate_clicked ();
89 void content_timeline_clicked ();
90 void audio_channels_changed ();
91 void resolution_changed ();
92 void sequence_video_changed ();
93 void content_right_click (wxListEvent &);
94 void three_d_changed ();
95 void standard_changed ();
96 void encrypted_toggled ();
98 /* Handle changes to the model */
99 void film_changed (Film::Property);
100 void film_content_changed (boost::weak_ptr<Content>, int);
102 void set_general_sensitivity (bool);
103 void setup_dcp_name ();
104 void setup_content ();
105 void setup_container ();
106 void setup_content_sensitivity ();
108 void active_jobs_changed (bool);
110 FilmEditorPanel* _video_panel;
111 FilmEditorPanel* _audio_panel;
112 FilmEditorPanel* _subtitle_panel;
113 FilmEditorPanel* _timing_panel;
114 std::list<FilmEditorPanel *> _panels;
116 wxNotebook* _main_notebook;
117 wxNotebook* _content_notebook;
120 wxPanel* _content_panel;
121 wxSizer* _content_sizer;
123 /** The film we are editing */
124 boost::shared_ptr<Film> _film;
126 wxStaticText* _dcp_name;
127 wxCheckBox* _use_dci_name;
128 wxChoice* _container;
129 wxListCtrl* _content;
130 wxButton* _content_add_file;
131 wxButton* _content_add_folder;
132 wxButton* _content_remove;
133 wxButton* _content_earlier;
134 wxButton* _content_later;
135 wxButton* _content_timeline;
136 wxCheckBox* _sequence_video;
137 wxButton* _edit_dci_button;
139 wxSpinCtrl* _j2k_bandwidth;
140 wxChoice* _dcp_content_type;
141 wxChoice* _frame_rate;
142 wxSpinCtrl* _audio_channels;
143 wxButton* _best_frame_rate;
144 wxCheckBox* _three_d;
145 wxChoice* _resolution;
147 wxCheckBox* _encrypted;
151 std::vector<Ratio const *> _ratios;
153 bool _generally_sensitive;
154 TimelineDialog* _timeline_dialog;