+
+ calculate_sizes ();
+ bool refreshed = false;
+ if (
+ property == VideoContentProperty::CROP ||
+ property == VideoContentProperty::SCALE ||
+ property == VideoContentProperty::FADE_IN ||
+ property == VideoContentProperty::FADE_OUT ||
+ property == VideoContentProperty::COLOUR_CONVERSION ||
+ property == PlayerProperty::VIDEO_CONTAINER_SIZE ||
+ property == PlayerProperty::FILM_CONTAINER
+ ) {
+ refreshed = quick_refresh ();
+ }
+
+ if (!refreshed) {
+ slow_refresh ();
+ }
+ update_position_label ();
+ update_position_slider ();
+}
+
+void
+FilmViewer::setup_sensitivity ()
+{
+ bool const c = _film && !_film->content().empty ();
+
+ _slider->Enable (c);
+ _rewind_button->Enable (c);
+ _back_button->Enable (c);
+ _forward_button->Enable (c);
+ _play_button->Enable (c);
+ if (_outline_content) {
+ _outline_content->Enable (c);
+ }
+ _frame_number->Enable (c);
+ _timecode->Enable (c);
+ if (_jump_to_selected) {
+ _jump_to_selected->Enable (c);
+ }
+
+ _left_eye->Enable (c && _film->three_d ());
+ _right_eye->Enable (c && _film->three_d ());
+}
+
+void
+FilmViewer::film_changed (Film::Property p)
+{
+ if (p == Film::CONTENT || p == Film::THREE_D) {
+ setup_sensitivity ();
+ } else if (p == Film::AUDIO_CHANNELS) {
+ recreate_butler ();
+ }
+}
+
+/** Re-get the current frame slowly by seeking */
+void
+FilmViewer::slow_refresh ()
+{
+ seek (_video_position, true);
+}
+
+/** Try to re-get the current frame quickly by resetting the metadata
+ * in the PlayerVideo that we used last time.
+ * @return true if this was possible, false if not.
+ */
+bool
+FilmViewer::quick_refresh ()
+{
+ if (!_player_video.first) {
+ return false;
+ }
+
+ if (!_player_video.first->reset_metadata (_player->video_container_size(), _film->frame_size())) {
+ return false;
+ }
+
+ display_player_video ();
+ return true;
+}
+
+void
+FilmViewer::set_position (DCPTime p)
+{
+ _video_position = p;
+ seek (p, true);
+ update_position_label ();
+ update_position_slider ();
+}
+
+void
+FilmViewer::set_coalesce_player_changes (bool c)
+{
+ _coalesce_player_changes = c;
+
+ if (!c) {
+ BOOST_FOREACH (int i, _pending_player_changes) {
+ player_changed (i, false);
+ }
+ _pending_player_changes.clear ();
+ }
+}
+
+void
+FilmViewer::timecode_clicked ()
+{
+ PlayheadToTimecodeDialog* dialog = new PlayheadToTimecodeDialog (this, _film->video_frame_rate ());
+ if (dialog->ShowModal() == wxID_OK) {
+ go_to (dialog->get ());
+ }
+ dialog->Destroy ();
+}
+
+void
+FilmViewer::frame_number_clicked ()
+{
+ PlayheadToFrameDialog* dialog = new PlayheadToFrameDialog (this, _film->video_frame_rate ());
+ if (dialog->ShowModal() == wxID_OK) {
+ go_to (dialog->get ());