diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-06-20 23:23:07 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-06-20 23:23:07 +0100 |
| commit | 6d26c4afe1e2b63d346d311ceffe41bf8cb62572 (patch) | |
| tree | 008f32c75c2b9338d0e1ba9ff5c96e2662d7879d /src | |
| parent | dc1c279211773ad68cb0348eb802cf5c9594d8dd (diff) | |
Fix erroneous skip when changing things and re-getting the current frame.
Diffstat (limited to 'src')
| -rw-r--r-- | src/wx/film_viewer.cc | 9 | ||||
| -rw-r--r-- | src/wx/film_viewer.h | 5 |
2 files changed, 11 insertions, 3 deletions
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index c848fe09b..d84a0af34 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -63,6 +63,7 @@ FilmViewer::FilmViewer (shared_ptr<Film> f, wxWindow* p) , _frame_number (new wxStaticText (this, wxID_ANY, wxT(""))) , _timecode (new wxStaticText (this, wxID_ANY, wxT(""))) , _play_button (new wxToggleButton (this, wxID_ANY, _("Play"))) + , _last_get_accurate (true) { #ifndef __WXOSX__ _panel->SetDoubleBuffered (true); @@ -140,7 +141,7 @@ FilmViewer::set_film (shared_ptr<Film> f) _player->Changed.connect (boost::bind (&FilmViewer::player_changed, this, _1)); calculate_sizes (); - get (_position, true); + get (_position, _last_get_accurate); } void @@ -163,6 +164,8 @@ FilmViewer::get (DCPTime p, bool accurate) set_position_text (); _panel->Refresh (); _panel->Update (); + + _last_get_accurate = accurate; } void @@ -234,7 +237,7 @@ FilmViewer::panel_sized (wxSizeEvent& ev) _panel_size.width = ev.GetSize().GetWidth(); _panel_size.height = ev.GetSize().GetHeight(); calculate_sizes (); - get (_position, true); + get (_position, _last_get_accurate); } void @@ -362,5 +365,5 @@ FilmViewer::player_changed (bool frequent) } calculate_sizes (); - get (_position, true); + get (_position, _last_get_accurate); } diff --git a/src/wx/film_viewer.h b/src/wx/film_viewer.h index 950758f61..c1c087a14 100644 --- a/src/wx/film_viewer.h +++ b/src/wx/film_viewer.h @@ -75,4 +75,9 @@ private: dcp::Size _out_size; /** Size of the panel that we have available */ dcp::Size _panel_size; + /** true if the last call to ::get() was specified to be accurate; + * this is used so that when re-fetching the current frame we + * can get the same one that we got last time. + */ + bool _last_get_accurate; }; |
