From a1142383960d0365b2ad0ff84c7461caa7f7e77c Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Tue, 31 Jan 2012 00:44:26 +0000 Subject: [PATCH] Use AssTime::GetASSFormated for the video position display Originally committed to SVN as r6399. --- aegisub/src/video_box.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/aegisub/src/video_box.cpp b/aegisub/src/video_box.cpp index b8141cfde..87b589a7a 100644 --- a/aegisub/src/video_box.cpp +++ b/aegisub/src/video_box.cpp @@ -72,11 +72,11 @@ static void add_button(wxWindow *parent, wxSizer *sizer, const char *command, ag wxBitmapButton *btn = new wxBitmapButton(parent, -1, c->Icon(24)); btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::tr1::bind(&cmd::Command::operator(), c, context)); ToolTipManager::Bind(btn, c->StrHelp(), "Video", command); - sizer->Add(btn, 0, wxTOP | wxLEFT | wxBOTTOM | wxALIGN_CENTER, 2);; + sizer->Add(btn, 0, wxTOP | wxLEFT | wxBOTTOM | wxALIGN_CENTER, 2); } VideoBox::VideoBox(wxWindow *parent, bool isDetached, agi::Context *context) -: wxPanel (parent,-1) +: wxPanel(parent,-1) , context(context) { // Buttons @@ -171,13 +171,8 @@ void VideoBox::UpdateTimeBoxes() { int frame = context->videoController->GetFrameN(); int time = context->videoController->TimeAtFrame(frame, agi::vfr::EXACT); - int h = time / 3600000; - int m = time % 3600000 / 60000; - int s = time % 60000 / 1000; - int ms = time % 1000; - // Set the text box for frame number and time - VideoPosition->SetValue(wxString::Format("%01i:%02i:%02i.%03i - %i", h, m, s, ms, frame)); + VideoPosition->SetValue(wxString::Format("%s - %d", AssTime(time).GetASSFormated(true), frame)); if (binary_search(context->videoController->GetKeyFrames().begin(), context->videoController->GetKeyFrames().end(), frame)) { // Set the background color to indicate this is a keyframe VideoPosition->SetBackgroundColour(lagi_wxColour(OPT_GET("Colour/Subtitle Grid/Background/Selection")->GetColour()));