: wxPanel (p)
, _panel (new wxPanel (this))
, _slider (new wxSlider (this, wxID_ANY, 0, 0, 4096))
+ , _frame (new wxStaticText (this, wxID_ANY, wxT("")))
+ , _timecode (new wxStaticText (this, wxID_ANY, wxT("")))
, _play_button (new wxToggleButton (this, wxID_ANY, _("Play")))
, _display_frame_x (0)
, _got_frame (false)
_v_sizer->Add (_panel, 1, wxEXPAND);
wxBoxSizer* h_sizer = new wxBoxSizer (wxHORIZONTAL);
+
+ wxBoxSizer* time_sizer = new wxBoxSizer (wxVERTICAL);
+ time_sizer->Add (_frame, 0, wxEXPAND);
+ time_sizer->Add (_timecode, 0, wxEXPAND);
+
+ h_sizer->Add (time_sizer, 0, wxEXPAND);
h_sizer->Add (_play_button, 0, wxEXPAND);
h_sizer->Add (_slider, 1, wxEXPAND);
_v_sizer->Add (h_sizer, 0, wxEXPAND | wxALL, 6);
+ _frame->SetMinSize (wxSize (84, -1));
+
_panel->Connect (wxID_ANY, wxEVT_PAINT, wxPaintEventHandler (FilmViewer::paint_panel), 0, this);
_panel->Connect (wxID_ANY, wxEVT_SIZE, wxSizeEventHandler (FilmViewer::panel_sized), 0, this);
_slider->Connect (wxID_ANY, wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler (FilmViewer::slider_moved), 0, this);
raw_to_display ();
_got_frame = true;
+
+ double const t = _decoders.video->last_source_time ();
+ double const fps = _decoders.video->frames_per_second ();
+ _frame->SetLabel (wxString::Format ("%d", int (rint (t * fps))));
+
+ double w = t;
+ int const h = (w / 3600);
+ w -= h * 3600;
+ int const m = (w / 60);
+ w -= m * 60;
+ int const s = floor (w);
+ w -= s;
+ int const f = rint (w * fps);
+ _timecode->SetLabel (wxString::Format ("%02d:%02d:%02d:%02d", h, m, s, f));
}
void