Rockbox Technical Forums

Support and General Use => Theming and Appearance Customization => Topic started by: cE10 on July 22, 2010, 10:30:48 AM

Title: WPS: Total Time / Elapsed Time / Remaining Time for Whole Playlist?
Post by: cE10 on July 22, 2010, 10:30:48 AM
Hi all,

In my WPS, I have the Total Time / Elapsed Time / Remaining Time information for the current song. Can this information be retrieved for the complete Playlist (like Total: 45:30 / Elapsed: 10:00 / Remaining: 35:30)?

Thanks for your consideration,

Christian
Title: Re: WPS: Total Time / Elapsed Time / Remaining Time for Whole Playlist?
Post by: JdGordon on July 22, 2010, 10:37:47 AM
Not currently. It is sort of a nodo because it would (probably) mean reading every file in the playlist which means lots of disk access.
However, if the database is used and set to load to ram it would be relatively cheap to do and could be implemented. As usual it needs someone to do the work though.
Title: Re: WPS: Total Time / Elapsed Time / Remaining Time for Whole Playlist?
Post by: cE10 on July 22, 2010, 10:47:00 AM
Hmm, okay.

Excuse my ignorance, but is it really necessary to read in a file's complete contents to calculate its playing time?

Cheers,

Christian
Title: Re: WPS: Total Time / Elapsed Time / Remaining Time for Whole Playlist?
Post by: JdGordon on July 22, 2010, 10:52:32 AM
the problem isnt so much reading the whole file, but more that each file has to be opened, then the ID# tags need to be found and read (depending on the container this might be easy or hard). There is a patch that does this on the tracker but it wont be accepted because it is mostly pointless and very few people actually want this feature.
Title: Re: WPS: Total Time / Elapsed Time / Remaining Time for Whole Playlist?
Post by: Chronon on July 23, 2010, 12:57:18 AM
There is a patch at FS#7652 for EXTM3U support that would add support for comments like
Quote
#EXTINF:xxx,yyy
where xxx is track length in seconds, yyy is the title.

I don't know enough about the logistics of allocating memory for this, but in principle this gives a way to get the runtimes of all files in a playlist without opening each file.  You still need to be able to read all comments in the playlist and sum the runtimes for playlists of arbitrary length (a playlist could contain each file on the player several times, for example).

Also, this would only apply to pre-generated playlists that contain proper comment lines.
Title: Re: WPS: Total Time / Elapsed Time / Remaining Time for Whole Playlist?
Post by: Flobber on July 24, 2010, 03:56:06 PM
I'm missing these info, too.

However, if the database is used and set to load to ram it would be relatively cheap to do and could be implemented.

For me that would be good enough.

As a bonus: when browsing the database I see the track times.  It would be nice, if these track times are summed up and shown on the upper layers (i.e. album length, artist total).