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"
24 #include "lib/types.h"
25 #include <wx/splitter.h>
34 class wxSplitterWindow;
37 class ContentSubPanel;
46 class LimitedSplitter : public wxSplitterWindow
49 LimitedSplitter (wxWindow* parent);
51 bool OnSashPositionChange (int new_position)
53 /* Try to stop the top bit of the splitter getting so small that buttons disappear */
54 return new_position > 220;
57 void first_shown (wxWindow* top, wxWindow* bottom);
60 void sized (wxSizeEvent& ev);
63 int const _top_panel_minimum_size;
67 class ContentPanel : public boost::noncopyable
70 ContentPanel (wxNotebook *, std::shared_ptr<Film>, std::weak_ptr<FilmViewer> viewer);
72 std::shared_ptr<Film> film () const {
76 void set_film (std::shared_ptr<Film>);
77 void set_general_sensitivity (bool s);
78 void set_selection (std::weak_ptr<Content>);
79 void set_selection (ContentList cl);
82 void film_changed (Film::Property p);
83 void film_content_changed (int p);
87 wxWindow* window () const {
91 wxNotebook* notebook () const {
95 ContentList selected ();
96 ContentList selected_video ();
97 ContentList selected_audio ();
98 ContentList selected_text ();
99 FFmpegContentList selected_ffmpeg ();
101 void add_file_clicked ();
102 bool remove_clicked (bool hotkey);
103 void timeline_clicked ();
105 std::weak_ptr<FilmViewer> film_viewer () const {
109 boost::signals2::signal<void (void)> SelectionChanged;
112 void item_selected ();
113 void item_deselected ();
114 void item_deselected_idle ();
115 void check_selection ();
116 void add_folder_clicked ();
117 void add_dcp_clicked ();
118 void earlier_clicked ();
119 void later_clicked ();
120 void right_click (wxListEvent &);
121 void files_dropped (wxDropFilesEvent &);
124 void setup_sensitivity ();
126 void add_files (std::list<boost::filesystem::path>);
127 std::list<ContentSubPanel *> panels () const;
129 LimitedSplitter* _splitter;
131 wxNotebook* _notebook;
132 wxListCtrl* _content;
134 wxButton* _add_folder;
140 VideoPanel* _video_panel = nullptr;
141 AudioPanel* _audio_panel = nullptr;
142 TextPanel* _text_panel[static_cast<int>(TextType::COUNT)];
143 TimingPanel* _timing_panel;
145 TimelineDialog* _timeline_dialog = nullptr;
147 wxWindow* _last_selected_tab = nullptr;
149 std::shared_ptr<Film> _film;
150 std::weak_ptr<FilmViewer> _film_viewer;
151 bool _generally_sensitive;
152 bool _ignore_deselect;
153 bool _no_check_selection;