No-op; fix GPL address and use the explicit-program-name version.
[dcpomatic.git] / src / wx / content_panel.h
1 /*
2     Copyright (C) 2012-2016 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 Film;
36 class FilmViewer;
37
38 class ContentPanel : public boost::noncopyable
39 {
40 public:
41         ContentPanel (wxNotebook *, boost::shared_ptr<Film>, FilmViewer* viewer);
42
43         boost::shared_ptr<Film> film () const {
44                 return _film;
45         }
46
47         void set_film (boost::shared_ptr<Film>);
48         void set_general_sensitivity (bool s);
49         void set_selection (boost::weak_ptr<Content>);
50
51         void film_changed (Film::Property p);
52         void film_content_changed (int p);
53
54         wxPanel* panel () const {
55                 return _panel;
56         }
57
58         wxNotebook* notebook () const {
59                 return _notebook;
60         }
61
62         ContentList selected ();
63         ContentList selected_video ();
64         ContentList selected_audio ();
65         ContentList selected_subtitle ();
66         FFmpegContentList selected_ffmpeg ();
67
68         void add_file_clicked ();
69         bool remove_clicked (bool hotkey);
70
71 private:
72         void selection_changed ();
73         void add_folder_clicked ();
74         void earlier_clicked ();
75         void later_clicked ();
76         void right_click (wxListEvent &);
77         void files_dropped (wxDropFilesEvent &);
78         void timeline_clicked ();
79
80         void setup ();
81         void setup_sensitivity ();
82
83         void add_files (std::list<boost::filesystem::path>);
84
85         wxPanel* _panel;
86         wxSizer* _sizer;
87         wxNotebook* _notebook;
88         wxListCtrl* _content;
89         wxButton* _add_file;
90         wxButton* _add_folder;
91         wxButton* _remove;
92         wxButton* _earlier;
93         wxButton* _later;
94         wxButton* _timeline;
95         ContentSubPanel* _video_panel;
96         ContentSubPanel* _audio_panel;
97         ContentSubPanel* _subtitle_panel;
98         ContentSubPanel* _timing_panel;
99         std::list<ContentSubPanel *> _panels;
100         ContentMenu* _menu;
101         TimelineDialog* _timeline_dialog;
102         wxNotebook* _parent;
103         ContentList _last_selected;
104
105         boost::shared_ptr<Film> _film;
106         FilmViewer* _film_viewer;
107         bool _generally_sensitive;
108 };