From: Carl Hetherington Date: Thu, 9 May 2019 16:59:10 +0000 (+0100) Subject: Tidy up sized emissions from VideoView. X-Git-Tag: v2.15.1~7 X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=fc4f75abd3b062e8297990a482e77e32458cd169 Tidy up sized emissions from VideoView. --- diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index 4066710e7..c83db56de 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -106,9 +106,8 @@ FilmViewer::FilmViewer (wxWindow* p) break; } - /* XXX: maybe this should be proxied through the VideoView */ - _video_view->get()->Bind (wxEVT_SIZE, boost::bind (&FilmViewer::video_view_sized, this)); - _timer.Bind (wxEVT_TIMER, boost::bind (&FilmViewer::timer, this)); + _video_view->Sized.connect (boost::bind(&FilmViewer::video_view_sized, this)); + _timer.Bind (wxEVT_TIMER, boost::bind(&FilmViewer::timer, this)); set_film (shared_ptr ()); diff --git a/src/wx/gl_video_view.cc b/src/wx/gl_video_view.cc index f5b8ef68a..d1e7c7326 100644 --- a/src/wx/gl_video_view.cc +++ b/src/wx/gl_video_view.cc @@ -41,6 +41,7 @@ GLVideoView::GLVideoView (wxWindow *parent) _canvas = new wxGLCanvas (parent, wxID_ANY, 0, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE); _context = new wxGLContext (_canvas); _canvas->Bind (wxEVT_PAINT, boost::bind(&GLVideoView::paint, this, _1)); + _canvas->Bind (wxEVT_SIZE, boost::bind(boost::ref(Sized))); glGenTextures (1, &_id); glBindTexture (GL_TEXTURE_2D, _id); diff --git a/src/wx/simple_video_view.cc b/src/wx/simple_video_view.cc index 6435e0226..d0b18d421 100644 --- a/src/wx/simple_video_view.cc +++ b/src/wx/simple_video_view.cc @@ -40,6 +40,7 @@ SimpleVideoView::SimpleVideoView (FilmViewer* viewer, wxWindow* parent) _panel->SetBackgroundColour (*wxBLACK); _panel->Bind (wxEVT_PAINT, boost::bind (&SimpleVideoView::paint, this)); + _panel->Bind (wxEVT_SIZE, boost::bind(boost::ref(Sized))); } void diff --git a/src/wx/video_view.h b/src/wx/video_view.h index f4dec9c68..060d982f7 100644 --- a/src/wx/video_view.h +++ b/src/wx/video_view.h @@ -22,6 +22,7 @@ #define DCPOMATIC_VIDEO_VIEW_H #include +#include class Image; class wxWindow; @@ -33,6 +34,8 @@ public: virtual void set_image (boost::shared_ptr image) = 0; virtual wxWindow* get () const = 0; + + boost::signals2::signal Sized; }; #endif