X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Ffilm_viewer.h;h=1fa85a621c9fb85e30e8fa20fe71cf13a505d54d;hb=5c48efdde34ee11f135ea8b369d85d50d1410445;hp=2efe448c9e4deeaa37ba58e73e1511cf3ae48ee8;hpb=6b50d63a76999bb5c443b69e7ec68b4607ab9b4e;p=dcpomatic.git diff --git a/src/wx/film_viewer.h b/src/wx/film_viewer.h index 2efe448c9..1fa85a621 100644 --- a/src/wx/film_viewer.h +++ b/src/wx/film_viewer.h @@ -25,27 +25,27 @@ #include "video_view.h" -#include "lib/film.h" #include "lib/config.h" +#include "lib/film.h" #include "lib/player_text.h" -#include "lib/timer.h" #include "lib/signaller.h" -#include "lib/warnings.h" +#include "lib/timer.h" +#include +LIBDCP_DISABLE_WARNINGS #include -DCPOMATIC_DISABLE_WARNINGS #include -DCPOMATIC_ENABLE_WARNINGS +LIBDCP_ENABLE_WARNINGS #include -class wxToggleButton; +class Butler; +class ClosedCaptionsDialog; class FFmpegPlayer; class Image; -class RGBPlusAlphaImage; -class PlayerVideo; class Player; -class Butler; -class ClosedCaptionsDialog; +class PlayerVideo; +class RGBPlusAlphaImage; +class wxToggleButton; /** @class FilmViewer @@ -62,7 +62,7 @@ public: return _video_view->get(); } - VideoView const * video_view () const { + std::shared_ptr video_view () const { return _video_view; } @@ -80,6 +80,7 @@ public: dcpomatic::DCPTime position () const { return _video_view->position(); } + boost::optional position_in_content (std::shared_ptr content) const; dcpomatic::DCPTime one_video_frame () const; void start (); @@ -98,6 +99,9 @@ public: void set_outline_subtitles (boost::optional>); void set_eyes (Eyes e); void set_pad_black (bool p); + void set_optimise_for_j2k (bool o); + void set_crop_guess (dcpomatic::Rect crop); + void unset_crop_guess (); void slow_refresh (); @@ -115,9 +119,6 @@ public: } /* Some accessors and utility methods that VideoView classes need */ - dcp::Size out_size () const { - return _out_size; - } bool outline_content () const { return _outline_content; } @@ -135,14 +136,17 @@ public: } void finished (); void image_changed (std::shared_ptr video); + boost::optional> crop_guess () const { + return _crop_guess; + } bool pending_idle_get () const { return _idle_get; } boost::signals2::signal)> ImageChanged; - boost::signals2::signal Started; - boost::signals2::signal Stopped; + boost::signals2::signal Started; + boost::signals2::signal Stopped; /** While playing back we reached the end of the film (emitted from GUI thread) */ boost::signals2::signal Finished; /** Emitted from the GUI thread when a lot of frames are being dropped */ @@ -163,6 +167,7 @@ private: void config_changed (Config::Property); void film_length_change (); void ui_finished (); + void start_audio_stream_if_open (); dcpomatic::DCPTime uncorrected_time () const; Frame average_latency () const; @@ -172,13 +177,10 @@ private: std::shared_ptr _film; std::shared_ptr _player; - VideoView* _video_view = nullptr; + std::shared_ptr _video_view; bool _coalesce_player_changes = false; std::vector _pending_player_changes; - /** Size of our output (including padding if we have any) */ - dcp::Size _out_size; - RtAudio _audio; int _audio_channels = 0; unsigned int _audio_block_size = 1024; @@ -193,6 +195,11 @@ private: boost::optional _dcp_decode_reduction; + /** true to assume that this viewer is only being used for JPEG2000 sources + * so it can optimise accordingly. + */ + bool _optimise_for_j2k = false; + ClosedCaptionsDialog* _closed_captions_dialog = nullptr; bool _outline_content = false; @@ -205,5 +212,7 @@ private: /** true if an get() is required next time we are idle */ bool _idle_get = false; + boost::optional> _crop_guess; + boost::signals2::scoped_connection _config_changed_connection; };