_frame.reset ();
- update_position ();
+ update_position_slider ();
+ update_position_label ();
if (!_film) {
return;
_position = p;
}
- update_position ();
refresh_panel ();
_last_get_accurate = accurate;
FilmViewer::timer ()
{
get (_position + DCPTime::from_frames (1, _film->video_frame_rate ()), true);
+ update_position_label ();
+ update_position_slider ();
}
void
t = _film->length() - DCPTime::from_frames (1, _film->video_frame_rate ());
}
get (t, false);
+ update_position_label ();
}
void
calculate_sizes ();
get (_position, _last_get_accurate);
+ update_position_label ();
+ update_position_slider ();
}
void
}
void
-FilmViewer::update_position ()
+FilmViewer::update_position_slider ()
{
if (!_film) {
_slider->SetValue (0);
- _frame_number->SetLabel ("0");
- _timecode->SetLabel ("0:0:0.0");
return;
}
-
+
DCPTime const len = _film->length ();
if (len.get ()) {
_slider->SetValue (new_slider_position);
}
}
-
+}
+
+void
+FilmViewer::update_position_label ()
+{
+ if (!_film) {
+ _frame_number->SetLabel ("0");
+ _timecode->SetLabel ("0:0:0.0");
+ return;
+ }
+
double const fps = _film->video_frame_rate ();
/* Count frame number from 1 ... not sure if this is the best idea */
_frame_number->SetLabel (wxString::Format (wxT("%d"), int (rint (_position.seconds() * fps)) + 1));
}
get (p, true);
+ update_position_label ();
+ update_position_slider ();
}
void
FilmViewer::forward_clicked ()
{
get (_position + DCPTime::from_frames (1, _film->video_frame_rate ()), true);
+ update_position_label ();
+ update_position_slider ();
}
void
calculate_sizes ();
get (_position, _last_get_accurate);
+ update_position_label ();
+ update_position_slider ();
}
void