Note that newer libsub version is required.
[dcpomatic.git] / src / wx / standard_controls.cc
index a2914d77ba0727f866bf1b874e63e9babd2b50a2..942c49fc4baf5b3d9fe1325c718efd8cd397d813 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "film_viewer.h"
 #include "standard_controls.h"
+#include "lib/film.h"
 #include <dcp/warnings.h>
 LIBDCP_DISABLE_WARNINGS
 #include <wx/tglbtn.h>
@@ -31,7 +32,7 @@ LIBDCP_ENABLE_WARNINGS
 using std::shared_ptr;
 
 
-StandardControls::StandardControls (wxWindow* parent, shared_ptr<FilmViewer> viewer, bool editor_controls)
+StandardControls::StandardControls(wxWindow* parent, FilmViewer& viewer, bool editor_controls)
        : Controls (parent, viewer, editor_controls)
        , _play_button (new wxToggleButton(this, wxID_ANY, _("Play")))
 {
@@ -66,15 +67,14 @@ StandardControls::play_clicked ()
 void
 StandardControls::check_play_state ()
 {
-       auto viewer = _viewer.lock ();
-       if (!_film || _film->video_frame_rate() == 0 || !viewer) {
+       if (!_film || _film->video_frame_rate() == 0) {
                return;
        }
 
        if (_play_button->GetValue()) {
-               viewer->start ();
+               _viewer.start();
        } else {
-               viewer->stop ();
+               _viewer.stop();
        }
 }