Ubuntu 20.04 packaging.
[dcpomatic.git] / src / wx / controls.cc
index 71af4e8cf28f53f7e1a09561616918a04aaf6d43..ec6d4ff4c523435b68ba9df23678a9fc8f4b313c 100644 (file)
@@ -120,14 +120,7 @@ Controls::Controls (wxWindow* parent, shared_ptr<FilmViewer> viewer, bool editor
        _slider->Bind           (wxEVT_SCROLL_THUMBTRACK,    boost::bind(&Controls::slider_moved,    this, false));
        _slider->Bind           (wxEVT_SCROLL_PAGEUP,        boost::bind(&Controls::slider_moved,    this, true));
        _slider->Bind           (wxEVT_SCROLL_PAGEDOWN,      boost::bind(&Controls::slider_moved,    this, true));
-       _slider->Bind           (wxEVT_SCROLL_CHANGED,       boost::bind(&Controls::slider_released, this));
-#ifdef DCPOMATIC_OSX
-       /* _CHANGED is not received on OS X (at least, not when the
-          slider is dragged), so use this instead.  Perhaps all
-          platforms could just use _THUMBRELEASE.
-       */
        _slider->Bind           (wxEVT_SCROLL_THUMBRELEASE,  boost::bind(&Controls::slider_released, this));
-#endif
        _rewind_button->Bind    (wxEVT_LEFT_DOWN,            boost::bind(&Controls::rewind_clicked,  this, _1));
        _back_button->Bind      (wxEVT_LEFT_DOWN,            boost::bind(&Controls::back_clicked,    this, _1));
        _forward_button->Bind   (wxEVT_LEFT_DOWN,            boost::bind(&Controls::forward_clicked, this, _1));
@@ -177,7 +170,7 @@ Controls::stopped ()
 void
 Controls::update_position ()
 {
-       if (!_slider_being_moved) {
+       if (!_slider_being_moved && !_viewer->pending_idle_get()) {
                update_position_label ();
                update_position_slider ();
        }
@@ -413,3 +406,11 @@ Controls::film_change (ChangeType type, Film::Property p)
                }
        }
 }
+
+void
+Controls::seek (int slider)
+{
+       _slider->SetValue (slider);
+       slider_moved (false);
+       slider_released ();
+}