Clean up access to stuff from Film.
[dcpomatic.git] / src / wx / gl_video_view.h
index ba4c7cfdc92df3a32afbc9642f3de5d8264b8fdc..73db3535d2775c7fdc84b46482e7a1143948a4fd 100644 (file)
 */
 
 #include "video_view.h"
+#include "lib/signaller.h"
 #include <wx/wx.h>
 #include <wx/glcanvas.h>
 #include <dcp/util.h>
 #include <boost/shared_ptr.hpp>
+#include <boost/thread.hpp>
 #undef None
 #undef Success
 
@@ -37,18 +39,28 @@ public:
                return _canvas;
        }
        void update ();
+       void start ();
+       void stop ();
+
+       bool display_next_frame (bool);
 
        bool vsync_enabled () const {
                return _vsync_enabled;
        }
 
 private:
-        void paint ();
-        void draw ();
+       void paint ();
+       void draw ();
+       void thread ();
+       wxGLContext* context () const;
 
        wxGLCanvas* _canvas;
-        wxGLContext* _context;
-        GLuint _id;
-        boost::optional<dcp::Size> _size;
+
+       wxGLContext* _context;
+       mutable boost::mutex _context_mutex;
+
+       GLuint _id;
+       boost::optional<dcp::Size> _size;
        bool _vsync_enabled;
+       boost::thread* _thread;
 };