More automated renaming.
[dcpomatic.git] / src / wx / content_panel.h
1 /*
2     Copyright (C) 2012-2018 Carl Hetherington <cth@carlh.net>
3
4     This file is part of DCP-o-matic.
5
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.
10
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.
15
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/>.
18
19 */
20
21 #include <list>
22 #include <boost/shared_ptr.hpp>
23 #include "lib/types.h"
24 #include "lib/film.h"
25 #include "content_menu.h"
26
27 class wxNotebook;
28 class wxPanel;
29 class wxSizer;
30 class wxListCtrl;
31 class wxListEvent;
32 class TimelineDialog;
33 class FilmEditor;
34 class ContentSubPanel;
35 class TextPanel;
36 class AudioPanel;
37 class Film;
38 class FilmViewer;
39
40 class ContentPanel : public boost::noncopyable
41 {
42 public:
43         ContentPanel (wxNotebook *, boost::shared_ptr<Film>, FilmViewer* viewer);
44
45         boost::shared_ptr<Film> film () const {
46                 return _film;
47         }
48
49         void set_film (boost::shared_ptr<Film>);
50         void set_general_sensitivity (bool s);
51         void set_selection (boost::weak_ptr<Content>);
52         void set_selection (ContentList cl);
53
54         void film_changed (Film::Property p);
55         void film_content_changed (int p);
56
57         wxPanel* panel () const {
58                 return _panel;
59         }
60
61         wxNotebook* notebook () const {
62                 return _notebook;
63         }
64
65         ContentList selected ();
66         ContentList selected_video ();
67         ContentList selected_audio ();
68         ContentList selected_caption ();
69         FFmpegContentList selected_ffmpeg ();
70
71         void add_file_clicked ();
72         bool remove_clicked (bool hotkey);
73         void timeline_clicked ();
74
75         FilmViewer* film_viewer () const {
76                 return _film_viewer;
77         }
78
79         boost::signals2::signal<void (void)> SelectionChanged;
80
81 private:
82         void selection_changed ();
83         void add_folder_clicked ();
84         void add_dcp_clicked ();
85         void earlier_clicked ();
86         void later_clicked ();
87         void right_click (wxListEvent &);
88         void files_dropped (wxDropFilesEvent &);
89
90         void setup ();
91         void setup_sensitivity ();
92
93         void add_files (std::list<boost::filesystem::path>);
94
95         wxPanel* _panel;
96         wxSizer* _sizer;
97         wxNotebook* _notebook;
98         wxListCtrl* _content;
99         wxButton* _add_file;
100         wxButton* _add_folder;
101         wxButton* _add_dcp;
102         wxButton* _remove;
103         wxButton* _earlier;
104         wxButton* _later;
105         wxButton* _timeline;
106         ContentSubPanel* _video_panel;
107         AudioPanel* _audio_panel;
108         TextPanel* _caption_panel[CAPTION_COUNT];
109         ContentSubPanel* _timing_panel;
110         std::list<ContentSubPanel *> _panels;
111         ContentMenu* _menu;
112         TimelineDialog* _timeline_dialog;
113         wxNotebook* _parent;
114         ContentList _last_selected;
115         wxWindow* _last_selected_tab;
116
117         boost::shared_ptr<Film> _film;
118         FilmViewer* _film_viewer;
119         bool _generally_sensitive;
120 };