Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

Tasklist

FS#12100 - Track length in seconds

Attached to Project: Rockbox
Opened by dave t (sockbox) - Friday, 06 May 2011, 00:40 GMT+2
Last edited by Dominik Riebeling (bluebrother) - Sunday, 05 June 2011, 13:06 GMT+2
Task Type Patches
Category Themes
Status Closed
Assigned To No-one
Player Type All players
Severity Low
Priority Normal
Reported Version Release 3.8.1
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Private No

Details

This patch displays the track length in seconds using a custom WPS tag, %pz.

The idea behind this tag is to use the track length in a conditional statement.

What I want to do is to determine the length of a song and change the font size to accommodate for the additional text. This will be useful when handling smaller resolution players such as the Sansa Clip.

ie. I want to find out if a track is longer than 10 minutes.
%?if(%pz, <, 600)<%Vd(a)|%Vd(b)>

Viewports a & b will define the font output.

The patch works if you just want to display the track length in seconds (%pz). But I cannot get it to work correctly with any values in the conditional statement above. The value does not seem to be interpreted as an integer.
   length_seconds.diff (1.8 KiB)
 apps/gui/skin_engine/skin_tokens.c |    9 +++++++++
 lib/skin_parser/tag_table.c        |    1 +
 utils/skinupdater/tag_table.c      |    1 +
 3 files changed, 11 insertions(+)

This task depends upon

Closed by  Dominik Riebeling (bluebrother)
Sunday, 05 June 2011, 13:06 GMT+2
Reason for closing:  Rejected
Additional comments about closing:  no real name
Comment by Jonathan Gordon (jdgordon) - Friday, 06 May 2011, 01:01 GMT+2
why are you do time/1000 for the display but not for the *intval?
Comment by dave t (sockbox) - Friday, 06 May 2011, 01:09 GMT+2
To tell you the truth, I'm not a C programmer. I just copied & pasted the code from another part of the file.

I'm hoping for some input into how to make it work correctly.
Comment by dave t (sockbox) - Friday, 06 May 2011, 01:30 GMT+2
Thanks for the tip. Looks to be working now.

   length_seconds2.diff (1.8 KiB)
 apps/gui/skin_engine/skin_tokens.c |    9 +++++++++
 lib/skin_parser/tag_table.c        |    1 +
 utils/skinupdater/tag_table.c      |    1 +
 3 files changed, 11 insertions(+)

Loading...