X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fwx%2Fcontrols.cc;h=3e06664607d8617a158af7fbe74780b3ebb84774;hb=4bef2e0b93f84ee98d7a3dccbfa5b13106f7a263;hp=01b689c9ec4db4f5b766a7d08b2d8e6a1bb487f4;hpb=c19a3e0b6fdd8b129caf7c56336215ba5df282ec;p=dcpomatic.git diff --git a/src/wx/controls.cc b/src/wx/controls.cc index 01b689c9e..3e0666460 100644 --- a/src/wx/controls.cc +++ b/src/wx/controls.cc @@ -120,6 +120,13 @@ Controls::Controls (wxWindow* parent, shared_ptr viewer, bool editor _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)); @@ -371,7 +378,10 @@ Controls::set_film (shared_ptr film) } _film = film; - _film_change_connection = _film->Change.connect (boost::bind(&Controls::film_change, this, _1, _2)); + + if (_film) { + _film_change_connection = _film->Change.connect (boost::bind(&Controls::film_change, this, _1, _2)); + } setup_sensitivity (); @@ -388,9 +398,13 @@ Controls::film () const void Controls::film_change (ChangeType type, Film::Property p) { - if (type == CHANGE_TYPE_DONE && p == Film::CONTENT) { - setup_sensitivity (); - update_position_label (); - update_position_slider (); + if (type == CHANGE_TYPE_DONE) { + if (p == Film::CONTENT) { + setup_sensitivity (); + update_position_label (); + update_position_slider (); + } else if (p == Film::THREE_D) { + setup_sensitivity (); + } } }