2 Copyright (C) 2012 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>
36 * @brief A wx widget to edit a film's metadata, and perform various functions.
38 class FilmEditor : public wxPanel
41 FilmEditor (boost::shared_ptr<Film>, wxWindow *);
43 void set_film (boost::shared_ptr<Film>);
44 void setup_visibility ();
46 boost::signals2::signal<void (std::string)> FileChanged;
49 void make_film_panel ();
50 void make_video_panel ();
51 void make_audio_panel ();
52 void make_subtitle_panel ();
53 void connect_to_widgets ();
55 /* Handle changes to the view */
56 void name_changed (wxCommandEvent &);
57 void use_dci_name_toggled (wxCommandEvent &);
58 void edit_dci_button_clicked (wxCommandEvent &);
59 void left_crop_changed (wxCommandEvent &);
60 void right_crop_changed (wxCommandEvent &);
61 void top_crop_changed (wxCommandEvent &);
62 void bottom_crop_changed (wxCommandEvent &);
63 void content_changed (wxCommandEvent &);
64 void format_changed (wxCommandEvent &);
65 void dcp_trim_start_changed (wxCommandEvent &);
66 void dcp_trim_end_changed (wxCommandEvent &);
67 void dcp_content_type_changed (wxCommandEvent &);
68 void dcp_ab_toggled (wxCommandEvent &);
69 void scaler_changed (wxCommandEvent &);
70 void audio_gain_changed (wxCommandEvent &);
71 void audio_gain_calculate_button_clicked (wxCommandEvent &);
72 void audio_delay_changed (wxCommandEvent &);
73 void with_subtitles_toggled (wxCommandEvent &);
74 void subtitle_offset_changed (wxCommandEvent &);
75 void subtitle_scale_changed (wxCommandEvent &);
76 void still_duration_changed (wxCommandEvent &);
77 void audio_stream_changed (wxCommandEvent &);
78 void subtitle_stream_changed (wxCommandEvent &);
80 /* Handle changes to the model */
81 void film_changed (Film::Property);
84 void edit_filters_clicked (wxCommandEvent &);
85 void change_dcp_range_clicked (wxCommandEvent &);
87 void set_things_sensitive (bool);
88 void setup_formats ();
89 void setup_subtitle_control_sensitivity ();
90 void setup_streams ();
91 void setup_audio_details ();
93 wxControl* video_control (wxControl *);
94 wxControl* still_control (wxControl *);
96 void active_jobs_changed (bool);
98 wxNotebook* _notebook;
100 wxSizer* _film_sizer;
101 wxPanel* _video_panel;
102 wxSizer* _video_sizer;
103 wxPanel* _audio_panel;
104 wxSizer* _audio_sizer;
105 wxPanel* _subtitle_panel;
106 wxSizer* _subtitle_sizer;
108 /** The film we are editing */
109 boost::shared_ptr<Film> _film;
110 /** The Film's name */
112 wxStaticText* _dcp_name;
113 wxCheckBox* _use_dci_name;
114 wxButton* _edit_dci_button;
115 /** The Film's format */
117 /** The Film's content file */
118 wxFilePickerCtrl* _content;
119 /** The Film's left crop */
120 wxSpinCtrl* _left_crop;
121 /** The Film's right crop */
122 wxSpinCtrl* _right_crop;
123 /** The Film's top crop */
124 wxSpinCtrl* _top_crop;
125 /** The Film's bottom crop */
126 wxSpinCtrl* _bottom_crop;
127 /** Currently-applied filters */
128 wxStaticText* _filters;
129 /** Button to open the filters dialogue */
130 wxButton* _filters_button;
131 /** The Film's scaler */
133 wxComboBox* _audio_stream;
134 /** The Film's audio gain */
135 wxSpinCtrl* _audio_gain;
136 /** A button to open the gain calculation dialogue */
137 wxButton* _audio_gain_calculate_button;
138 /** The Film's audio delay */
139 wxSpinCtrl* _audio_delay;
140 wxCheckBox* _with_subtitles;
141 wxComboBox* _subtitle_stream;
142 wxSpinCtrl* _subtitle_offset;
143 wxSpinCtrl* _subtitle_scale;
144 /** The Film's DCP content type */
145 wxComboBox* _dcp_content_type;
146 /** The Film's frames per second */
147 wxStaticText* _frames_per_second;
148 /** The Film's original size */
149 wxStaticText* _original_size;
150 /** The Film's length */
151 wxStaticText* _length;
152 /** The Film's audio details */
153 wxStaticText* _audio;
154 /** The Film's duration for still sources */
155 wxSpinCtrl* _still_duration;
157 wxSpinCtrl* _dcp_trim_start;
158 wxSpinCtrl* _dcp_trim_end;
159 /** Selector to generate an A/B comparison DCP */
162 std::list<wxControl*> _video_controls;
163 std::list<wxControl*> _still_controls;
165 std::vector<Format const *> _formats;
167 bool _generally_sensitive;