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"
28 #include <dcp/warnings.h>
29 LIBDCP_DISABLE_WARNINGS
31 LIBDCP_ENABLE_WARNINGS
32 #include <boost/signals2.hpp>
36 class ClosedCaptionsDialog;
53 class Controls : public wxPanel
59 bool editor_controls = true
62 virtual void set_film (std::shared_ptr<Film> film);
64 virtual void play () {};
65 virtual void stop () {};
66 void seek (int slider);
68 std::shared_ptr<Film> film () const;
70 void forward_frame ();
74 virtual void started ();
75 virtual void stopped ();
76 virtual void setup_sensitivity ();
77 virtual void config_changed (int property);
80 wxBoxSizer* _button_sizer;
81 std::shared_ptr<Film> _film;
82 MarkersPanel* _markers;
85 boost::optional<std::string> _active_job;
89 void update_position_label ();
90 void update_position_slider ();
91 void rewind_clicked (wxMouseEvent &);
92 void back_clicked (wxKeyboardState& s);
93 void forward_clicked (wxKeyboardState &);
94 void slider_moved (bool page);
95 void slider_released ();
96 void frame_number_clicked ();
97 void jump_to_selected_clicked ();
98 void timecode_clicked ();
99 void active_jobs_changed (boost::optional<std::string>);
100 dcpomatic::DCPTime nudge_amount (wxKeyboardState& ev);
101 void image_changed (std::weak_ptr<PlayerVideo>);
102 void outline_content_changed ();
104 void update_position ();
105 void film_change (ChangeType, Film::Property);
107 typedef std::pair<std::shared_ptr<dcp::CPL>, boost::filesystem::path> CPL;
109 bool _slider_being_moved = false;
111 CheckBox* _outline_content = nullptr;
112 wxChoice* _eye = nullptr;
113 CheckBox* _jump_to_selected = nullptr;
114 wxButton* _rewind_button;
115 wxButton* _back_button;
116 wxButton* _forward_button;
117 wxStaticText* _frame_number;
118 wxStaticText* _timecode;
120 ClosedCaptionsDialog* _closed_captions_dialog;
124 boost::signals2::scoped_connection _film_change_connection;
125 boost::signals2::scoped_connection _config_changed_connection;