2 Copyright (C) 2012-2019 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/>.
21 #include "content_menu.h"
22 #include "lib/types.h"
24 #include <wx/splitter.h>
25 #include <boost/shared_ptr.hpp>
33 class wxSplitterWindow;
36 class ContentSubPanel;
45 class LimitedSplitter : public wxSplitterWindow
48 LimitedSplitter (wxWindow* parent);
50 bool OnSashPositionChange (int new_position)
52 /* Try to stop the top bit of the splitter getting so small that buttons disappear */
53 return new_position > 220;
56 void first_shown (wxWindow* top, wxWindow* bottom);
60 class ContentPanel : public boost::noncopyable
63 ContentPanel (wxNotebook *, boost::shared_ptr<Film>, boost::weak_ptr<FilmViewer> viewer);
65 boost::shared_ptr<Film> film () const {
69 void set_film (boost::shared_ptr<Film>);
70 void set_general_sensitivity (bool s);
71 void set_selection (boost::weak_ptr<Content>);
72 void set_selection (ContentList cl);
74 void film_changed (Film::Property p);
75 void film_content_changed (int p);
79 wxWindow* window () const {
83 wxNotebook* notebook () const {
87 ContentList selected ();
88 ContentList selected_video ();
89 ContentList selected_audio ();
90 ContentList selected_text ();
91 FFmpegContentList selected_ffmpeg ();
93 void add_file_clicked ();
94 bool remove_clicked (bool hotkey);
95 void timeline_clicked ();
97 boost::weak_ptr<FilmViewer> film_viewer () const {
101 boost::signals2::signal<void (void)> SelectionChanged;
104 void item_selected ();
105 void item_deselected ();
106 void item_deselected_idle ();
107 void check_selection ();
108 void add_folder_clicked ();
109 void add_dcp_clicked ();
110 void earlier_clicked ();
111 void later_clicked ();
112 void right_click (wxListEvent &);
113 void files_dropped (wxDropFilesEvent &);
116 void setup_sensitivity ();
118 void add_files (std::list<boost::filesystem::path>);
119 std::list<ContentSubPanel *> panels () const;
121 LimitedSplitter* _splitter;
123 wxNotebook* _notebook;
124 wxListCtrl* _content;
126 wxButton* _add_folder;
132 VideoPanel* _video_panel;
133 AudioPanel* _audio_panel;
134 TextPanel* _text_panel[TEXT_COUNT];
135 TimingPanel* _timing_panel;
137 TimelineDialog* _timeline_dialog;
139 wxWindow* _last_selected_tab;
141 boost::shared_ptr<Film> _film;
142 boost::weak_ptr<FilmViewer> _film_viewer;
143 bool _generally_sensitive;
144 bool _ignore_deselect;
145 bool _no_check_selection;