Add simple copy and paste for content settings (#1051).
[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 AudioPanel;
36 class Film;
37 class FilmViewer;
38
39 class ContentPanel : public boost::noncopyable
40 {
41 public:
42         ContentPanel (wxNotebook *, boost::shared_ptr<Film>, FilmViewer* viewer);
43
44         boost::shared_ptr<Film> film () const {
45                 return _film;
46         }
47
48         void set_film (boost::shared_ptr<Film>);
49         void set_general_sensitivity (bool s);
50         void set_selection (boost::weak_ptr<Content>);
51         void set_selection (ContentList cl);
52
53         void film_changed (Film::Property p);
54         void film_content_changed (int p);
55
56         wxPanel* panel () const {
57                 return _panel;
58         }
59
60         wxNotebook* notebook () const {
61                 return _notebook;
62         }
63
64         ContentList selected ();
65         ContentList selected_video ();
66         ContentList selected_audio ();
67         ContentList selected_subtitle ();
68         FFmpegContentList selected_ffmpeg ();
69
70         void add_file_clicked ();
71         bool remove_clicked (bool hotkey);
72
73         boost::signals2::signal<void (void)> SelectionChanged;
74
75 private:
76         void selection_changed ();
77         void add_folder_clicked ();
78         void add_dcp_clicked ();
79         void earlier_clicked ();
80         void later_clicked ();
81         void right_click (wxListEvent &);
82         void files_dropped (wxDropFilesEvent &);
83         void timeline_clicked ();
84
85         void setup ();
86         void setup_sensitivity ();
87
88         void add_files (std::list<boost::filesystem::path>);
89
90         wxPanel* _panel;
91         wxSizer* _sizer;
92         wxNotebook* _notebook;
93         wxListCtrl* _content;
94         wxButton* _add_file;
95         wxButton* _add_folder;
96         wxButton* _add_dcp;
97         wxButton* _remove;
98         wxButton* _earlier;
99         wxButton* _later;
100         wxButton* _timeline;
101         ContentSubPanel* _video_panel;
102         AudioPanel* _audio_panel;
103         ContentSubPanel* _subtitle_panel;
104         ContentSubPanel* _timing_panel;
105         std::list<ContentSubPanel *> _panels;
106         ContentMenu* _menu;
107         TimelineDialog* _timeline_dialog;
108         wxNotebook* _parent;
109         ContentList _last_selected;
110
111         boost::shared_ptr<Film> _film;
112         FilmViewer* _film_viewer;
113         bool _generally_sensitive;
114 };