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;
42 * @brief A wx widget to edit a film's metadata, and perform various functions.
44 class FilmEditor : public wxPanel
47 FilmEditor (boost::shared_ptr<Film>, wxWindow *);
49 void set_film (boost::shared_ptr<Film>);
50 void set_selection (boost::weak_ptr<Content>);
52 boost::signals2::signal<void (std::string)> FileChanged;
54 /* Stuff for panels */
56 wxNotebook* content_notebook () const {
57 return _content_notebook;
60 boost::shared_ptr<Film> film () const {
64 boost::shared_ptr<Content> selected_content ();
65 boost::shared_ptr<VideoContent> selected_video_content ();
66 boost::shared_ptr<AudioContent> selected_audio_content ();
67 boost::shared_ptr<SubtitleContent> selected_subtitle_content ();
70 void make_dcp_panel ();
71 void make_content_panel ();
72 void connect_to_widgets ();
74 /* Handle changes to the view */
75 void name_changed (wxCommandEvent &);
76 void use_dci_name_toggled (wxCommandEvent &);
77 void edit_dci_button_clicked (wxCommandEvent &);
78 void content_selection_changed (wxListEvent &);
79 void content_add_clicked (wxCommandEvent &);
80 void content_remove_clicked (wxCommandEvent &);
81 void container_changed (wxCommandEvent &);
82 void dcp_content_type_changed (wxCommandEvent &);
83 void scaler_changed (wxCommandEvent &);
84 void j2k_bandwidth_changed (wxCommandEvent &);
85 void dcp_frame_rate_changed (wxCommandEvent &);
86 void best_dcp_frame_rate_clicked (wxCommandEvent &);
87 void content_timeline_clicked (wxCommandEvent &);
88 void dcp_audio_channels_changed (wxCommandEvent &);
89 void dcp_resolution_changed (wxCommandEvent &);
90 void sequence_video_changed (wxCommandEvent &);
91 void content_right_click (wxListEvent &);
92 void dcp_3d_changed ();
94 /* Handle changes to the model */
95 void film_changed (Film::Property);
96 void film_content_changed (boost::weak_ptr<Content>, int);
98 void set_general_sensitivity (bool);
99 void setup_dcp_name ();
100 void setup_content ();
101 void setup_container ();
102 void setup_content_sensitivity ();
104 void active_jobs_changed (bool);
106 FilmEditorPanel* _video_panel;
107 FilmEditorPanel* _audio_panel;
108 FilmEditorPanel* _subtitle_panel;
109 FilmEditorPanel* _timing_panel;
110 std::list<FilmEditorPanel *> _panels;
112 wxNotebook* _main_notebook;
113 wxNotebook* _content_notebook;
116 wxPanel* _content_panel;
117 wxSizer* _content_sizer;
119 /** The film we are editing */
120 boost::shared_ptr<Film> _film;
122 wxStaticText* _dcp_name;
123 wxCheckBox* _use_dci_name;
124 wxChoice* _container;
125 wxListCtrl* _content;
126 wxButton* _content_add;
127 wxButton* _content_remove;
128 wxButton* _content_earlier;
129 wxButton* _content_later;
130 wxButton* _content_timeline;
131 wxCheckBox* _sequence_video;
132 wxButton* _edit_dci_button;
134 wxSpinCtrl* _j2k_bandwidth;
135 wxChoice* _dcp_content_type;
136 wxChoice* _dcp_frame_rate;
137 wxSpinCtrl* _dcp_audio_channels;
138 wxButton* _best_dcp_frame_rate;
140 wxChoice* _dcp_resolution;
144 std::vector<Ratio const *> _ratios;
146 bool _generally_sensitive;
147 TimelineDialog* _timeline_dialog;