2 Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
4 This file is part of DCP-o-matic.
6 DCP-o-matic is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 DCP-o-matic is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
22 #include "content_menu.h"
23 #include "lib/enum_indexed_vector.h"
24 #include "lib/film_property.h"
25 #include "lib/text_type.h"
26 #include <dcp/warnings.h>
27 LIBDCP_DISABLE_WARNINGS
28 #include <wx/splitter.h>
29 LIBDCP_ENABLE_WARNINGS
34 class ContentListCtrl;
35 class ContentSubPanel;
39 class LimitedContentPanelSplitter;
49 class wxSplitterWindow;
55 ContentPanel(wxNotebook *, std::shared_ptr<Film>, FilmViewer& viewer);
57 ContentPanel (ContentPanel const&) = delete;
58 ContentPanel& operator= (ContentPanel const&) = delete;
60 std::shared_ptr<Film> film () const {
64 void set_film (std::shared_ptr<Film>);
65 void set_general_sensitivity (bool s);
66 void set_selection (std::weak_ptr<Content>);
67 void set_selection (ContentList cl);
70 void film_changed(FilmProperty p);
71 void film_content_changed (int p);
75 wxWindow* window () const;
77 wxNotebook* notebook () const {
81 ContentList selected ();
82 ContentList selected_video ();
83 ContentList selected_audio ();
84 ContentList selected_text ();
85 FFmpegContentList selected_ffmpeg ();
87 void add_file_clicked ();
88 bool remove_clicked (bool hotkey);
89 void timeline_clicked ();
91 FilmViewer& film_viewer() const {
95 void add_files(std::vector<boost::filesystem::path> files);
96 void add_dcp(boost::filesystem::path dcp);
97 void add_folder(boost::filesystem::path folder);
99 boost::signals2::signal<void (void)> SelectionChanged;
102 void item_selected ();
103 void item_deselected ();
104 void item_deselected_idle ();
105 void check_selection ();
106 void add_folder_clicked ();
107 void add_dcp_clicked ();
108 void earlier_clicked ();
109 void later_clicked ();
110 void right_click (wxListEvent &);
111 void files_dropped (wxDropFilesEvent &);
114 void setup_sensitivity ();
115 void set_selected_state(int item, bool state);
117 std::list<ContentSubPanel *> panels () const;
119 LimitedContentPanelSplitter* _splitter;
121 wxNotebook* _notebook;
122 ContentListCtrl* _content;
124 wxButton* _add_folder;
130 VideoPanel* _video_panel = nullptr;
131 AudioPanel* _audio_panel = nullptr;
132 EnumIndexedVector<TextPanel*, TextType> _text_panel;
133 TimingPanel* _timing_panel;
135 wx_ptr<TimelineDialog> _timeline_dialog;
137 wxWindow* _last_selected_tab = nullptr;
139 std::shared_ptr<Film> _film;
140 FilmViewer& _film_viewer;
141 bool _generally_sensitive;
142 bool _ignore_deselect;
143 bool _no_check_selection;