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 "lib/trim_action.h"
34 * @brief A wx widget to edit a film's metadata, and perform various functions.
36 class FilmEditor : public wxPanel
39 FilmEditor (Film *, wxWindow *);
41 void set_film (Film *);
42 void setup_visibility ();
44 sigc::signal1<void, std::string> FileChanged;
47 /* Handle changes to the view */
48 void name_changed (wxCommandEvent &);
49 void use_dci_name_toggled (wxCommandEvent &);
50 void edit_dci_button_clicked (wxCommandEvent &);
51 void left_crop_changed (wxCommandEvent &);
52 void right_crop_changed (wxCommandEvent &);
53 void top_crop_changed (wxCommandEvent &);
54 void bottom_crop_changed (wxCommandEvent &);
55 void content_changed (wxCommandEvent &);
56 void format_changed (wxCommandEvent &);
57 void dcp_range_changed (int, TrimAction);
58 void dcp_content_type_changed (wxCommandEvent &);
59 void dcp_ab_toggled (wxCommandEvent &);
60 void scaler_changed (wxCommandEvent &);
61 void audio_gain_changed (wxCommandEvent &);
62 void audio_gain_calculate_button_clicked (wxCommandEvent &);
63 void audio_delay_changed (wxCommandEvent &);
64 void with_subtitles_toggled (wxCommandEvent &);
65 void subtitle_offset_changed (wxCommandEvent &);
66 void subtitle_scale_changed (wxCommandEvent &);
67 void still_duration_changed (wxCommandEvent &);
68 void audio_stream_changed (wxCommandEvent &);
69 void subtitle_stream_changed (wxCommandEvent &);
71 /* Handle changes to the model */
72 void film_changed (Film::Property);
75 void edit_filters_clicked (wxCommandEvent &);
76 void change_dcp_range_clicked (wxCommandEvent &);
78 void set_things_sensitive (bool);
79 void setup_formats ();
80 void setup_subtitle_button ();
81 void setup_streams ();
82 void setup_audio_details ();
84 wxControl* video_control (wxControl *);
85 wxControl* still_control (wxControl *);
87 Film::Property _ignore_changes;
89 /** The film we are editing */
91 /** The Film's name */
93 wxStaticText* _dcp_name;
94 wxCheckBox* _use_dci_name;
95 wxButton* _edit_dci_button;
96 /** The Film's format */
98 /** The Film's content file */
99 wxFilePickerCtrl* _content;
100 /** The Film's left crop */
101 wxSpinCtrl* _left_crop;
102 /** The Film's right crop */
103 wxSpinCtrl* _right_crop;
104 /** The Film's top crop */
105 wxSpinCtrl* _top_crop;
106 /** The Film's bottom crop */
107 wxSpinCtrl* _bottom_crop;
108 /** Currently-applied filters */
109 wxStaticText* _filters;
110 /** Button to open the filters dialogue */
111 wxButton* _filters_button;
112 /** The Film's scaler */
114 wxComboBox* _audio_stream;
115 /** The Film's audio gain */
116 wxSpinCtrl* _audio_gain;
117 /** A button to open the gain calculation dialogue */
118 wxButton* _audio_gain_calculate_button;
119 /** The Film's audio delay */
120 wxSpinCtrl* _audio_delay;
121 wxCheckBox* _with_subtitles;
122 wxComboBox* _subtitle_stream;
123 wxSpinCtrl* _subtitle_offset;
124 wxSpinCtrl* _subtitle_scale;
125 /** The Film's DCP content type */
126 wxComboBox* _dcp_content_type;
127 /** The Film's frames per second */
128 wxStaticText* _frames_per_second;
129 /** The Film's original size */
130 wxStaticText* _original_size;
131 /** The Film's length */
132 wxStaticText* _length;
133 /** The Film's audio details */
134 wxStaticText* _audio;
135 /** The Film's duration for still sources */
136 wxSpinCtrl* _still_duration;
138 /** Display of the range of frames that will be used */
139 wxStaticText* _dcp_range;
140 /** Button to change the range */
141 wxButton* _change_dcp_range_button;
142 /** Selector to generate an A/B comparison DCP */
145 std::list<wxControl*> _video_controls;
146 std::list<wxControl*> _still_controls;
148 std::vector<Format const *> _formats;