Put Time types in dcpomatic namespace.
[dcpomatic.git] / src / wx / film_viewer.h
index 123172ad24de0e18f60fcb7ff041a1a864999e4b..0222d31c95bf487e9dd2375162b5c5a199334c42 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2018 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2019 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -25,6 +25,7 @@
 #include "lib/film.h"
 #include "lib/config.h"
 #include "lib/player_text.h"
+#include "lib/timer.h"
 #include <RtAudio.h>
 #include <wx/wx.h>
 
@@ -58,14 +59,14 @@ public:
                return _film;
        }
 
-       void seek (DCPTime t, bool accurate);
-       void seek (boost::shared_ptr<Content> content, ContentTime p, bool accurate);
-       void seek_by (DCPTime by, bool accurate);
+       void seek (dcpomatic::DCPTime t, bool accurate);
+       void seek (boost::shared_ptr<Content> content, dcpomatic::ContentTime p, bool accurate);
+       void seek_by (dcpomatic::DCPTime by, bool accurate);
        /** @return our `playhead' position; this may not lie exactly on a frame boundary */
-       DCPTime position () const {
+       dcpomatic::DCPTime position () const {
                return _video_position;
        }
-       DCPTime one_video_frame () const;
+       dcpomatic::DCPTime one_video_frame () const;
 
        void start ();
        bool stop ();
@@ -88,10 +89,25 @@ public:
 
        int audio_callback (void* out, unsigned int frames);
 
+#ifdef DCPOMATIC_VARIANT_SWAROOP
+       void set_background_image (bool b) {
+               _background_image = b;
+               refresh_panel ();
+       }
+#endif
+
+       StateTimer const & state_timer () const {
+               return _state_timer;
+       }
+
+       int gets () const {
+               return _gets;
+       }
+
        boost::signals2::signal<void (boost::weak_ptr<PlayerVideo>)> ImageChanged;
        boost::signals2::signal<void ()> PositionChanged;
-       boost::signals2::signal<void (DCPTime)> Started;
-       boost::signals2::signal<void (DCPTime)> Stopped;
+       boost::signals2::signal<void (dcpomatic::DCPTime)> Started;
+       boost::signals2::signal<void (dcpomatic::DCPTime)> Stopped;
        /** While playing back we reached the end of the film (emitted from GUI thread) */
        boost::signals2::signal<void ()> Finished;
 
@@ -110,8 +126,8 @@ private:
        void config_changed (Config::Property);
        bool maybe_draw_background_image (wxPaintDC& dc);
 
-       DCPTime time () const;
-       DCPTime uncorrected_time () const;
+       dcpomatic::DCPTime time () const;
+       dcpomatic::DCPTime uncorrected_time () const;
        Frame average_latency () const;
 
        void refresh_panel ();
@@ -126,9 +142,9 @@ private:
        bool _coalesce_player_changes;
        std::list<int> _pending_player_changes;
 
-       std::pair<boost::shared_ptr<PlayerVideo>, DCPTime> _player_video;
+       std::pair<boost::shared_ptr<PlayerVideo>, dcpomatic::DCPTime> _player_video;
        boost::shared_ptr<const Image> _frame;
-       DCPTime _video_position;
+       dcpomatic::DCPTime _video_position;
        Position<int> _inter_position;
        dcp::Size _inter_size;
 
@@ -164,7 +180,11 @@ private:
        bool _in_watermark;
        int _watermark_x;
        int _watermark_y;
+       bool _background_image;
 #endif
 
+       StateTimer _state_timer;
+       int _gets;
+
        boost::signals2::scoped_connection _config_changed_connection;
 };