diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-10-12 01:03:28 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-10-14 11:41:18 +0200 |
| commit | 449f383f13e5755c523db11f9adef53b58391025 (patch) | |
| tree | 7751c6ede10455de02aa85dcd00d17109c9d57a6 /src/wx/standard_controls.cc | |
| parent | 5e640ac3e2f6d5fb079ff65659a1483ddac8672e (diff) | |
Cleanup: use simpler ownership for FilmViewer.
Diffstat (limited to 'src/wx/standard_controls.cc')
| -rw-r--r-- | src/wx/standard_controls.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/wx/standard_controls.cc b/src/wx/standard_controls.cc index a2914d77b..de63c2fce 100644 --- a/src/wx/standard_controls.cc +++ b/src/wx/standard_controls.cc @@ -31,7 +31,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 +66,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(); } } |
