Move _state_timer into VideoView.
[dcpomatic.git] / src / wx / swaroop_controls.h
1 /*
2     Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
3
4     This file is part of DCP-o-matic.
5
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.
10
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.
15
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/>.
18
19 */
20
21 #include "controls.h"
22
23 class DCPContent;
24 class EncryptedECinemaKDM;
25
26 class SwaroopControls : public Controls
27 {
28 public:
29         SwaroopControls (wxWindow* parent, boost::shared_ptr<FilmViewer> viewer);
30
31         void log (wxString s);
32         void set_film (boost::shared_ptr<Film> film);
33         void check_restart ();
34
35         /** This is so that we can tell our parent player to reset the film
36             when we have created one from a SPL.  We could call a method
37             in the player's DOMFrame but we don't have that in a header.
38         */
39         boost::signals2::signal<void (boost::weak_ptr<Film>)> ResetFilm;
40
41 private:
42         void play_clicked ();
43         void pause_clicked ();
44         void stop_clicked ();
45         void next_clicked ();
46         void previous_clicked ();
47         void add_playlist_to_list (SPL spl);
48         void update_content_directory ();
49         void update_playlist_directory ();
50         void spl_selection_changed ();
51         void select_playlist (int selected, int position);
52         void started ();
53         void stopped ();
54         void setup_sensitivity ();
55         void config_changed (int);
56         void viewer_finished ();
57         void write_position ();
58         void reset_film ();
59         void update_current_content ();
60         bool can_do_previous ();
61         bool can_do_next ();
62         void decrement_allowed_shows ();
63         void deselect_playlist ();
64
65         boost::optional<dcp::EncryptedKDM> get_kdm_from_url (boost::shared_ptr<DCPContent> dcp);
66         boost::optional<dcp::EncryptedKDM> get_kdm_from_directory (boost::shared_ptr<DCPContent> dcp);
67         boost::optional<EncryptedECinemaKDM> get_kdm_from_directory (boost::shared_ptr<FFmpegContent> ffmpeg);
68
69         wxButton* _play_button;
70         wxButton* _pause_button;
71         wxButton* _stop_button;
72         wxButton* _next_button;
73         wxButton* _previous_button;
74
75         ContentView* _content_view;
76         wxButton* _refresh_content_view;
77         wxListCtrl* _spl_view;
78         wxButton* _refresh_spl_view;
79         wxListCtrl* _current_spl_view;
80
81         bool _current_disable_timeline;
82         bool _current_disable_next;
83
84         std::vector<SPL> _playlists;
85         boost::optional<int> _selected_playlist;
86         int _selected_playlist_position;
87
88         wxTimer _timer;
89 };