#include "film_viewer.h"
#include "standard_controls.h"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/tglbtn.h>
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
using std::shared_ptr;
void
StandardControls::check_play_state ()
{
- if (!_film || _film->video_frame_rate() == 0) {
+ auto viewer = _viewer.lock ();
+ if (!_film || _film->video_frame_rate() == 0 || !viewer) {
return;
}
if (_play_button->GetValue()) {
- _viewer->start ();
+ viewer->start ();
} else {
- _viewer->stop ();
+ viewer->stop ();
}
}