Add playback seek logging.
[dcpomatic.git] / src / wx / film_viewer.cc
index d5d391a8066a706a3e7d7d4825bd1f1583c4c9c1..db72e6c6037fb759ff43b1587830fe878119e9b4 100644 (file)
@@ -91,7 +91,7 @@ FilmViewer::FilmViewer (wxWindow* p)
 #endif
 
        _panel->SetBackgroundStyle (wxBG_STYLE_PAINT);
-       _panel->SetBackgroundColour (*wxBLACK);
+       _panel->SetBackgroundColour (wxNullColour);
 
        _panel->Bind (wxEVT_PAINT, boost::bind (&FilmViewer::paint_panel, this));
        _panel->Bind (wxEVT_SIZE,  boost::bind (&FilmViewer::panel_sized, this, _1));
@@ -317,7 +317,7 @@ FilmViewer::paint_panel ()
 
        wxImage frame (_out_size.width, _out_size.height, _frame->data()[0], true);
        wxBitmap frame_bitmap (frame);
-       dc.DrawBitmap (frame_bitmap, 0, 0);
+       dc.DrawBitmap (frame_bitmap, 0, max(0, (_panel_size.height - _out_size.height) / 2));
 
        if (_out_size.width < _panel_size.width) {
                wxPen p (_panel->GetParent()->GetBackgroundColour());
@@ -332,7 +332,9 @@ FilmViewer::paint_panel ()
                wxBrush b (_panel->GetParent()->GetBackgroundColour());
                dc.SetPen (p);
                dc.SetBrush (b);
-               dc.DrawRectangle (0, _out_size.height, _panel_size.width, _panel_size.height - _out_size.height);
+               int const gap = (_panel_size.height - _out_size.height) / 2;
+               dc.DrawRectangle (0, 0, _panel_size.width, gap);
+               dc.DrawRectangle (0, gap + _out_size.height, _panel_size.width, gap);
        }
 
        if (_outline_content) {
@@ -420,7 +422,7 @@ FilmViewer::start ()
        _playing = true;
        _dropped = 0;
        timer ();
-       Started ();
+       Started (position());
 }
 
 bool
@@ -436,7 +438,7 @@ FilmViewer::stop ()
        }
 
        _playing = false;
-       Stopped ();
+       Stopped (position());
        return true;
 }
 
@@ -554,6 +556,7 @@ FilmViewer::seek (DCPTime t, bool accurate)
        }
 
        PositionChanged ();
+       Seeked (position());
 }
 
 void