Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Welcome to the Rockbox Technical Forums!

+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Feature Ideas
| | |-+  WPS tag for track time in seconds
« previous next »
  • Print
Pages: [1]

Author Topic: WPS tag for track time in seconds  (Read 1680 times)

Offline sockbox

  • Member
  • *
  • Posts: 111
WPS tag for track time in seconds
« on: April 19, 2011, 01:09:07 PM »
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.
« Last Edit: April 25, 2011, 01:39:22 AM by sockbox »
Logged

Offline sockbox

  • Member
  • *
  • Posts: 111
Re: WPS tag for track time in seconds
« Reply #1 on: May 04, 2011, 06:45:14 PM »
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)>

Logged

Offline JdGordon

  • Member
  • *
  • Posts: 1817
  • Constantly breaking stuff
Re: WPS tag for track time in seconds
« Reply #2 on: May 05, 2011, 03:20:51 AM »
well, paste your patch somewhere... you proably are storing the string and not setting *intval
Logged


Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

Offline pixelma

  • Rockbox Expert
  • Member
  • *
  • Posts: 645
Re: WPS tag for track time in seconds
« Reply #3 on: May 05, 2011, 03:18:14 PM »
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.
Logged

Offline sockbox

  • Member
  • *
  • Posts: 111
Re: WPS tag for track time in seconds
« Reply #4 on: May 05, 2011, 06:44:15 PM »
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?
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Feature Ideas
| | |-+  WPS tag for track time in seconds
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.073 seconds with 15 queries.