X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fsimple_video_view.cc;h=768c320875bc52c9f059cf0c66fc308ee50b629b;hb=cef7a679a59044a5c807768042deecfd56ec6fc2;hp=e349b865cf03185531318a20eae95a7bda40bf29;hpb=89e92b3e7effafd2ca3aa1e9300777f2d2fb6183;p=dcpomatic.git diff --git a/src/wx/simple_video_view.cc b/src/wx/simple_video_view.cc index e349b865c..768c32087 100644 --- a/src/wx/simple_video_view.cc +++ b/src/wx/simple_video_view.cc @@ -85,10 +85,10 @@ SimpleVideoView::paint () #ifdef DCPOMATIC_VARIANT_SWAROOP DCPTime const period = DCPTime::from_seconds(Config::instance()->player_watermark_period() * 60); - int64_t n = _viewer->position().get() / period.get(); + int64_t n = position().get() / period.get(); DCPTime from(n * period.get()); DCPTime to = from + DCPTime::from_seconds(Config::instance()->player_watermark_duration() / 1000.0); - if (from <= _viewer->position() && _viewer->position() <= to) { + if (from <= position() && position() <= to) { if (!_in_watermark) { _in_watermark = true; _watermark_x = rand() % panel_size.GetWidth(); @@ -130,6 +130,15 @@ SimpleVideoView::paint () 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 > subs = _viewer->outline_subtitles(); + if (subs) { + wxPen p (wxColour(0, 255, 0), 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); + } + _state_timer.unset(); } @@ -150,16 +159,15 @@ SimpleVideoView::timer () } display_next_frame (false); - DCPTime const next = _viewer->position() + _viewer->one_video_frame(); + DCPTime const next = position() + _viewer->one_video_frame(); if (next >= length()) { - _viewer->stop (); - _viewer->Finished (); + _viewer->finished (); return; } LOG_DEBUG_PLAYER("%1 -> %2; delay %3", next.seconds(), _viewer->time().seconds(), max((next.seconds() - _viewer->time().seconds()) * 1000, 1.0)); - _timer.Start (time_until_next_frame().get_value_or(0), wxTIMER_ONE_SHOT); + _timer.Start (max(1, time_until_next_frame().get_value_or(0)), wxTIMER_ONE_SHOT); if (_viewer->butler()) { _viewer->butler()->rethrow ();