X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Ffilm_viewer.cc;h=9b648a8b970ed28c3fb031a72e70d9b18d8ef237;hb=a978f3ac575f1af017002c861480d5203cf0a34e;hp=6f29bcc33b4b40cb045d59067e7d093ba156557f;hpb=c5b9ad09ab5eaf032b0816f619ab5d75254e8597;p=dcpomatic.git diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index 6f29bcc33..9b648a8b9 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -155,7 +155,7 @@ FilmViewer::set_film (shared_ptr film) _player_connection = _player->Changed.connect (boost::bind (&FilmViewer::player_changed, this, _1)); calculate_sizes (); - get (_position, _last_get_accurate); + refresh (); setup_sensitivity (); } @@ -184,6 +184,7 @@ FilmViewer::get (DCPTime p, bool accurate) if (!pvf.empty ()) { try { _frame = pvf.front()->image (PIX_FMT_RGB24, boost::bind (&Log::dcp_log, _film->log().get(), _1, _2)); + ImageChanged (pvf.front ()); dcp::YUVToRGB yuv_to_rgb = dcp::YUV_TO_RGB_REC601; if (pvf.front()->colour_conversion()) { @@ -295,7 +296,7 @@ FilmViewer::panel_sized (wxSizeEvent& ev) _panel_size.height = ev.GetSize().GetHeight(); calculate_sizes (); - get (_position, _last_get_accurate); + refresh (); update_position_label (); update_position_slider (); } @@ -418,7 +419,12 @@ FilmViewer::back_clicked () void FilmViewer::forward_clicked () { - get (_position + DCPTime::from_frames (1, _film->video_frame_rate ()), true); + DCPTime p = _position + DCPTime::from_frames (1, _film->video_frame_rate ()); + if (p >= _film->length ()) { + p = _position; + } + + get (p, true); update_position_label (); update_position_slider (); } @@ -431,7 +437,7 @@ FilmViewer::player_changed (bool frequent) } calculate_sizes (); - get (_position, _last_get_accurate); + refresh (); update_position_label (); update_position_slider (); } @@ -457,3 +463,10 @@ FilmViewer::film_changed (Film::Property p) setup_sensitivity (); } } + +/** Re-get the current frame */ +void +FilmViewer::refresh () +{ + get (_position, _last_get_accurate); +}