#include "film_viewer.h"
#include "standard_controls.h"
+#include <dcp/warnings.h>
+LIBDCP_DISABLE_WARNINGS
#include <wx/tglbtn.h>
#include <wx/wx.h>
+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")))
{
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();
}
}