Same thing with inter_size.
authorCarl Hetherington <cth@carlh.net>
Wed, 20 Nov 2019 22:41:58 +0000 (23:41 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 8 Jan 2020 20:56:47 +0000 (21:56 +0100)
src/wx/film_viewer.h
src/wx/gl_video_view.cc
src/wx/gl_video_view.h
src/wx/simple_video_view.cc
src/wx/simple_video_view.h

index 5c2f7cb..8cacf80 100644 (file)
@@ -123,9 +123,6 @@ public:
        dcp::Size out_size () const {
                return _out_size;
        }
-       dcp::Size inter_size () const {
-               return _inter_size;
-       }
        bool outline_content () const {
                return _outline_content;
        }
@@ -177,8 +174,6 @@ private:
        bool _coalesce_player_changes;
        std::list<int> _pending_player_changes;
 
-       dcp::Size _inter_size;
-
        /** Size of our output (including padding if we have any) */
        dcp::Size _out_size;
 
index 93a53b4..ce15278 100644 (file)
@@ -140,7 +140,7 @@ GLVideoView::update ()
 }
 
 void
-GLVideoView::draw (Position<int> inter_position)
+GLVideoView::draw (Position<int> inter_position, dcp::Size inter_size)
 {
        glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
        check_gl_error ("glClear");
@@ -232,7 +232,6 @@ GLVideoView::draw (Position<int> inter_position)
        if (_viewer->outline_content()) {
                glColor3ub (255, 0, 0);
                glBegin (GL_LINE_LOOP);
-               dcp::Size inter_size = _viewer->inter_size ();
                glVertex2f (inter_position.x, inter_position.y + (canvas_size.GetHeight() - out_size.height) / 2);
                glVertex2f (inter_position.x + inter_size.width, inter_position.y + (canvas_size.GetHeight() - out_size.height) / 2);
                glVertex2f (inter_position.x + inter_size.width, inter_position.y + (canvas_size.GetHeight() - out_size.height) / 2 + inter_size.height);
@@ -305,6 +304,7 @@ try
                lm.unlock ();
 
                Position<int> inter_position;
+               dcp::Size inter_size;
                if (length() != dcpomatic::DCPTime()) {
                        dcpomatic::DCPTime const next = position() + one_video_frame();
 
@@ -317,8 +317,9 @@ try
                        get_next_frame (false);
                        set_image (player_video().first->image(bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24), false, true));
                        inter_position = player_video().first->inter_position();
+                       inter_size = player_video().first->inter_size();
                }
-               draw (inter_position);
+               draw (inter_position, inter_size);
 
                while (time_until_next_frame() < 5) {
                        get_next_frame (true);
index 01434d5..4f50904 100644 (file)
@@ -51,7 +51,7 @@ public:
        }
 
 private:
-       void draw (Position<int> inter_position);
+       void draw (Position<int> inter_position, dcp::Size inter_size);
        void thread ();
        void request_one_shot ();
        void create ();
index 6a8a863..c8fe7b9 100644 (file)
@@ -125,11 +125,10 @@ SimpleVideoView::paint ()
        }
 
        if (_viewer->outline_content()) {
-               dcp::Size inter_size = _viewer->inter_size ();
                wxPen p (wxColour (255, 0, 0), 2);
                dc.SetPen (p);
                dc.SetBrush (*wxTRANSPARENT_BRUSH);
-               dc.DrawRectangle (_inter_position.x, _inter_position.y + (panel_size.GetHeight() - out_size.height) / 2, inter_size.width, inter_size.height);
+               dc.DrawRectangle (_inter_position.x, _inter_position.y + (panel_size.GetHeight() - out_size.height) / 2, _inter_size.width, _inter_size.height);
        }
         _viewer->state_timer().unset();
 }
@@ -249,7 +248,7 @@ SimpleVideoView::display_player_video ()
        _viewer->_state_timer.unset ();
 
        _inter_position = player_video().first->inter_position ();
-       _viewer->_inter_size = player_video().first->inter_size ();
+       _inter_size = player_video().first->inter_size ();
 
        _viewer->refresh_view ();
 
index f318e77..86451fa 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "video_view.h"
 #include "lib/position.h"
+#include <dcp/types.h>
 #include <wx/wx.h>
 
 class FilmViewer;
@@ -50,4 +51,5 @@ private:
        boost::shared_ptr<const Image> _image;
        wxTimer _timer;
        Position<int> _inter_position;
+       dcp::Size _inter_size;
 };