Merge master.
[dcpomatic.git] / src / wx / content_panel.h
1 /*
2     Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
3
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.
8
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13
14     You should have received a copy of the GNU General Public License
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 */
19
20 #include <list>
21 #include <boost/shared_ptr.hpp>
22 #include "lib/types.h"
23 #include "lib/film.h"
24 #include "content_menu.h"
25
26 class wxNotebook;
27 class wxPanel;
28 class wxSizer;
29 class wxListCtrl;
30 class wxListEvent;
31 class TimelineDialog;
32 class FilmEditor;
33 class ContentSubPanel;
34 class Film;
35
36 class ContentPanel
37 {
38 public:
39         ContentPanel (wxNotebook *, boost::shared_ptr<Film>);
40
41         boost::shared_ptr<Film> film () const {
42                 return _film;
43         }
44
45         void set_film (boost::shared_ptr<Film> f);
46         void set_general_sensitivity (bool s);
47         void set_selection (boost::weak_ptr<Content>);
48
49         void film_changed (Film::Property p);
50         void film_content_changed (int p);
51
52         wxPanel* panel () const {
53                 return _panel;
54         }
55
56         wxNotebook* notebook () const {
57                 return _notebook;
58         }
59
60         ContentList selected ();
61         VideoContentList selected_video ();
62         AudioContentList selected_audio ();
63         SubtitleContentList selected_subtitle ();
64         FFmpegContentList selected_ffmpeg ();
65
66         void add_file_clicked ();
67         
68 private:        
69         void sequence_video_changed ();
70         void selection_changed ();
71         void add_folder_clicked ();
72         void remove_clicked ();
73         void earlier_clicked ();
74         void later_clicked ();
75         void right_click (wxListEvent &);
76         void files_dropped (wxDropFilesEvent &);
77         void timeline_clicked ();
78
79         void setup ();
80         void setup_sensitivity ();
81
82         wxPanel* _panel;
83         wxSizer* _sizer;
84         wxNotebook* _notebook;
85         wxListCtrl* _content;
86         wxButton* _add_file;
87         wxButton* _add_folder;
88         wxButton* _remove;
89         wxButton* _earlier;
90         wxButton* _later;
91         wxButton* _timeline;
92         wxCheckBox* _sequence_video;
93         ContentSubPanel* _video_panel;
94         ContentSubPanel* _audio_panel;
95         ContentSubPanel* _subtitle_panel;
96         ContentSubPanel* _timing_panel;
97         std::list<ContentSubPanel *> _panels;
98         ContentMenu* _menu;
99         TimelineDialog* _timeline_dialog;
100
101         boost::shared_ptr<Film> _film;
102         bool _generally_sensitive;
103 };