Stop playback when we reach the end of the playlist.
authorCarl Hetherington <cth@carlh.net>
Thu, 18 Jun 2015 11:43:38 +0000 (12:43 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 18 Jun 2015 11:43:38 +0000 (12:43 +0100)
ChangeLog
src/wx/film_viewer.cc

index 2b0f1fef6eb9f7a2e3a1b1047170ce6c05244620..de25e314660a89aae6c2149f11e4e19b91d427c4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2015-06-18  Carl Hetherington  <cth@carlh.net>
+
+       * Stop playback when we reach the end of the film.
+
 2015-06-16  c.hetherington  <cth@carlh.net>
 
        * Prevent selection of fewer DCP channels than
index 1632a45bea3e7478cb045ba8dcb6a4d7b5eaf8e4..07c64886e2577ee3e1ec9ccecf9c800e7ebaa6c4 100644 (file)
@@ -221,7 +221,15 @@ FilmViewer::get (DCPTime p, bool accurate)
 void
 FilmViewer::timer ()
 {
-       get (_position + DCPTime::from_frames (1, _film->video_frame_rate ()), true);
+       DCPTime const frame = DCPTime::from_frames (1, _film->video_frame_rate ());
+
+       if ((_position + frame) >= _film->length ()) {
+               _play_button->SetValue (false);
+               check_play_state ();
+       } else {
+               get (_position + frame, true);
+       }
+       
        update_position_label ();
        update_position_slider ();
 }