b3ad701d86996a952835406a8207da79ae2f99b6
[dcpomatic.git] / src / wx / control_film_viewer.h
1 #include "lib/dcpomatic_time.h"
2 #include "lib/types.h"
3 #include "lib/film.h"
4 #include <wx/wx.h>
5 #include <boost/shared_ptr.hpp>
6 #include <boost/signals2.hpp>
7
8 class FilmViewer;
9 class Film;
10 class ClosedCaptionsDialog;
11 class Content;
12 class PlayerVideo;
13 class wxToggleButton;
14
15 class ControlFilmViewer : public wxPanel
16 {
17 public:
18         ControlFilmViewer (wxWindow* parent, bool outline_content = true, bool jump_to_selected = true);
19
20         void set_film (boost::shared_ptr<Film> film);
21         void back_frame ();
22         void forward_frame ();
23
24         /* FilmViewer proxies */
25         void set_position (DCPTime p);
26         void set_position (boost::shared_ptr<Content> content, ContentTime p);
27         void set_dcp_decode_reduction (boost::optional<int> reduction);
28         void show_closed_captions ();
29         void start ();
30         bool stop ();
31         bool playing () const;
32         void slow_refresh ();
33         int dropped () const;
34         boost::shared_ptr<Film> film () const;
35         boost::optional<int> dcp_decode_reduction () const;
36         DCPTime position () const;
37         void set_coalesce_player_changes (bool c);
38         boost::signals2::signal<void (boost::weak_ptr<PlayerVideo>)> ImageChanged;
39
40 private:
41         void update_position_label ();
42         void update_position_slider ();
43         void rewind_clicked (wxMouseEvent &);
44         void back_clicked (wxKeyboardState& s);
45         void forward_clicked (wxKeyboardState &);
46         void slider_moved (bool page);
47         void slider_released ();
48         void play_clicked ();
49         void frame_number_clicked ();
50         void jump_to_selected_clicked ();
51         void setup_sensitivity ();
52         void timecode_clicked ();
53         void check_play_state ();
54         void active_jobs_changed (boost::optional<std::string>);
55         DCPTime nudge_amount (wxKeyboardState& ev);
56         void image_changed (boost::weak_ptr<PlayerVideo>);
57         void film_change (ChangeType type, Film::Property p);
58         void outline_content_changed ();
59         void eye_changed ();
60         void position_changed ();
61
62         boost::shared_ptr<Film> _film;
63         boost::shared_ptr<FilmViewer> _viewer;
64
65         wxSizer* _v_sizer;
66         bool _slider_being_moved;
67         bool _was_running_before_slider;
68
69         wxCheckBox* _outline_content;
70         wxChoice* _eye;
71         wxCheckBox* _jump_to_selected;
72         wxSlider* _slider;
73         wxButton* _rewind_button;
74         wxButton* _back_button;
75         wxButton* _forward_button;
76         wxStaticText* _frame_number;
77         wxStaticText* _timecode;
78         wxToggleButton* _play_button;
79
80         ClosedCaptionsDialog* _closed_captions_dialog;
81 };