X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fvideo_view.h;h=d9ef2a65f4859afd8a8bea01dd8ef9abd0c8642b;hb=046d84f45621f7e128cb30160a315f98881c6f4b;hp=80d6a50fc454050174de5bad6dcd598548cd85f0;hpb=7c33cdd95a23ff784c0e0731a9d1444ce9bb8f09;p=dcpomatic.git diff --git a/src/wx/video_view.h b/src/wx/video_view.h index 80d6a50fc..d9ef2a65f 100644 --- a/src/wx/video_view.h +++ b/src/wx/video_view.h @@ -21,12 +21,15 @@ #ifndef DCPOMATIC_VIDEO_VIEW_H #define DCPOMATIC_VIDEO_VIEW_H +#include "lib/dcpomatic_time.h" #include #include +#include class Image; class wxWindow; class FilmViewer; +class PlayerVideo; class VideoView { @@ -46,22 +49,55 @@ public: /* XXX_b: make pure */ virtual void start () {} + /* XXX_b: make pure */ + virtual void stop () {} + + void clear (); boost::signals2::signal Sized; + virtual bool display_next_frame (bool) = 0; + /* XXX_b: to remove */ - virtual bool get (bool) { - return true; + virtual void display_player_video () {} + + dcpomatic::DCPTime position () const { + boost::mutex::scoped_lock lm (_mutex); + return _player_video.second; + } + + void set_film (boost::shared_ptr film) { + boost::mutex::scoped_lock lm (_mutex); + _film = film; } protected: + /* XXX_b: to remove */ + friend class FilmViewer; + + bool get_next_frame (bool non_blocking); + int time_until_next_frame () const; + dcpomatic::DCPTime one_video_frame () const; + + boost::shared_ptr film () const { + boost::mutex::scoped_lock lm (_mutex); + return _film; + } + FilmViewer* _viewer; + std::pair, dcpomatic::DCPTime> _player_video; + + /** Mutex protecting all the state in VideoView */ + mutable boost::mutex _mutex; #ifdef DCPOMATIC_VARIANT_SWAROOP bool _in_watermark; int _watermark_x; int _watermark_y; #endif + +private: + boost::shared_ptr _film; }; #endif