2 Copyright (C) 2012-2016 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 /** @file src/film_viewer.h
22 * @brief A wx widget to view `thumbnails' of a Film.
31 class RGBPlusAlphaImage;
35 * @brief A wx widget to view a preview of a Film.
37 class FilmViewer : public wxPanel
40 FilmViewer (wxWindow *);
42 void set_film (boost::shared_ptr<Film>);
44 DCPTime position () const {
48 void set_position (DCPTime p);
49 void set_coalesce_player_changes (bool c);
53 boost::signals2::signal<void (boost::weak_ptr<PlayerVideo>)> ImageChanged;
57 void panel_sized (wxSizeEvent &);
61 void calculate_sizes ();
62 void check_play_state ();
63 void active_jobs_changed (boost::optional<std::string>);
64 void back_clicked (wxMouseEvent &);
65 void forward_clicked (wxMouseEvent &);
66 void player_changed (bool);
67 void update_position_label ();
68 void update_position_slider ();
69 void get (DCPTime, bool);
70 void refresh_panel ();
71 void setup_sensitivity ();
72 void film_changed (Film::Property);
73 DCPTime nudge_amount (wxMouseEvent &);
74 void timecode_clicked ();
75 void frame_number_clicked ();
76 void go_to (DCPTime t);
78 boost::shared_ptr<Film> _film;
79 boost::shared_ptr<Player> _player;
83 wxCheckBox* _outline_content;
84 wxRadioButton* _left_eye;
85 wxRadioButton* _right_eye;
87 wxButton* _back_button;
88 wxButton* _forward_button;
89 wxStaticText* _frame_number;
90 wxStaticText* _timecode;
91 wxToggleButton* _play_button;
93 bool _coalesce_player_changes;
94 bool _pending_player_change;
96 boost::shared_ptr<const Image> _frame;
98 Position<int> _inter_position;
99 dcp::Size _inter_size;
101 /** Size of our output (including padding if we have any) */
103 /** Size of the panel that we have available */
104 dcp::Size _panel_size;
105 /** true if the last call to ::get() was specified to be accurate;
106 * this is used so that when re-fetching the current frame we
107 * can get the same one that we got last time.
109 bool _last_get_accurate;
111 boost::signals2::scoped_connection _film_connection;
112 boost::signals2::scoped_connection _player_connection;