Rockbox

Tasklist

FS#7345 - Enumerated image sets for WPS

Attached to Project: Rockbox
Opened by Mark Arigo (lowlight) - Friday, 22 June 2007, 20:00 GMT
Last edited by Dave Chapman (linuxstb) - Monday, 24 March 2008, 00:14 GMT
Task Type Patches
Category Themes
Status Closed
Assigned To Nicolas Pennequin (nicolas_p)
Operating System All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

This patch adds support for using image/icon sets for some enumerated WPS tags (currently only volume, battery, and codec).

Currently, to create a graphical volume display with 10 images, you would load the 10 images, then have something like %?pv<%xdA|%xdB|...|%xdJ> in your wps file.

With this patch, you create one bitmap containing the individual images stacked vertically with the first enumerated image at the top (same as the custom icon format). Then, load the image using the %xl command, but also specify the number of subimages within the bmp (e.g. 10):
%xl|A|34|9|10|

To enumerate the volume with image A, use
%evA

At this time, the patch can enumerate volume (%ev), battery (%eb), and codec (%ec).

To apply, do in order:
1. copy gui_img.c & gui_img.h to apps/gui
1. apply gui_img.patch (this provides more general loading & drawing of images)
2. apply enum_img.patch (this adds support for enumerating the image sets)

I've include is a sample wps for the Gigabeat, myCatcher, based on iCatcher, but using image sets for volume, battery, and codec (see bat-b.bmp, codec-b.bmp, and vol-b.bmp).

Todo:
1. Animate the image set by looping through the images (like when you pause in iCatcher).
2. Display a single image in the image set.
This task depends upon

Closed by  Dave Chapman (linuxstb)
Monday, 24 March 2008, 00:14 GMT
Reason for closing:  Out of Date
Additional comments about closing:  The "bitmap strips" feature now implements this functionality.
Comment by Mark Arigo (lowlight) - Tuesday, 26 June 2007, 18:46 GMT
Update June 26, 2007:
Added animation, plus image enumerations for playback, repeat, shuffle, & hold. More could be added, but this completes the feature-set for the iCatcher WPS. I decided to continue the use of %x-based tags for images instead of introducing the %e tag.

The new tags are:
%xaN# = animate image set N, # sets the display subimage time, defaults to 1 sec, can be in tenths (like to %t)
%xbN = enumerate battery image set N (arbitrary # of images. Note, follows same enumeration as %bl, so 1st image only used for unknown state, and last image only used when 100%)
%xcN = enumerate codec image set N (there are currently 19 codecs, same enumeration as %fc)
%xhN = enumerate hold image set N (4 images: off, main hold on, remote hold on, both holds on)
%xpN = enumerate playback image set N (5 images: stop, play, pause, ff, rew)
%xrN = enumerate repeat image set N (5 images: off, all, one, shuffle, ab)
%xsN = enumerate shuffle image set N (2 images: off, on)
%xvN = enumerate volume image set N (arbitrary # of images. Note, follows same enumeration as %pv, so last 2 images are for 0dB and >0dB)

Updated "myCatcher" WPS for Gigabeat using enumerated images. Current iCAtcher uses 53 images, while myCatcher uses 11. That could be reduced by 1 more image if I figure out a good way to show a single image from an image set.

I'm still on svn rev. 13681 (from June 21), so hopefully all the patches still apply to current svn.

Please test!
Comment by Nicolas Pennequin (nicolas_p) - Thursday, 28 June 2007, 15:15 GMT
I like the idea ! I haven't yet studied the patch in detail but I intend to. Anyway it seems to work perfectly fine.

Here is an updated version (as of r13729) with all the changes included.
Comment by PaulJam (PaulJam) - Saturday, 07 July 2007, 15:58 GMT
Hi,

i like this patch. But i have some remarks:

When compiling with this patch for a target with HAS_REMOTE_BUTTON_HOLD (e.g. H300) i get a warning:

CC gui/gwps-common.c
gui/gwps-common.c: In function ‘get_token_value’:
gui/gwps-common.c:1260: warning: suggest explicit braces to avoid ambiguous ‘else’

When i set the braces according to the indentation the warning disappears.

Another thing is that the order of the %xhN tag (hold) is different from what you wrote earlier: for me it is [off,main,both,remote].

btw, the issue you mention with the last enum of the battery only being shown at 100% is afaik already fixed.
Comment by PaulJam (PaulJam) - Monday, 16 July 2007, 10:48 GMT
There seems to be a problem with the progressbar (%pb) with this patch.
When the %pb tag is used without additional coordinates then the progressbar is always drawn at the top of the screen. this breaks some WPS e.g. the inbuilt default WPS.
Comment by Mark Arigo (lowlight) - Wednesday, 18 July 2007, 15:59 GMT
Thanks for testing. I did change the way the progress bar stores its coordinates and I guess I forgot about the default case when no coords are given (just %pb). I will update this patch when I get a chance (maybe next week).
Comment by Peter D'Hoye (petur) - Saturday, 01 September 2007, 18:25 GMT
ping....
Comment by PaulJam (PaulJam) - Sunday, 11 November 2007, 15:06 GMT
This patch needs to be resynced.

Loading...