projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove C++17-ism.
[dcpomatic.git]
/
src
/
wx
/
standard_controls.cc
diff --git
a/src/wx/standard_controls.cc
b/src/wx/standard_controls.cc
index 956f82c961111619137d5616fcb454a36a4484f1..942c49fc4baf5b3d9fe1325c718efd8cd397d813 100644
(file)
--- a/
src/wx/standard_controls.cc
+++ b/
src/wx/standard_controls.cc
@@
-1,5
+1,5
@@
/*
/*
- Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2018
-2021
Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
This file is part of DCP-o-matic.
@@
-18,21
+18,29
@@
*/
*/
-#include "standard_controls.h"
+
#include "film_viewer.h"
#include "film_viewer.h"
-#include <wx/wx.h>
+#include "standard_controls.h"
+#include "lib/film.h"
+#include <dcp/warnings.h>
+LIBDCP_DISABLE_WARNINGS
#include <wx/tglbtn.h>
#include <wx/tglbtn.h>
+#include <wx/wx.h>
+LIBDCP_ENABLE_WARNINGS
+
-using
boost
::shared_ptr;
+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")))
{
: Controls (parent, viewer, editor_controls)
, _play_button (new wxToggleButton(this, wxID_ANY, _("Play")))
{
- _button_sizer->Add (_play_button, 0, wx
EXPAND
);
+ _button_sizer->Add (_play_button, 0, wx
ALL | wxALIGN_CENTER_VERTICAL, 2
);
_play_button->Bind (wxEVT_TOGGLEBUTTON, boost::bind(&StandardControls::play_clicked, this));
}
_play_button->Bind (wxEVT_TOGGLEBUTTON, boost::bind(&StandardControls::play_clicked, this));
}
+
void
StandardControls::started ()
{
void
StandardControls::started ()
{
@@
-40,6
+48,7
@@
StandardControls::started ()
_play_button->SetValue (true);
}
_play_button->SetValue (true);
}
+
void
StandardControls::stopped ()
{
void
StandardControls::stopped ()
{
@@
-47,12
+56,14
@@
StandardControls::stopped ()
_play_button->SetValue (false);
}
_play_button->SetValue (false);
}
+
void
StandardControls::play_clicked ()
{
check_play_state ();
}
void
StandardControls::play_clicked ()
{
check_play_state ();
}
+
void
StandardControls::check_play_state ()
{
void
StandardControls::check_play_state ()
{
@@
-61,12
+72,13
@@
StandardControls::check_play_state ()
}
if (_play_button->GetValue()) {
}
if (_play_button->GetValue()) {
- _viewer
->start
();
+ _viewer
.start
();
} else {
} else {
- _viewer
->stop
();
+ _viewer
.stop
();
}
}
}
}
+
void
StandardControls::setup_sensitivity ()
{
void
StandardControls::setup_sensitivity ()
{
@@
-74,3
+86,19
@@
StandardControls::setup_sensitivity ()
bool const active_job = _active_job && *_active_job != "examine_content";
_play_button->Enable (_film && !_film->content().empty() && !active_job);
}
bool const active_job = _active_job && *_active_job != "examine_content";
_play_button->Enable (_film && !_film->content().empty() && !active_job);
}
+
+
+void
+StandardControls::play ()
+{
+ _play_button->SetValue (true);
+ play_clicked ();
+}
+
+
+void
+StandardControls::stop ()
+{
+ _play_button->SetValue (false);
+ play_clicked ();
+}