2 Copyright (C) 2018 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/>.
21 #ifndef DCPOMATIC_CONTROLS_H
22 #define DCPOMATIC_CONTROLS_H
24 #include "lib/dcpomatic_time.h"
25 #include "lib/types.h"
27 #include "lib/warnings.h"
28 DCPOMATIC_DISABLE_WARNINGS
30 DCPOMATIC_ENABLE_WARNINGS
31 #include <boost/shared_ptr.hpp>
32 #include <boost/signals2.hpp>
36 class ClosedCaptionsDialog;
47 class Controls : public wxPanel
52 boost::shared_ptr<FilmViewer>,
53 bool editor_controls = true
56 virtual void log (wxString) {}
57 virtual void set_film (boost::shared_ptr<Film> film);
59 virtual void play () {};
60 virtual void stop () {};
61 void seek (int slider);
63 boost::shared_ptr<Film> film () const;
65 void forward_frame ();
68 virtual void started ();
69 virtual void stopped ();
70 virtual void setup_sensitivity ();
71 virtual void config_changed (int property);
74 wxBoxSizer* _button_sizer;
75 boost::shared_ptr<Film> _film;
77 boost::shared_ptr<FilmViewer> _viewer;
78 boost::optional<std::string> _active_job;
82 void update_position_label ();
83 void update_position_slider ();
84 void rewind_clicked (wxMouseEvent &);
85 void back_clicked (wxKeyboardState& s);
86 void forward_clicked (wxKeyboardState &);
87 void slider_moved (bool page);
88 void slider_released ();
89 void frame_number_clicked ();
90 void jump_to_selected_clicked ();
91 void timecode_clicked ();
92 void active_jobs_changed (boost::optional<std::string>);
93 dcpomatic::DCPTime nudge_amount (wxKeyboardState& ev);
94 void image_changed (boost::weak_ptr<PlayerVideo>);
95 void outline_content_changed ();
97 void update_position ();
98 void film_change (ChangeType, Film::Property);
100 typedef std::pair<boost::shared_ptr<dcp::CPL>, boost::filesystem::path> CPL;
102 bool _slider_being_moved;
104 wxCheckBox* _outline_content;
106 wxCheckBox* _jump_to_selected;
107 wxButton* _rewind_button;
108 wxButton* _back_button;
109 wxButton* _forward_button;
110 wxStaticText* _frame_number;
111 wxStaticText* _timecode;
113 ClosedCaptionsDialog* _closed_captions_dialog;
117 boost::signals2::scoped_connection _film_change_connection;
118 boost::signals2::scoped_connection _config_changed_connection;