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/change_signaller.h"
27 #include "lib/dcpomatic_time.h"
28 #include "lib/film_property.h"
29 #include <dcp/warnings.h>
30 LIBDCP_DISABLE_WARNINGS
32 LIBDCP_ENABLE_WARNINGS
33 #include <boost/signals2.hpp>
37 class ClosedCaptionsDialog;
54 class Controls : public wxPanel
60 bool editor_controls = true
63 void set_film (std::shared_ptr<Film> film);
65 virtual void play () {};
66 virtual void stop () {};
67 void seek (int slider);
69 std::shared_ptr<Film> film () const;
71 void forward_frame ();
75 virtual void started ();
76 virtual void stopped ();
77 virtual void setup_sensitivity ();
78 virtual void config_changed (int property);
81 wxBoxSizer* _button_sizer;
82 std::shared_ptr<Film> _film;
83 MarkersPanel* _markers;
86 boost::optional<std::string> _active_job;
90 void update_position_label ();
91 void update_position_slider ();
92 void rewind_clicked (wxMouseEvent &);
93 void back_clicked (wxKeyboardState& s);
94 void forward_clicked (wxKeyboardState &);
95 void slider_moved (bool page);
96 void slider_released ();
97 void frame_number_clicked ();
98 void jump_to_selected_clicked ();
99 void timecode_clicked ();
100 void active_jobs_changed (boost::optional<std::string>);
101 dcpomatic::DCPTime nudge_amount (wxKeyboardState& ev);
102 void image_changed (std::weak_ptr<PlayerVideo>);
103 void outline_content_changed ();
105 void update_position ();
106 void film_change(ChangeType, FilmProperty);
108 typedef std::pair<std::shared_ptr<dcp::CPL>, boost::filesystem::path> CPL;
110 bool _slider_being_moved = false;
112 CheckBox* _outline_content = nullptr;
113 wxChoice* _eye = nullptr;
114 CheckBox* _jump_to_selected = nullptr;
115 wxButton* _rewind_button;
116 wxButton* _back_button;
117 wxButton* _forward_button;
118 wxStaticText* _frame_number;
119 wxStaticText* _timecode;
121 ClosedCaptionsDialog* _closed_captions_dialog;
125 boost::signals2::scoped_connection _film_change_connection;
126 boost::signals2::scoped_connection _config_changed_connection;