Rockbox Technical Forums

Support and General Use => Theming and Appearance Customization => Topic started by: ThisBoxRox on November 27, 2017, 04:42:45 AM

Title: Can I get elapsed/remaining time over 1 hour in minutes?
Post by: ThisBoxRox on November 27, 2017, 04:42:45 AM
On the WPS, when the elapsed and/or remaining times for the current file are over an hour, can I get those times in MM:SS instead of HH:MM:SS?  For example, instead of 1:23:45, I want 83:45.

Alternately, is there a way to get the elapsed/remaining time in seconds and perform arithmetic on them to get what I'm after?

Thank you.
Title: Re: Can I get elapsed/remaining time over 1 hour in minutes?
Post by: Bilgus on November 28, 2017, 12:29:40 AM
I really can't think of a way thats built-in to the theme system I can show you what you need to edit in the actual rockbox code to get what you are after but you will need to make your own custom build to do it
Title: Re: Can I get elapsed/remaining time over 1 hour in minutes?
Post by: ThisBoxRox on November 28, 2017, 04:24:32 PM
That's what I figured.  Thank you.
Title: Re: Can I get elapsed/remaining time over 1 hour in minutes?
Post by: Bilgus on November 28, 2017, 11:24:07 PM
here is the time format function WPS uses:
https://github.com/Rockbox/rockbox/blob/master/apps/misc.c#L1077

at line 1080 change
unsigned long hours = time / 3600;
to..
unsigned long hours = 0;

and if you want it to display 00:00 then at line 1085 change
t < 0, "-", hours, hashours, ":", hashours+1, minutes, seconds);
to..
t < 0, "-", hours, hashours, ":", hashours+2, minutes, seconds);