swaroop: remove SPL editing from player UI.
[dcpomatic.git] / src / wx / controls.h
1 /*
2     Copyright (C) 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 "lib/dcpomatic_time.h"
22 #include "lib/types.h"
23 #include "lib/film.h"
24 #include <wx/wx.h>
25 #include <boost/shared_ptr.hpp>
26 #include <boost/signals2.hpp>
27
28 class FilmViewer;
29 class Film;
30 class ClosedCaptionsDialog;
31 class Content;
32 class PlayerVideo;
33 class wxToggleButton;
34 class wxListCtrl;
35 class ContentView;
36
37 namespace dcp {
38         class CPL;
39 }
40
41 class Controls : public wxPanel
42 {
43 public:
44         Controls (
45                 wxWindow* parent,
46                 boost::shared_ptr<FilmViewer>,
47                 bool editor_controls = true
48                 );
49
50         boost::shared_ptr<Film> film () const;
51         void back_frame ();
52         void forward_frame ();
53
54         void show_extended_player_controls (bool s);
55         void log (wxString s);
56
57 private:
58         void update_position_label ();
59         void update_position_slider ();
60         void rewind_clicked (wxMouseEvent &);
61         void back_clicked (wxKeyboardState& s);
62         void forward_clicked (wxKeyboardState &);
63         void slider_moved (bool page);
64         void slider_released ();
65         void play_clicked ();
66         void frame_number_clicked ();
67         void jump_to_selected_clicked ();
68         void setup_sensitivity ();
69         void timecode_clicked ();
70 #ifndef DCPOMATIC_PLAYER_SWAROOP
71         void check_play_state ();
72 #endif
73         void active_jobs_changed (boost::optional<std::string>);
74         DCPTime nudge_amount (wxKeyboardState& ev);
75         void image_changed (boost::weak_ptr<PlayerVideo>);
76         void film_change (ChangeType type, Film::Property p);
77         void outline_content_changed ();
78         void eye_changed ();
79         void position_changed ();
80         void started ();
81         void stopped ();
82         void film_changed ();
83         void update_content_directory ();
84         void update_playlist_directory ();
85         void config_changed (int property);
86
87         typedef std::pair<boost::shared_ptr<dcp::CPL>, boost::filesystem::path> CPL;
88
89 #ifdef DCPOMATIC_VARIANT_SWAROOP
90         void pause_clicked ();
91         void stop_clicked ();
92 #endif
93         void add_playlist_to_list (boost::shared_ptr<Film> film);
94
95         boost::shared_ptr<Film> _film;
96         boost::shared_ptr<FilmViewer> _viewer;
97
98         wxSizer* _v_sizer;
99         bool _slider_being_moved;
100         bool _was_running_before_slider;
101
102         wxCheckBox* _outline_content;
103         wxChoice* _eye;
104         wxCheckBox* _jump_to_selected;
105         ContentView* _content_view;
106         wxListCtrl* _spl_view;
107         wxListCtrl* _current_spl_view;
108         wxTextCtrl* _log;
109         std::vector<boost::shared_ptr<Film> > _playlists;
110         wxSlider* _slider;
111         wxButton* _rewind_button;
112         wxButton* _back_button;
113         wxButton* _forward_button;
114         wxStaticText* _frame_number;
115         wxStaticText* _timecode;
116 #ifdef DCPOMATIC_VARIANT_SWAROOP
117         wxButton* _play_button;
118         wxButton* _pause_button;
119         wxButton* _stop_button;
120 #else
121         wxToggleButton* _play_button;
122 #endif
123         boost::optional<std::string> _active_job;
124
125         ClosedCaptionsDialog* _closed_captions_dialog;
126
127 #ifdef DCPOMATIC_VARIANT_SWAROOP
128         boost::optional<dcp::ContentKind> _current_kind;
129 #endif
130
131         boost::signals2::scoped_connection _config_changed_connection;
132 };