Rockbox Development > Feature Ideas

WPS tag for track time in seconds

(1/1)

sockbox:
I would like to see a wps tag to display the %pc, %pr, and %pt values in seconds so I can do some %if conditionals.

Is it possible to do that with the current tag syntax? I have tried several methods but none work.

For example, I want to find out if the track time is less than 10 minutes...

%?if(%pt,<,10)... doesnt work
%?if(%pt,<,10:00)... doesnt work

It'd be much easier to do this if I could somehow get the track time in seconds.
%?if(%pt,<,600)...

How about if used in a %if statement those tags are represented in seconds?

Thanks.

sockbox:
I was able to edit the source code to add an aditional WPS tag (%pz) to display the track length in seconds. However any %?if conditionals performed against this tag failed.  I guess the %if function doesn't simply see the value as an integer.

%?if(%pz, >, 600)<%Vd(c)|%Vd(d)>

JdGordon:
well, paste your patch somewhere... you proably are storing the string and not setting *intval

pixelma:
sockbox,

I'm not sure what you want to achieve but from the sounds of it you may be able to get the desired effect with the already existing %pS or %pE tags (without %?if). The only thing I don't know is if they have an upper limit of seconds you can set.

sockbox:
I've posted a patch and description of what I'm trying to achieve.

http://www.rockbox.org/tracker/task/12100

Can you figure out why %pz isn't interpreted correctly as an integer in a conditional?

Navigation

[0] Message Index

Go to full version