From: Carl Hetherington Date: Mon, 10 Sep 2018 22:47:57 +0000 (+0100) Subject: Fix play button behaviour. X-Git-Tag: v2.13.49~16 X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=195eb8204245c7b7765831d1cc1de295b63eb8a2 Fix play button behaviour. --- diff --git a/src/wx/control_film_viewer.cc b/src/wx/control_film_viewer.cc index 69b2b5b5c..739b02765 100644 --- a/src/wx/control_film_viewer.cc +++ b/src/wx/control_film_viewer.cc @@ -96,6 +96,8 @@ ControlFilmViewer::ControlFilmViewer (wxWindow* parent, bool outline_content, bo _viewer->ImageChanged.connect (boost::bind(&ControlFilmViewer::image_changed, this, _1)); _viewer->PositionChanged.connect (boost::bind(&ControlFilmViewer::position_changed, this)); + _viewer->Started.connect (boost::bind(&ControlFilmViewer::started, this)); + _viewer->Stopped.connect (boost::bind(&ControlFilmViewer::stopped, this)); set_film (shared_ptr ()); @@ -106,6 +108,18 @@ ControlFilmViewer::ControlFilmViewer (wxWindow* parent, bool outline_content, bo ); } +void +ControlFilmViewer::started () +{ + _play_button->SetValue (true); +} + +void +ControlFilmViewer::stopped () +{ + _play_button->SetValue (false); +} + void ControlFilmViewer::position_changed () { @@ -380,14 +394,12 @@ ControlFilmViewer::show_closed_captions () void ControlFilmViewer::start () { - _play_button->SetValue (true); _viewer->start (); } bool ControlFilmViewer::stop () { - _play_button->SetValue (false); return _viewer->stop (); } diff --git a/src/wx/control_film_viewer.h b/src/wx/control_film_viewer.h index b3ad701d8..cef5cb552 100644 --- a/src/wx/control_film_viewer.h +++ b/src/wx/control_film_viewer.h @@ -58,6 +58,8 @@ private: void outline_content_changed (); void eye_changed (); void position_changed (); + void started (); + void stopped (); boost::shared_ptr _film; boost::shared_ptr _viewer; diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index b7e414444..85b0effbe 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -411,6 +411,7 @@ FilmViewer::start () _playing = true; _dropped = 0; timer (); + Started (); } bool @@ -426,6 +427,7 @@ FilmViewer::stop () } _playing = false; + Stopped (); return true; } diff --git a/src/wx/film_viewer.h b/src/wx/film_viewer.h index c68b6ade0..d080c79a5 100644 --- a/src/wx/film_viewer.h +++ b/src/wx/film_viewer.h @@ -95,6 +95,8 @@ public: boost::signals2::signal)> ImageChanged; boost::signals2::signal PositionChanged; + boost::signals2::signal Started; + boost::signals2::signal Stopped; private: void paint_panel ();