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"
29 #include <boost/shared_ptr.hpp>
30 #include <boost/signals2.hpp>
34 class ClosedCaptionsDialog;
45 class Controls : public wxPanel
50 boost::shared_ptr<FilmViewer>,
51 bool editor_controls = true
54 virtual void log (wxString) {}
55 virtual void set_film (boost::shared_ptr<Film> film);
56 boost::shared_ptr<Film> film () const;
58 void forward_frame ();
61 virtual void started ();
62 virtual void stopped ();
63 virtual void setup_sensitivity ();
64 virtual void config_changed (int property);
67 wxBoxSizer* _button_sizer;
68 boost::shared_ptr<Film> _film;
70 boost::shared_ptr<FilmViewer> _viewer;
71 boost::optional<std::string> _active_job;
75 void update_position_label ();
76 void update_position_slider ();
77 void rewind_clicked (wxMouseEvent &);
78 void back_clicked (wxKeyboardState& s);
79 void forward_clicked (wxKeyboardState &);
80 void slider_moved (bool page);
81 void slider_released ();
82 void frame_number_clicked ();
83 void jump_to_selected_clicked ();
84 void timecode_clicked ();
85 void active_jobs_changed (boost::optional<std::string>);
86 dcpomatic::DCPTime nudge_amount (wxKeyboardState& ev);
87 void image_changed (boost::weak_ptr<PlayerVideo>);
88 void outline_content_changed ();
90 void position_changed ();
91 void film_change (ChangeType, Film::Property);
93 typedef std::pair<boost::shared_ptr<dcp::CPL>, boost::filesystem::path> CPL;
95 bool _slider_being_moved;
96 bool _was_running_before_slider;
98 wxCheckBox* _outline_content;
100 wxCheckBox* _jump_to_selected;
101 wxButton* _rewind_button;
102 wxButton* _back_button;
103 wxButton* _forward_button;
104 wxStaticText* _frame_number;
105 wxStaticText* _timecode;
107 ClosedCaptionsDialog* _closed_captions_dialog;
109 boost::signals2::scoped_connection _film_change_connection;
110 boost::signals2::scoped_connection _config_changed_connection;