Rockbox

  • Status Closed
  • Percent Complete
    100%
  • Task Type Patches
  • Category Themes
  • Assigned To
    Nicolas Pennequin
  • Operating System All players
  • Severity Low
  • Priority Very Low
  • Reported Version Daily build (which?)
  • Due in Version Undecided
  • Due Date Undecided
  • Votes 2
  • Private
Attached to Project: Rockbox
Opened by Mark Arigo - 2007-06-22
Last edited by Dave Chapman - 2008-03-24

FS#7345 - Enumerated image sets for WPS

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.

Closed by  Dave Chapman
2008-03-24 00:14
Reason for closing:  Out of Date
Additional comments about closing:  

The "bitmap strips" feature now implements this functionality.

Mark Arigo commented on 2007-06-26 18:46

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!

Nicolas Pennequin commented on 2007-06-28 15:15

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.

PaulJam commented on 2007-07-07 15:58

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.

PaulJam commented on 2007-07-16 10:48

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.

Mark Arigo commented on 2007-07-18 15:59

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).

Peter D'Hoye commented on 2007-09-01 18:25

ping….

PaulJam commented on 2007-11-11 15:06

This patch needs to be resynced.

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing