X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fvideo_view.cc;h=c271cb65e83e213edb54f566c5b4098b351b968f;hb=d4651b1595eb0aab4d956795f757302fef2f31d7;hp=387d4052fd87b1f02298b8c6ba8dbac083b43dc8;hpb=a7a8cd74f2f32de8b708c78cc8bc9c0cf17d60f5;p=dcpomatic.git diff --git a/src/wx/video_view.cc b/src/wx/video_view.cc index 387d4052f..c271cb65e 100644 --- a/src/wx/video_view.cc +++ b/src/wx/video_view.cc @@ -28,7 +28,6 @@ #include -using std::pair; using std::shared_ptr; using boost::optional; @@ -76,12 +75,12 @@ VideoView::get_next_frame (bool non_blocking) do { Butler::Error e; - auto pv = butler->get_video (!non_blocking, &e); - if (e.code == Butler::Error::DIED) { + auto pv = butler->get_video (non_blocking ? Butler::Behaviour::NON_BLOCKING : Butler::Behaviour::BLOCKING, &e); + if (e.code == Butler::Error::Code::DIED) { LOG_ERROR ("Butler died with %1", e.summary()); } if (!pv.first) { - return e.code == Butler::Error::AGAIN ? AGAIN : FAIL; + return e.code == Butler::Error::Code::AGAIN ? AGAIN : FAIL; } _player_video = pv; } while ( @@ -112,7 +111,7 @@ VideoView::time_until_next_frame () const { if (length() == dcpomatic::DCPTime()) { /* There's no content, so this doesn't matter */ - return optional(); + return {}; } auto const next = position() + one_video_frame(); @@ -173,3 +172,16 @@ VideoView::add_dropped () emit (boost::bind(boost::ref(TooManyDropped))); } } + + +wxColour +VideoView::pad_colour () const +{ + if (_viewer->pad_black()) { + return wxColour(0, 0, 0); + } else if (gui_is_dark()) { + return wxColour(50, 50, 50); + } else { + return wxColour(240, 240, 240); + } +}