new feature: display remaining time of song instead of elapsed time

This commit is contained in:
Andrzej Rybczak
2009-08-26 03:06:27 +02:00
parent e89d2492bf
commit 8c3760111d
6 changed files with 43 additions and 4 deletions

View File

@@ -1115,7 +1115,13 @@ int main(int argc, char *argv[])
*wFooter << fmtBold;
if (Config.new_design)
{
tracklength = Song::ShowTime(songpos);
if (Config.display_remaining_time)
{
tracklength = "-";
tracklength += Song::ShowTime(s->GetTotalLength()-songpos);
}
else
tracklength = Song::ShowTime(songpos);
tracklength += "/";
tracklength += s->GetLength();
*wHeader << XY(0, 0) << tracklength << " ";
@@ -1123,7 +1129,17 @@ int main(int argc, char *argv[])
}
else
{
tracklength = "[" + Song::ShowTime(songpos) + "/" + s->GetLength() + "]";
tracklength = "[";
if (Config.display_remaining_time)
{
tracklength += "-";
tracklength += Song::ShowTime(s->GetTotalLength()-songpos);
}
else
tracklength = Song::ShowTime(songpos);
tracklength += "/";
tracklength += s->GetLength();
tracklength += "]";
*wFooter << XY(wFooter->GetWidth()-tracklength.length(), 1) << tracklength;
}
double progressbar_size = songpos/double(s->GetTotalLength());