#define DCPOMATIC_VIDEO_VIEW_H
#include "lib/dcpomatic_time.h"
+#include "lib/timer.h"
+#include "lib/types.h"
+#include "lib/exception_store.h"
#include <boost/shared_ptr.hpp>
#include <boost/signals2.hpp>
#include <boost/thread.hpp>
+#include <boost/noncopyable.hpp>
class Image;
class wxWindow;
class FilmViewer;
class PlayerVideo;
-class VideoView
+class VideoView : public ExceptionStore, public boost::noncopyable
{
public:
- VideoView (FilmViewer* viewer)
- : _viewer (viewer)
-#ifdef DCPOMATIC_VARIANT_SWAROOP
- , _in_watermark (false)
-#endif
- , _video_frame_rate (0)
- {}
-
+ VideoView (FilmViewer* viewer);
virtual ~VideoView () {}
virtual void set_image (boost::shared_ptr<const Image> image) = 0;
virtual wxWindow* get () const = 0;
+ /** Redraw the view after something has changed like content outlining,
+ * the film being removed, etc.
+ */
virtual void update () = 0;
- /* XXX_b: make pure */
- virtual void start () {}
+ virtual void start ();
/* XXX_b: make pure */
virtual void stop () {}
/* XXX_b: to remove */
virtual void display_player_video () {}
+ int dropped () const {
+ boost::mutex::scoped_lock lm (_mutex);
+ return _dropped;
+ }
+
+ int gets () const {
+ boost::mutex::scoped_lock lm (_mutex);
+ return _gets;
+ }
+
+ StateTimer const & state_timer () const {
+ return _state_timer;
+ }
+
dcpomatic::DCPTime position () const {
boost::mutex::scoped_lock lm (_mutex);
return _player_video.second;
_length = len;
}
+ void set_eyes (Eyes eyes) {
+ boost::mutex::scoped_lock lm (_mutex);
+ _eyes = eyes;
+ }
+
+ void set_three_d (bool t) {
+ boost::mutex::scoped_lock lm (_mutex);
+ _three_d = t;
+ }
+
protected:
/* XXX_b: to remove */
friend class FilmViewer;
return _player_video;
}
+ void add_dropped () {
+ boost::mutex::scoped_lock lm (_mutex);
+ ++_dropped;
+ }
+
+ void add_get () {
+ boost::mutex::scoped_lock lm (_mutex);
+ ++_gets;
+ }
+
FilmViewer* _viewer;
#ifdef DCPOMATIC_VARIANT_SWAROOP
int _watermark_y;
#endif
+ StateTimer _state_timer;
+
private:
/** Mutex protecting all the state in VideoView */
mutable boost::mutex _mutex;
int _video_frame_rate;
/** length of the film we are playing, or 0 if there is none */
dcpomatic::DCPTime _length;
+ Eyes _eyes;
+ bool _three_d;
+
+ int _dropped;
+ int _gets;
};
#endif