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 log (wxString) {}
61 virtual void set_film (std::shared_ptr<Film> film);
63 virtual void play () {};
64 virtual void stop () {};
65 void seek (int slider);
67 std::shared_ptr<Film> film () const;
69 void forward_frame ();
73 virtual void started ();
74 virtual void stopped ();
75 virtual void setup_sensitivity ();
76 virtual void config_changed (int property);
79 wxBoxSizer* _button_sizer;
80 std::shared_ptr<Film> _film;
82 std::shared_ptr<FilmViewer> _viewer;
83 boost::optional<std::string> _active_job;
87 void update_position_label ();
88 void update_position_slider ();
89 void rewind_clicked (wxMouseEvent &);
90 void back_clicked (wxKeyboardState& s);
91 void forward_clicked (wxKeyboardState &);
92 void slider_moved (bool page);
93 void slider_released ();
94 void frame_number_clicked ();
95 void jump_to_selected_clicked ();
96 void timecode_clicked ();
97 void active_jobs_changed (boost::optional<std::string>);
98 dcpomatic::DCPTime nudge_amount (wxKeyboardState& ev);
99 void image_changed (std::weak_ptr<PlayerVideo>);
100 void outline_content_changed ();
102 void update_position ();
103 void film_change (ChangeType, Film::Property);
105 typedef std::pair<std::shared_ptr<dcp::CPL>, boost::filesystem::path> CPL;
107 bool _slider_being_moved;
109 wxCheckBox* _outline_content;
111 wxCheckBox* _jump_to_selected;
112 wxButton* _rewind_button;
113 wxButton* _back_button;
114 wxButton* _forward_button;
115 wxStaticText* _frame_number;
116 wxStaticText* _timecode;
118 ClosedCaptionsDialog* _closed_captions_dialog;
122 boost::signals2::scoped_connection _film_change_connection;
123 boost::signals2::scoped_connection _config_changed_connection;