Use AssTime::GetASSFormated for the video position display

Originally committed to SVN as r6399.
This commit is contained in:
Thomas Goyne 2012-01-31 00:44:26 +00:00
parent 725820efc0
commit a114238396

View file

@ -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)); wxBitmapButton *btn = new wxBitmapButton(parent, -1, c->Icon(24));
btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::tr1::bind(&cmd::Command::operator(), c, context)); btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::tr1::bind(&cmd::Command::operator(), c, context));
ToolTipManager::Bind(btn, c->StrHelp(), "Video", command); 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) VideoBox::VideoBox(wxWindow *parent, bool isDetached, agi::Context *context)
: wxPanel (parent,-1) : wxPanel(parent,-1)
, context(context) , context(context)
{ {
// Buttons // Buttons
@ -171,13 +171,8 @@ void VideoBox::UpdateTimeBoxes() {
int frame = context->videoController->GetFrameN(); int frame = context->videoController->GetFrameN();
int time = context->videoController->TimeAtFrame(frame, agi::vfr::EXACT); 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 // 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)) { if (binary_search(context->videoController->GetKeyFrames().begin(), context->videoController->GetKeyFrames().end(), frame)) {
// Set the background color to indicate this is a keyframe // Set the background color to indicate this is a keyframe
VideoPosition->SetBackgroundColour(lagi_wxColour(OPT_GET("Colour/Subtitle Grid/Background/Selection")->GetColour())); VideoPosition->SetBackgroundColour(lagi_wxColour(OPT_GET("Colour/Subtitle Grid/Background/Selection")->GetColour()));