X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fwx%2Fstandard_controls.cc;h=de63c2fce8da83ab32e74aa6708ff3eca3c07960;hb=449f383f13e5755c523db11f9adef53b58391025;hp=e9a31c86b059d94fb2c802b5f46d63ae8488e421;hpb=1d796edf59da644e91bd443505fb76e0397a1439;p=dcpomatic.git diff --git a/src/wx/standard_controls.cc b/src/wx/standard_controls.cc index e9a31c86b..de63c2fce 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,21 +18,28 @@ */ -#include "standard_controls.h" + #include "film_viewer.h" -#include +#include "standard_controls.h" +#include +LIBDCP_DISABLE_WARNINGS #include +#include +LIBDCP_ENABLE_WARNINGS + + +using std::shared_ptr; -using boost::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"))) { - _button_sizer->Add (_play_button, 0, wxEXPAND); + _button_sizer->Add (_play_button, 0, wxALL | wxALIGN_CENTER_VERTICAL, 2); _play_button->Bind (wxEVT_TOGGLEBUTTON, boost::bind(&StandardControls::play_clicked, this)); } + void StandardControls::started () { @@ -40,6 +47,7 @@ StandardControls::started () _play_button->SetValue (true); } + void StandardControls::stopped () { @@ -47,12 +55,14 @@ StandardControls::stopped () _play_button->SetValue (false); } + void StandardControls::play_clicked () { check_play_state (); } + void StandardControls::check_play_state () { @@ -61,12 +71,13 @@ StandardControls::check_play_state () } if (_play_button->GetValue()) { - _viewer->start (); + _viewer.start(); } else { - _viewer->stop (); + _viewer.stop(); } } + void StandardControls::setup_sensitivity () { @@ -75,7 +86,7 @@ StandardControls::setup_sensitivity () _play_button->Enable (_film && !_film->content().empty() && !active_job); } -#ifdef DCPOMATIC_PLAYER_STRESS_TEST + void StandardControls::play () { @@ -83,10 +94,10 @@ StandardControls::play () play_clicked (); } + void StandardControls::stop () { _play_button->SetValue (false); play_clicked (); } -#endif