Fixed: Displaying song playtime
--HG-- branch : develop
This commit is contained in:
parent
6c8e42361a
commit
6a6ce67a58
1 changed files with 7 additions and 2 deletions
|
@ -284,8 +284,13 @@ void CMusicPlayer::update ()
|
||||||
if (pVT)
|
if (pVT)
|
||||||
{
|
{
|
||||||
TTime dur = (CTime::getLocalTime() - _PlayStart) / 1000;
|
TTime dur = (CTime::getLocalTime() - _PlayStart) / 1000;
|
||||||
std::string title;
|
uint min = (dur / 60) % 60;
|
||||||
title = toString("%02d:%02d %s", dur / 60, dur % 60, _CurrentSong.Title.c_str());
|
uint sec = dur % 60;
|
||||||
|
uint hour = dur / 3600;
|
||||||
|
|
||||||
|
std::string title(toString("%02d:%02d", min, sec));
|
||||||
|
if (hour > 0) title = toString("%02d:", hour) + title;
|
||||||
|
title += " " + _CurrentSong.Title;
|
||||||
pVT->setText(ucstring::makeFromUtf8(title));
|
pVT->setText(ucstring::makeFromUtf8(title));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue