Fix crash when trying to make a KDM on an unencrypted project.
[dcpomatic.git] / src / wx / film_viewer.h
index cb372391ad0306a16c4f614555af5b0e4b327891..0e7da10b1a948d527c3cb339e560df153d65d12a 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2017 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2018 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -24,6 +24,7 @@
 
 #include "lib/film.h"
 #include "lib/config.h"
+#include "lib/player_text.h"
 #include <RtAudio.h>
 #include <wx/wx.h>
 
@@ -34,6 +35,7 @@ class RGBPlusAlphaImage;
 class PlayerVideo;
 class Player;
 class Butler;
+class ClosedCaptionsDialog;
 
 /** @class FilmViewer
  *  @brief A wx widget to view a preview of a Film.
@@ -78,6 +80,8 @@ public:
 
        int audio_callback (void* out, unsigned int frames);
 
+       void show_closed_captions ();
+
        boost::signals2::signal<void (boost::weak_ptr<PlayerVideo>)> ImageChanged;
 
 private:
@@ -87,14 +91,13 @@ private:
        void slider_released ();
        void play_clicked ();
        void timer ();
-       void captions_changed ();
        void calculate_sizes ();
        void check_play_state ();
        void active_jobs_changed (boost::optional<std::string>);
        void rewind_clicked (wxMouseEvent &);
        void back_clicked (wxKeyboardState& s);
        void forward_clicked (wxKeyboardState &);
-       void player_changed (int, bool);
+       void player_change (ChangeType type, int, bool);
        void update_position_label ();
        void update_position_slider ();
        void get ();
@@ -102,7 +105,7 @@ private:
        void seek (DCPTime t, bool accurate);
        void refresh_panel ();
        void setup_sensitivity ();
-       void film_changed (Film::Property);
+       void film_change (ChangeType, Film::Property);
        DCPTime nudge_amount (wxKeyboardState &);
        void timecode_clicked ();
        void frame_number_clicked ();
@@ -111,6 +114,7 @@ private:
        void recreate_butler ();
        void config_changed (Config::Property);
        DCPTime time () const;
+       DCPTime uncorrected_time () const;
        Frame average_latency () const;
        DCPTime one_video_frame () const;
 
@@ -123,7 +127,6 @@ private:
        wxCheckBox* _outline_content;
        wxChoice* _eye;
        wxCheckBox* _jump_to_selected;
-       wxChoice* _captions;
        wxSlider* _slider;
        wxButton* _rewind_button;
        wxButton* _back_button;
@@ -162,5 +165,7 @@ private:
        int _dropped;
        boost::optional<int> _dcp_decode_reduction;
 
+       ClosedCaptionsDialog* _closed_captions_dialog;
+
        boost::signals2::scoped_connection _config_changed_connection;
 };