C++11 tidying.
[dcpomatic.git] / src / wx / simple_video_view.cc
index 9ebb8c82fe2716a37214312da67f63ee0433c8b5..55b05dfaaf9c641e910c105ac0cfb08cffbfb805 100644 (file)
@@ -69,20 +69,17 @@ SimpleVideoView::paint ()
        if (!out_size.width || !out_size.height || !_image || out_size != _image->size()) {
                dc.Clear ();
        } else {
-
                wxImage frame (out_size.width, out_size.height, _image->data()[0], true);
                wxBitmap frame_bitmap (frame);
                dc.DrawBitmap (frame_bitmap, 0, max(0, (panel_size.GetHeight() - out_size.height) / 2));
        }
 
-#ifdef DCPOMATIC_OSX
-       auto appearance = wxSystemSettings::GetAppearance();
-       auto dark = appearance.IsDark();
-#else
-       auto dark = false;
-#endif
-
-       auto const pad_colour = (_viewer->pad_black() || dark) ? wxColour(0, 0, 0) : wxColour(240, 240, 240);
+       auto pad_colour = wxColour(240, 240, 240);
+       if (_viewer->pad_black()) {
+               pad_colour = wxColour(0, 0, 0);
+       } else if (gui_is_dark()) {
+               pad_colour = wxColour(50, 50, 50);
+       }
 
        if (out_size.width < panel_size.GetWidth()) {
                wxPen   p (pad_colour);
@@ -109,7 +106,7 @@ SimpleVideoView::paint ()
                dc.DrawRectangle (_inter_position.x, _inter_position.y + (panel_size.GetHeight() - out_size.height) / 2, _inter_size.width, _inter_size.height);
        }
 
-       optional<dcpomatic::Rect<double> > subs = _viewer->outline_subtitles();
+       auto subs = _viewer->outline_subtitles();
        if (subs) {
                wxPen p (wxColour(0, 255, 0), 2);
                dc.SetPen (p);
@@ -137,7 +134,7 @@ SimpleVideoView::timer ()
        }
 
        display_next_frame (false);
-       DCPTime const next = position() + _viewer->one_video_frame();
+       auto const next = position() + _viewer->one_video_frame();
 
        if (next >= length()) {
                _viewer->finished ();
@@ -167,7 +164,7 @@ SimpleVideoView::start ()
 VideoView::NextFrameResult
 SimpleVideoView::display_next_frame (bool non_blocking)
 {
-       NextFrameResult const r = get_next_frame (non_blocking);
+       auto const r = get_next_frame (non_blocking);
        if (r != SUCCESS) {
                return r;
        }
@@ -221,7 +218,7 @@ SimpleVideoView::update ()
        _state_timer.set ("get image");
 
        set_image (
-               player_video().first->image(bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24), VIDEO_RANGE_FULL, false, true)
+               player_video().first->image(bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24), VideoRange::FULL, false, true)
                );
 
        _state_timer.set ("ImageChanged");