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"
25 #include "lib/types.h"
26 #include <dcp/warnings.h>
27 LIBDCP_DISABLE_WARNINGS
28 #include <wx/splitter.h>
29 LIBDCP_ENABLE_WARNINGS
34 class ContentSubPanel;
38 class LimitedSplitter;
48 class wxSplitterWindow;
54 ContentPanel(wxNotebook *, std::shared_ptr<Film>, FilmViewer& viewer);
56 ContentPanel (ContentPanel const&) = delete;
57 ContentPanel& operator= (ContentPanel const&) = delete;
59 std::shared_ptr<Film> film () const {
63 void set_film (std::shared_ptr<Film>);
64 void set_general_sensitivity (bool s);
65 void set_selection (std::weak_ptr<Content>);
66 void set_selection (ContentList cl);
69 void film_changed (Film::Property p);
70 void film_content_changed (int p);
74 wxWindow* window () const;
76 wxNotebook* notebook () const {
80 ContentList selected ();
81 ContentList selected_video ();
82 ContentList selected_audio ();
83 ContentList selected_text ();
84 FFmpegContentList selected_ffmpeg ();
86 void add_file_clicked ();
87 bool remove_clicked (bool hotkey);
88 void timeline_clicked ();
90 FilmViewer& film_viewer() const {
94 void add_files(std::vector<boost::filesystem::path> files);
95 void add_dcp(boost::filesystem::path dcp);
96 void add_folder(boost::filesystem::path folder);
98 boost::signals2::signal<void (void)> SelectionChanged;
101 void item_selected ();
102 void item_deselected ();
103 void item_deselected_idle ();
104 void check_selection ();
105 void add_folder_clicked ();
106 void add_dcp_clicked ();
107 void earlier_clicked ();
108 void later_clicked ();
109 void right_click (wxListEvent &);
110 void files_dropped (wxDropFilesEvent &);
113 void setup_sensitivity ();
114 void set_selected_state(int item, bool state);
116 std::list<ContentSubPanel *> panels () const;
118 LimitedSplitter* _splitter;
120 wxNotebook* _notebook;
121 wxListCtrl* _content;
123 wxButton* _add_folder;
129 VideoPanel* _video_panel = nullptr;
130 AudioPanel* _audio_panel = nullptr;
131 EnumIndexedVector<TextPanel*, TextType> _text_panel;
132 TimingPanel* _timing_panel;
134 TimelineDialog* _timeline_dialog = nullptr;
136 wxWindow* _last_selected_tab = nullptr;
138 std::shared_ptr<Film> _film;
139 FilmViewer& _film_viewer;
140 bool _generally_sensitive;
141 bool _ignore_deselect;
142 bool _no_check_selection;