- 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
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: http://forums.rockbox.org/index.php?topic=23083.0
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.
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
Loading...
Available keyboard shortcuts
- Alt + ⇧ Shift + l Login Dialog / Logout
- Alt + ⇧ Shift + a Add new task
- Alt + ⇧ Shift + m My searches
- Alt + ⇧ Shift + t focus taskid search
Tasklist
- o open selected task
- j move cursor down
- k move cursor up
Task Details
- n Next task
- p Previous task
- Alt + ⇧ Shift + e ↵ Enter Edit this task
- Alt + ⇧ Shift + w watch task
- Alt + ⇧ Shift + y Close Task
Task Editing
- Alt + ⇧ Shift + s save task
interesting. for consistancy sake the tags shuold be vl and vd (variable load and variable display)
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:
vs’identifier’[value]
Examples:
%vl|a|3|
%?vda<foo|bar|baz>
%T|0|0|88|20|vsa|
%T|0|0|45|20|vsa0|
Also, I moved the evaluation of the touch action from wps_get_touchaction() to gui_wps_show().
Replaced snprintf(”%hu”, …) with snprintf(”%u”, …). For some reason, %hu worked in the linux simulator.
Changed the touch-action, which now has the following format:
vs’identifier’<+|-|number>
+: Increases the variable (with wrap-around)
-: Decreases the variable (with wrap-around)
number: sets the variable to the given number
Examples:
%T|0|0|88|20|vsa+|
%T|0|0|88|20|vsa-|
%T|0|0|88|20|vsa2|
That snprintf(”%hu”, …) slipped in again.
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 ? )
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
Put the code into #ifdef HAVE_WPS_VARIABLES blocks. It is defined for all targets with HAVE_TOUCHSCREEN.
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.
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.