• Status Closed
  • Percent Complete
  • Task Type Patches
  • Category User Interface → Themes
  • Assigned To No-one
  • Operating System All players
  • Severity Low
  • Priority Very Low
  • Reported Version Daily build (which?)
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by punkt - 2010-03-07
Last edited by jdgordon - 2011-03-27

FS#11084 - Custom variables for WPS

This patch adds support for custom variables for the wps. This could be used e.g. to toggle between album art, playlist info and song info.

New tags are:
* %vd|identifier|number of states|
Defines a variable. The value is a number between 0 and number-of-states -1.
* %vg’identifier’ Displays the content of the variable, can be used as a conditional.
* New action for %T: vt’identifier’ Toggles (increases) the variable with the given identifier. If the maximum state for the variable is reached, it is reset to 0.

Currently a variable can only be changed using a touch-region.

Related forum topic:

Patch for the manual will follow if there are no objections to this patch.

Attached is a theme used for testing the patch on the Cowon D2.

Closed by  jdgordon
2011-03-27 08:02
Reason for closing:  Accepted
Additional comments about closing:   Warning: Undefined array key "typography" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 371 Warning: Undefined array key "camelcase" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 407

sort of accepted in r29655

interesting. for consistancy sake the tags shuold be vl and vd (variable load and variable display)

punkt commented on 2010-03-08 19:05

Renamed tags, as suggested:
* %vl|identifier|number of states|
Defines a variable. The value is a number between 0 and number-of-states -1.
* %vd’identifier’ Displays the content of the variable, can be used as a conditional.

Renamed the touch action to “vs” (for variable set).

Extended the touch action. You can optionally set the target value instead of toggling:


Also, I moved the evaluation of the touch action from wps_get_touchaction() to gui_wps_show().

punkt commented on 2010-03-08 20:35

Replaced snprintf(”%hu”, …) with snprintf(”%u”, …). For some reason, %hu worked in the linux simulator.

punkt commented on 2010-03-12 21:16

Changed the touch-action, which now has the following format:

+: Increases the variable (with wrap-around)
-: Decreases the variable (with wrap-around)
number: sets the variable to the given number


punkt commented on 2010-03-12 22:29

That snprintf(”%hu”, …) slipped in again.

punkt commented on 2010-03-16 19:22

Added a description of the new tags to the manual.
I think this patch is about finished now.

does this make sense for non touchscreen targets? unless we come up with a way to change the var I dont tihnk so, so the code should all be in a #ifdef (maybe #ifdef HAVE_WPS_VARIABLES ? )

punkt commented on 2010-03-18 09:57

Ok, I’ll look at it this weekend. Is a separate define necessary, or should I use HAVE_TOUCHSCREEN?

a new one probbaly so it is easy enough to add button targets if they have a spare button

punkt commented on 2010-03-20 14:40

Put the code into #ifdef HAVE_WPS_VARIABLES blocks. It is defined for all targets with HAVE_TOUCHSCREEN.

punkt commented on 2010-03-22 22:01

How about a tag %vs for setting a variable? This way, I can combine variables with %Tl, e.g. show a popup menu using a button and then close it once the %Tl timer runs out. I’ll try this in the next couple of days.

punkt commented on 2010-03-28 15:55

I played around with a new tag %vs, but %Tl and wps variables don’t work well together. So I just synched the patch to r25371.


Available keyboard shortcuts


Task Details

Task Editing