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

@@ -415,7 +415,13 @@ void NcmpcppStatusChanged(Connection *, StatusChanges changed, void *)
std::string tracklength;
if (Config.new_design)
{
tracklength = Song::ShowTime(elapsed);
if (Config.display_remaining_time)
{
tracklength = "-";
tracklength += Song::ShowTime(np.GetTotalLength()-elapsed);
}
else
tracklength = Song::ShowTime(elapsed);
if (np.GetTotalLength())
{
tracklength += "/";
@@ -466,7 +472,13 @@ void NcmpcppStatusChanged(Connection *, StatusChanges changed, void *)
tracklength += " [";
if (np.GetTotalLength())
{
tracklength += Song::ShowTime(elapsed);
if (Config.display_remaining_time)
{
tracklength += "-";
tracklength += Song::ShowTime(np.GetTotalLength()-elapsed);
}
else
tracklength += Song::ShowTime(elapsed);
tracklength += "/";
tracklength += np.GetLength();
tracklength += "]";