summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-06-18 12:43:38 +0100
committerCarl Hetherington <cth@carlh.net>2015-06-18 12:43:38 +0100
commit94f27fed01e1f4c9cb876fa5594d11e2bbe3f7bd (patch)
tree61c904406e58159893547d810d58642aac713a44
parent7e55cf88e70ce493ddf71211495b0f5eb56ca565 (diff)
Stop playback when we reach the end of the playlist.
-rw-r--r--ChangeLog4
-rw-r--r--src/wx/film_viewer.cc10
2 files changed, 13 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 2b0f1fef6..de25e3146 100644
--- 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
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc
index 1632a45be..07c64886e 100644
--- a/src/wx/film_viewer.cc
+++ b/src/wx/film_viewer.cc
@@ -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 ();
}