This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#4783 - WPS Extensions: ProgressBar Y coord + Enum Conditional Limits Removal
|
DetailsThis patch contains two WPS extensions:
1) Progress Bars can be positioned with an optional y coordinate, instead having to be line based: Use %pb|height|leftpos|rightpos|[y coord|] 2) Proof-of-concept arbitrary value-based enum-conditionals: I wanted to use 15 bitmaps for my work-in-progress WPS' volume bitmap, instead of the hardcoded 10. My solution is for the code to count how many conditional enums a WPS is using, and work off that. This allows a WPS designer to use however many bitmaps etc they choose, without breaking backwards compatibility. If somebody more familiar with the WPS internals wants to extend this to all suitable enum tags, please do (otherwise I'll do it eventually). As this patch isn't meant for inclusion as-is, I have left my // gl.tter - START / END code tags in place to highlight the changes. |
This task depends upon
1) Updated Progress Bar patch attached - this _is_ now ready for inclusion.
2) Seperate 'conditional enum limit' patch (with gl.tter tags).
2) Don't add those "gl.tter" comments, we can see perfectly well what was changed without them. That's what patches are for.
3) I like the enum approach, and I'd like it extended to all enums. Can you do that?
2. I do remove them for patches suitable for inclusion, this was the exception as it was only supposed to demo the approach.
3. As I said, I can do this eventually, but if somebody with more WPS code experience wants to do it now, great.
Bug Fix & func name change.
Now allows y=0
Now drawn after text (so it isn't hidden by it when it overlaps, confusing during design).
FS#4802Somewhere in the code you say if one is not using the new additional y-coordinate parameter,
it would behave as without the patch.
That's not true, if you don't use the y-coord parameter,
it displays your progress bar on top of the screen :-(
Another thing: I converted an existing WPS and just changed the progressbar line and added the addition parameter.
After that everything was on its place.
IMHO that's a bit illogical - you know why?
- when it works in line based mode (without y-coord parameter) then it should add an additional line and
follow the order of the lines (and "eat" a line).
- when it works in coordinate mode, it should work like the bitmaps do - not line oriented with direct position
and it should not affect other tags which are line oriented --> it should NOT "eat" a line.
==> to make a long story short: when I added the y-coord parameter, I expected that I also would have to add an
additional empty line because the progress bar is no longer part of the line oriented parsing and therefore the
I exepected that the whole text after the progress bar would jump a line above.
That did not happen!??
But you're right, it does eat a line in y coord mode. I'll fix that and post a seperate PB patch there shortly:
FS#4802.Especially to extract the progressbar code and separate it from the other stuff?
FS#4802for the reason).I did take a look at it eating a line though, but it's more complicated - %x| tags don't take a line, but %xd tags do. You could change y PBs to work like %x| tags, but then you couldn't use them in a conditional or subline, which can be useful. Or the WPS line formatting code could be rewritten to skip lines that only contain images or y PBs - but that's another issue.
It is now possible for the patch to get commited to CVS?
Are there any news on this?
Thanks a lot and all the best
Norbert
Progressbar Y coord hasn't been commited because it's author refuses to give his real name, which is against the project's policy.
all you need is give him your name?! :\\
Could it be that this update broke (old) wps without the y coordinate specified? I got one report concerning this, and I tested myself some wps (eg UniCatcher), and the pb actually was tucked to the top.
Prior version did work.
Any ideas what it could be?
Best wishes
Norbert
Ok, it seems to be something different. Maybe the combination of cuesheet parser (which makes a bit of magic in the gwps-common.c) and the ycoord patch? I reverted to the previous version and had the same problems. Sorry for the noise. Maybe I tell the guys simply to adjust their wps...
Bye Norbert
Still other problem persist, see my other post.
Thanks a lot. I have made a first build with your patch and have a lot of fun: The WPS screen is not redrawn. But this might be a problem from a different patch. Menus and file lists are shown but the wps is never shown after I have gone once into file list or settings screen. Hmm, I think I have to repatch everything from the beginning and see what happens.
Anyway, thanks a lot. Maybe now this patch can be included, since it is a rewrite and your name is known ;-)
Bye Norbert
I will do more tests as soon as I have time ...
Bye
All well, I left out the custom stuff and everything is working perfectly. I tested some wps which didn't work before, now they do.
Thanks a lot!!! Go for inclusion ;-)
Now for the hard work to get the custom stuff working again...
Ciao
In most "historic" wps I have the last finishing "|" is not
there (e.g. %pb|2|48|115|83) which
leads to a wrong y value since the parsing depends on it
Dont know if the wps writer did an error in the first place
by not providing the final "|" or if the parsing should
be "smart" enough to handle this case also.
The old patch did it that way
compatible with old wps code. So the finishing "|" may be missing
(if no y coord was specified) independent if a final "|" is present or not
correct for some WPS e.g. ZenPod.
The old patch called the progress draw on a different location
for an y-coord enabled progress bar maybe that is the reason.
If I change the new patch so that it is called like the old
patch the progress bar is drawn correct for all WPS again
i.e. what do you mean by "correct" and "not correct", and also "different locations" ?
The old patch calls the progress bar drawing at the end of the function
for y-coord enabled progress bars
Not correct means that the progress bar is not drawn with your rewrite
patch ;-)