Separate Controls into standard/swaroop.
[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 #ifndef DCPOMATIC_CONTROLS_H
22 #define DCPOMATIC_CONTROLS_H
23
24 #include "lib/dcpomatic_time.h"
25 #include "lib/types.h"
26 #include "lib/film.h"
27 #include "lib/spl.h"
28 #include <wx/wx.h>
29 #include <boost/shared_ptr.hpp>
30 #include <boost/signals2.hpp>
31
32 class FilmViewer;
33 class Film;
34 class ClosedCaptionsDialog;
35 class Content;
36 class PlayerVideo;
37 class wxToggleButton;
38 class wxListCtrl;
39 class ContentView;
40
41 namespace dcp {
42         class CPL;
43 }
44
45 class Controls : public wxPanel
46 {
47 public:
48         Controls (
49                 wxWindow* parent,
50                 boost::shared_ptr<FilmViewer>,
51                 bool editor_controls = true
52                 );
53
54         virtual void set_film (boost::shared_ptr<Film> film);
55         boost::shared_ptr<Film> film () const;
56         void back_frame ();
57         void forward_frame ();
58
59 protected:
60         virtual void started ();
61         virtual void stopped ();
62         virtual void setup_sensitivity ();
63         virtual void config_changed (int property);
64
65         wxSizer* _v_sizer;
66         wxBoxSizer* _button_sizer;
67         boost::shared_ptr<Film> _film;
68         wxSlider* _slider;
69         boost::shared_ptr<FilmViewer> _viewer;
70         boost::optional<std::string> _active_job;
71
72 private:
73
74         void update_position_label ();
75         void update_position_slider ();
76         void rewind_clicked (wxMouseEvent &);
77         void back_clicked (wxKeyboardState& s);
78         void forward_clicked (wxKeyboardState &);
79         void slider_moved (bool page);
80         void slider_released ();
81         void frame_number_clicked ();
82         void jump_to_selected_clicked ();
83         void timecode_clicked ();
84         void active_jobs_changed (boost::optional<std::string>);
85         DCPTime nudge_amount (wxKeyboardState& ev);
86         void image_changed (boost::weak_ptr<PlayerVideo>);
87         void outline_content_changed ();
88         void eye_changed ();
89         void position_changed ();
90
91         typedef std::pair<boost::shared_ptr<dcp::CPL>, boost::filesystem::path> CPL;
92
93         bool _slider_being_moved;
94         bool _was_running_before_slider;
95
96         wxCheckBox* _outline_content;
97         wxChoice* _eye;
98         wxCheckBox* _jump_to_selected;
99         wxButton* _rewind_button;
100         wxButton* _back_button;
101         wxButton* _forward_button;
102         wxStaticText* _frame_number;
103         wxStaticText* _timecode;
104
105         ClosedCaptionsDialog* _closed_captions_dialog;
106
107         boost::signals2::scoped_connection _config_changed_connection;
108 };
109
110 #endif