summaryrefslogtreecommitdiff
path: root/src/wx
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-11-23 10:44:39 +0100
committerCarl Hetherington <cth@carlh.net>2020-01-08 21:56:47 +0100
commit1d796edf59da644e91bd443505fb76e0397a1439 (patch)
treef66ea71a218dc9b0392bc4d7e164760c76097fe2 /src/wx
parent89e92b3e7effafd2ca3aa1e9300777f2d2fb6183 (diff)
Basic stress-test function for player.
Diffstat (limited to 'src/wx')
-rw-r--r--src/wx/controls.cc10
-rw-r--r--src/wx/controls.h5
-rw-r--r--src/wx/standard_controls.cc16
-rw-r--r--src/wx/standard_controls.h5
4 files changed, 36 insertions, 0 deletions
diff --git a/src/wx/controls.cc b/src/wx/controls.cc
index 0c12ba463..27139f1f5 100644
--- a/src/wx/controls.cc
+++ b/src/wx/controls.cc
@@ -406,3 +406,13 @@ Controls::film_change (ChangeType type, Film::Property p)
}
}
}
+
+#ifdef DCPOMATIC_PLAYER_STRESS_TEST
+void
+Controls::seek (int slider)
+{
+ _slider->SetValue (slider);
+ slider_moved (false);
+ slider_released ();
+}
+#endif
diff --git a/src/wx/controls.h b/src/wx/controls.h
index 014464456..1b6a379cc 100644
--- a/src/wx/controls.h
+++ b/src/wx/controls.h
@@ -53,6 +53,11 @@ public:
virtual void log (wxString) {}
virtual void set_film (boost::shared_ptr<Film> film);
+#ifdef DCPOMATIC_PLAYER_STRESS_TEST
+ virtual void play () {};
+ virtual void stop () {};
+ void seek (int slider);
+#endif
boost::shared_ptr<Film> film () const;
void back_frame ();
void forward_frame ();
diff --git a/src/wx/standard_controls.cc b/src/wx/standard_controls.cc
index 956f82c96..e9a31c86b 100644
--- a/src/wx/standard_controls.cc
+++ b/src/wx/standard_controls.cc
@@ -74,3 +74,19 @@ StandardControls::setup_sensitivity ()
bool const active_job = _active_job && *_active_job != "examine_content";
_play_button->Enable (_film && !_film->content().empty() && !active_job);
}
+
+#ifdef DCPOMATIC_PLAYER_STRESS_TEST
+void
+StandardControls::play ()
+{
+ _play_button->SetValue (true);
+ play_clicked ();
+}
+
+void
+StandardControls::stop ()
+{
+ _play_button->SetValue (false);
+ play_clicked ();
+}
+#endif
diff --git a/src/wx/standard_controls.h b/src/wx/standard_controls.h
index b485c48cc..f79e4a178 100644
--- a/src/wx/standard_controls.h
+++ b/src/wx/standard_controls.h
@@ -25,6 +25,11 @@ class StandardControls : public Controls
public:
StandardControls (wxWindow* parent, boost::shared_ptr<FilmViewer> viewer, bool editor_controls);
+#ifdef DCPOMATIC_PLAYER_STRESS_TEST
+ void play ();
+ void stop ();
+#endif
+
private:
void check_play_state ();
void play_clicked ();