More tidying up.
[dcpomatic.git] / src / wx / film_viewer.cc
index dcbfedc8194101fb2597dbf90c5adc7317a81edc..c7b32ff26f54cc0ed913199a7ff74c43ee1004a2 100644 (file)
@@ -334,6 +334,8 @@ FilmViewer::stop ()
        _playing = false;
        _video_view->stop ();
        Stopped (position());
+
+       _video_view->rethrow ();
        return true;
 }
 
@@ -379,6 +381,8 @@ FilmViewer::film_change (ChangeType type, Film::Property p)
                recreate_butler ();
        } else if (p == Film::VIDEO_FRAME_RATE) {
                _video_view->set_video_frame_rate (_film->video_frame_rate());
+       } else if (p == Film::THREE_D) {
+               _video_view->set_three_d (_film->three_d());
        }
 }
 
@@ -402,16 +406,7 @@ FilmViewer::slow_refresh ()
 bool
 FilmViewer::quick_refresh ()
 {
-       if (!_video_view->_player_video.first) {
-               return false;
-       }
-
-       if (!_video_view->_player_video.first->reset_metadata (_film, _player->video_container_size(), _film->frame_size())) {
-               return false;
-       }
-
-       _video_view->display_player_video ();
-       return true;
+       return _video_view->refresh_metadata (_film, _player->video_container_size(), _film->frame_size());
 }
 
 void
@@ -636,11 +631,21 @@ FilmViewer::set_pad_black (bool p)
        _pad_black = p;
 }
 
-/* May be called from a non-UI thread */
+/** Called when a player has finished the current film.
+ *  May be called from a non-UI thread.
+ */
 void
-FilmViewer::emit_finished ()
+FilmViewer::finished ()
 {
-       emit (boost::bind(boost::ref(Finished)));
+       emit (boost::bind(&FilmViewer::ui_finished, this));
+}
+
+/** Called by finished() in the UI thread */
+void
+FilmViewer::ui_finished ()
+{
+       stop ();
+       Finished ();
 }
 
 int