2 Copyright (C) 2018-2021 Carl Hetherington <cth@carlh.net>
4 This file is part of DCP-o-matic.
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.
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.
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/>.
22 #ifndef DCPOMATIC_CONTROLS_H
23 #define DCPOMATIC_CONTROLS_H
26 #include "lib/dcpomatic_time.h"
27 #include "lib/types.h"
29 #include "lib/warnings.h"
30 DCPOMATIC_DISABLE_WARNINGS
32 DCPOMATIC_ENABLE_WARNINGS
33 #include <boost/signals2.hpp>
38 class ClosedCaptionsDialog;
51 class Controls : public wxPanel
56 std::shared_ptr<FilmViewer>,
57 bool editor_controls = true
60 virtual void set_film (std::shared_ptr<Film> film);
62 virtual void play () {};
63 virtual void stop () {};
64 void seek (int slider);
66 std::shared_ptr<Film> film () const;
68 void forward_frame ();
72 virtual void started ();
73 virtual void stopped ();
74 virtual void setup_sensitivity ();
75 virtual void config_changed (int property);
78 wxBoxSizer* _button_sizer;
79 std::shared_ptr<Film> _film;
81 std::weak_ptr<FilmViewer> _viewer;
82 boost::optional<std::string> _active_job;
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 ();
101 void update_position ();
102 void film_change (ChangeType, Film::Property);
104 typedef std::pair<std::shared_ptr<dcp::CPL>, boost::filesystem::path> CPL;
106 bool _slider_being_moved;
108 wxCheckBox* _outline_content;
110 wxCheckBox* _jump_to_selected;
111 wxButton* _rewind_button;
112 wxButton* _back_button;
113 wxButton* _forward_button;
114 wxStaticText* _frame_number;
115 wxStaticText* _timecode;
117 ClosedCaptionsDialog* _closed_captions_dialog;
121 boost::signals2::scoped_connection _film_change_connection;
122 boost::signals2::scoped_connection _config_changed_connection;