- lcd4l: extending duration file; ...

Line 1: done/total
Line 2: done
Line 3: todo
Line 4: total

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
svenhoefer
2022-01-30 22:57:19 +01:00
committed by Thilo Graf
parent 96b2d4f816
commit 165d5c0941
2 changed files with 21 additions and 5 deletions

View File

@@ -974,7 +974,11 @@ void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun)
done = 0; done = 0;
todo = cur_duration / 60; todo = cur_duration / 60;
} }
snprintf(Duration, sizeof(Duration), "%d/%d", done, total); snprintf(Duration, sizeof(Duration), "%d/%d\n%d\n%d\n%d",
done, total,
done,
todo,
total);
} }
tm_struct = localtime(&cur_start_time); tm_struct = localtime(&cur_start_time);
@@ -1014,11 +1018,17 @@ void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun)
time_t total = meta.total_time; time_t total = meta.total_time;
time_t done = CAudioPlayer::getInstance()->getTimePlayed(); time_t done = CAudioPlayer::getInstance()->getTimePlayed();
time_t todo = total - done;
if ((total > 0) && (done > 0)) if ((total > 0) && (done > 0))
{ {
Progress = 100 * done / total; Progress = 100 * done / total;
snprintf(Duration, sizeof(Duration), "%ld:%02ld/%ld:%02ld", done / 60, done % 60, total / 60, total % 60);
snprintf(Duration, sizeof(Duration), "%ld:%02ld/%ld:%02ld\n%ld:%02ld\n%ld:%02ld\n%ld:%02ld",
done / 60, done % 60, total / 60, total % 60,
done / 60, done % 60,
todo / 60, todo % 60,
total / 60, total % 60);
} }
} }
@@ -1054,10 +1064,16 @@ void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun)
if (!ModeTshift) if (!ModeTshift)
{ {
Progress = CMoviePlayerGui::getInstance().file_prozent;
int total = CMoviePlayerGui::getInstance().GetDuration(); int total = CMoviePlayerGui::getInstance().GetDuration();
int done = CMoviePlayerGui::getInstance().GetPosition(); int done = CMoviePlayerGui::getInstance().GetPosition();
snprintf(Duration, sizeof(Duration), "%d/%d", done / (60 * 1000), total / (60 * 1000)); int todo = total - done;
Progress = CMoviePlayerGui::getInstance().file_prozent; snprintf(Duration, sizeof(Duration), "%d/%d\n%d\n%d\n%d",
done / (60 * 1000), total / (60 * 1000),
done / (60 * 1000),
todo / (60 * 1000),
total / (60 * 1000));
} }
time_t sTime = time(NULL); time_t sTime = time(NULL);

View File

@@ -146,7 +146,7 @@ class CLCD4l
std::string m_Info1; std::string m_Info1;
std::string m_Info2; std::string m_Info2;
int m_Progress; int m_Progress;
char m_Duration[24]; char m_Duration[128];
std::string m_Start; std::string m_Start;
std::string m_End; std::string m_End;