X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fstandard_controls.cc;h=942c49fc4baf5b3d9fe1325c718efd8cd397d813;hb=0a8bc96b4211eebfffaeebe8a24909aa3159d082;hp=c78844ca1bc3ddd14e1d463519b88d440ece9d42;hpb=dd9be86db6cde0afa5da0d1d1ac43b42e05dca26;p=dcpomatic.git diff --git a/src/wx/standard_controls.cc b/src/wx/standard_controls.cc index c78844ca1..942c49fc4 100644 --- a/src/wx/standard_controls.cc +++ b/src/wx/standard_controls.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2018 Carl Hetherington + Copyright (C) 2018-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -18,14 +18,21 @@ */ -#include "standard_controls.h" + #include "film_viewer.h" -#include +#include "standard_controls.h" +#include "lib/film.h" +#include +LIBDCP_DISABLE_WARNINGS #include +#include +LIBDCP_ENABLE_WARNINGS + using std::shared_ptr; -StandardControls::StandardControls (wxWindow* parent, shared_ptr 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"))) { @@ -33,6 +40,7 @@ StandardControls::StandardControls (wxWindow* parent, shared_ptr vie _play_button->Bind (wxEVT_TOGGLEBUTTON, boost::bind(&StandardControls::play_clicked, this)); } + void StandardControls::started () { @@ -40,6 +48,7 @@ StandardControls::started () _play_button->SetValue (true); } + void StandardControls::stopped () { @@ -47,12 +56,14 @@ StandardControls::stopped () _play_button->SetValue (false); } + void StandardControls::play_clicked () { check_play_state (); } + void StandardControls::check_play_state () { @@ -61,12 +72,13 @@ StandardControls::check_play_state () } if (_play_button->GetValue()) { - _viewer->start (); + _viewer.start(); } else { - _viewer->stop (); + _viewer.stop(); } } + void StandardControls::setup_sensitivity () { @@ -75,6 +87,7 @@ StandardControls::setup_sensitivity () _play_button->Enable (_film && !_film->content().empty() && !active_job); } + void StandardControls::play () { @@ -82,6 +95,7 @@ StandardControls::play () play_clicked (); } + void StandardControls::stop () {