projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add Version File dialog.
[dcpomatic.git]
/
src
/
wx
/
standard_controls.cc
diff --git
a/src/wx/standard_controls.cc
b/src/wx/standard_controls.cc
index c78844ca1bc3ddd14e1d463519b88d440ece9d42..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,14
+18,21
@@
*/
*/
-#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 std::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")))
{
@@
-33,6
+40,7
@@
StandardControls::StandardControls (wxWindow* parent, shared_ptr<FilmViewer> vie
_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 ()
{
@@
-75,6
+87,7
@@
StandardControls::setup_sensitivity ()
_play_button->Enable (_film && !_film->content().empty() && !active_job);
}
_play_button->Enable (_film && !_film->content().empty() && !active_job);
}
+
void
StandardControls::play ()
{
void
StandardControls::play ()
{
@@
-82,6
+95,7
@@
StandardControls::play ()
play_clicked ();
}
play_clicked ();
}
+
void
StandardControls::stop ()
{
void
StandardControls::stop ()
{