_state_timer.set("paint-panel");
wxPaintDC dc (_panel);
- dcp::Size const out_size = _viewer->out_size ();
- wxSize const panel_size = _panel->GetSize ();
+ auto const panel_size = _panel->GetSize ();
- if (!out_size.width || !out_size.height || !_image || out_size != _image->size()) {
+ dcp::Size out_size;
+ if (!_image) {
dc.Clear ();
} else {
-
+ out_size = _image->size();
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));
}
+ auto pad = pad_colour();
+
if (out_size.width < panel_size.GetWidth()) {
- /* XXX: these colours are right for GNOME; may need adjusting for other OS */
- wxPen p (_viewer->pad_black() ? wxColour(0, 0, 0) : wxColour(240, 240, 240));
- wxBrush b (_viewer->pad_black() ? wxColour(0, 0, 0) : wxColour(240, 240, 240));
+ wxPen p (pad);
+ wxBrush b (pad);
dc.SetPen (p);
dc.SetBrush (b);
dc.DrawRectangle (out_size.width, 0, panel_size.GetWidth() - out_size.width, panel_size.GetHeight());
}
if (out_size.height < panel_size.GetHeight()) {
- wxPen p (_viewer->pad_black() ? wxColour(0, 0, 0) : wxColour(240, 240, 240));
- wxBrush b (_viewer->pad_black() ? wxColour(0, 0, 0) : wxColour(240, 240, 240));
+ wxPen p (pad);
+ wxBrush b (pad);
dc.SetPen (p);
dc.SetBrush (b);
int const gap = (panel_size.GetHeight() - out_size.height) / 2;
}
if (_viewer->outline_content()) {
- wxPen p (wxColour (255, 0, 0), 2);
+ wxPen p (outline_content_colour(), 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);
}
- optional<dcpomatic::Rect<double> > subs = _viewer->outline_subtitles();
+ auto subs = _viewer->outline_subtitles();
if (subs) {
- wxPen p (wxColour(0, 255, 0), 2);
+ wxPen p (outline_subtitles_colour(), 2);
dc.SetPen (p);
dc.SetBrush (*wxTRANSPARENT_BRUSH);
dc.DrawRectangle (subs->x * out_size.width, subs->y * out_size.height, subs->width * out_size.width, subs->height * out_size.height);
}
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 ();
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;
}
_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");