Remove player activity logging. Fixes #2122.
[dcpomatic.git] / src / wx / controls.h
1 /*
2     Copyright (C) 2018-2021 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
22 #ifndef DCPOMATIC_CONTROLS_H
23 #define DCPOMATIC_CONTROLS_H
24
25
26 #include "lib/dcpomatic_time.h"
27 #include "lib/types.h"
28 #include "lib/film.h"
29 #include "lib/warnings.h"
30 DCPOMATIC_DISABLE_WARNINGS
31 #include <wx/wx.h>
32 DCPOMATIC_ENABLE_WARNINGS
33 #include <boost/signals2.hpp>
34
35
36 class FilmViewer;
37 class Film;
38 class ClosedCaptionsDialog;
39 class Content;
40 class PlayerVideo;
41 class wxToggleButton;
42 class wxListCtrl;
43 class ContentView;
44
45
46 namespace dcp {
47         class CPL;
48 }
49
50
51 class Controls : public wxPanel
52 {
53 public:
54         Controls (
55                 wxWindow* parent,
56                 std::shared_ptr<FilmViewer>,
57                 bool editor_controls = true
58                 );
59
60         virtual void set_film (std::shared_ptr<Film> film);
61
62         virtual void play () {};
63         virtual void stop () {};
64         void seek (int slider);
65
66         std::shared_ptr<Film> film () const;
67         void back_frame ();
68         void forward_frame ();
69
70 protected:
71
72         virtual void started ();
73         virtual void stopped ();
74         virtual void setup_sensitivity ();
75         virtual void config_changed (int property);
76
77         wxSizer* _v_sizer;
78         wxBoxSizer* _button_sizer;
79         std::shared_ptr<Film> _film;
80         wxSlider* _slider;
81         std::weak_ptr<FilmViewer> _viewer;
82         boost::optional<std::string> _active_job;
83
84 private:
85
86         void update_position_label ();
87         void update_position_slider ();
88         void rewind_clicked (wxMouseEvent &);
89         void back_clicked (wxKeyboardState& s);
90         void forward_clicked (wxKeyboardState &);
91         void slider_moved (bool page);
92         void slider_released ();
93         void frame_number_clicked ();
94         void jump_to_selected_clicked ();
95         void timecode_clicked ();
96         void active_jobs_changed (boost::optional<std::string>);
97         dcpomatic::DCPTime nudge_amount (wxKeyboardState& ev);
98         void image_changed (std::weak_ptr<PlayerVideo>);
99         void outline_content_changed ();
100         void eye_changed ();
101         void update_position ();
102         void film_change (ChangeType, Film::Property);
103
104         typedef std::pair<std::shared_ptr<dcp::CPL>, boost::filesystem::path> CPL;
105
106         bool _slider_being_moved;
107
108         wxCheckBox* _outline_content;
109         wxChoice* _eye;
110         wxCheckBox* _jump_to_selected;
111         wxButton* _rewind_button;
112         wxButton* _back_button;
113         wxButton* _forward_button;
114         wxStaticText* _frame_number;
115         wxStaticText* _timecode;
116
117         ClosedCaptionsDialog* _closed_captions_dialog;
118
119         wxTimer _timer;
120
121         boost::signals2::scoped_connection _film_change_connection;
122         boost::signals2::scoped_connection _config_changed_connection;
123 };
124
125
126 #endif