summaryrefslogtreecommitdiff
path: root/src/wx/gl_video_view.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-09-14 21:11:56 +0200
committerCarl Hetherington <cth@carlh.net>2021-09-27 13:41:46 +0200
commit23aa3071850761144798112a5aaea61304de8586 (patch)
tree9a8d4058fd8a32a169ae840a6f69468ad65cd5f8 /src/wx/gl_video_view.h
parent4bbcf55dc0e644c20b1eaabee2da3219c4e7635f (diff)
Support subs and tidy up a few things.
Diffstat (limited to 'src/wx/gl_video_view.h')
-rw-r--r--src/wx/gl_video_view.h31
1 files changed, 30 insertions, 1 deletions
diff --git a/src/wx/gl_video_view.h b/src/wx/gl_video_view.h
index 4e61b5b4c..d7f8429af 100644
--- a/src/wx/gl_video_view.h
+++ b/src/wx/gl_video_view.h
@@ -45,7 +45,7 @@ public:
Texture& operator= (Texture const&) = delete;
void bind ();
- bool set (std::shared_ptr<const Image> image);
+ void set (std::shared_ptr<const Image> image);
private:
GLuint _name;
@@ -93,8 +93,37 @@ private:
wxGLCanvas* _canvas;
wxGLContext* _context;
+ template <class T>
+ class Last
+ {
+ public:
+ void set_next (T const& next) {
+ _next = next;
+ }
+
+ bool changed () const {
+ return !_value || *_value != _next;
+ }
+
+ void update () {
+ _value = _next;
+ }
+
+ private:
+ boost::optional<T> _value;
+ T _next;
+ };
+
+ Last<wxSize> _last_canvas_size;
+ Last<dcp::Size> _last_video_size;
+ Last<Position<int>> _last_inter_position;
+ Last<dcp::Size> _last_inter_size;
+ Last<dcp::Size> _last_out_size;
+
boost::atomic<wxSize> _canvas_size;
std::unique_ptr<Texture> _video_texture;
+ std::unique_ptr<Texture> _subtitle_texture;
+ bool _have_subtitle_to_render = false;
bool _vsync_enabled;
boost::thread _thread;