Rockbox Technical Forums

Support and General Use => Theming and Appearance Customization => Topic started by: SorcererSteven on October 19, 2006, 06:16:12 PM

Title: Problem with %bp tag...
Post by: SorcererSteven on October 19, 2006, 06:16:12 PM
I must be doing something obviously wrong, but I have no idea what it could be... I have the line
Code: [Select]
%?bp<%xdA|%?bl<%xdB|%xdC|%xdD|%xdE|%xdF|%xdG|%xdH|%xdI|%xdJ|%xdK|%xdL|%xdM|%xdN|%xdO|%xdP|%xdQ>>in my WPS (Yeah, I wanted the battery to fill pixel by pixel...). However, it never shows as plugged in, it only ever shows the battery level. How can I get it to display/what have I done wrong?
I've checked the pictures, and tryed shortening the line to soemthing more simple, as well.
Oh. I guess it would be helpful to know I'm using a Nano.

The rest of my WPS follows...
Code: [Select]
%xl|a|nav-stop.bmp|5|86|
%xl|b|nav-play-colour.bmp|5|86|
%xl|c|nav-pause-colour.bmp|5|86|
%xl|d|nav-ffwd-colour.bmp|5|86|
%xl|e|nav-rwnd-colour.bmp|5|86|
%xl|f|hold-on.bmp|59|0|
%xl|g|hold-off.bmp|59|0|
%xl|A|bat-c.bmp|0|0|
%xl|B|bat-0.bmp|0|0|
%xl|C|bat-1.bmp|0|0|
%xl|D|bat-2.bmp|0|0|
%xl|E|bat-3.bmp|0|0|
%xl|F|bat-4.bmp|0|0|
%xl|G|bat-5.bmp|0|0|
%xl|H|bat-6.bmp|0|0|
%xl|I|bat-7.bmp|0|0|
%xl|J|bat-8.bmp|0|0|
%xl|K|bat-9.bmp|0|0|
%xl|L|bat-10.bmp|0|0|
%xl|M|bat-11.bmp|0|0|
%xl|N|bat-12.bmp|0|0|
%xl|O|bat-13.bmp|0|0|
%xl|P|bat-14.bmp|0|0|
%xl|Q|bat-15.bmp|0|0|
%wd
%al    %pvdB%?mh<%xdf|%xdg>%ar%ca, b d, H:Mc

%ac%s%?it<%it|%fn>
%ac%s%?ia<%ia|>
%ac%s%?id<%id|>


%acTrack %pp of %pe
%pb
%al%pc%ar%pt

%?mp<%xda   Stopped|%xdb   Playing...|%xdc   Paused|%xdd   Fast Forwarding...|%xde   Rewinding...>
%ar...Info
%alBitrate:%fbkbps%?fv< VBR| CBR>
%alSize:%fskb%arPlayed %rp Times
%alNext:%ar%s%?Ia<%Ia - |Loading...>%?It<%It|>

%?bp<%xdA|%?bl<%xdB|%xdC|%xdD|%xdE|%xdF|%xdG|%xdH|%xdI|%xdJ|%xdK|%xdL|%xdM|%xdN|%xdO|%xdP|%xdQ>>
Title: Re: Problem with %bp tag...
Post by: iPodFoo on October 19, 2006, 06:50:08 PM
Try %bc instead of %bp to see if that makes a difference.

Think bp is for mains chargers and bc is for charging by usb... i think. I could well be wrong.

Let me know.  ;)
Title: Re: Problem with %bp tag...
Post by: SorcererSteven on October 19, 2006, 07:03:51 PM
Well, everything I read said %bp is true if plugged in, and %bc is true if charging, but I gave it a show anyways. And no luck... Any other ideas?
Title: Re: Problem with %bp tag...
Post by: Yotto on October 19, 2006, 08:34:44 PM
I doubt this is it, but put a different bitmap there instead (Say, fully charged or totally empty) and see if that bitmap shows up.  Perhaps it's the bitmap itself that is to blame, is what I'm saying.

I see nothing wrong with the code.
Title: Re: Problem with %bp tag...
Post by: SorcererSteven on October 19, 2006, 09:12:20 PM
Nope... No change. Thanks for the idea though.
I was looking through the WPS gallery for a Nano WPS that did this, to see if I was doing something wrong with the code. But, after trying 6 or 7 different WPSs, I found that none of them use %bp. Maybe it hasn't been implemented yet? The only problem I find with this theory is that there's an icon that appears in the status bar on the menu screens when the iPod is plugged in. So maybe there's a bug that keeps that info from being passed to whatever controls the tag decision?
Any way to check that? Or has anyone seen a Nano with a plugged-in/charging icon on a WPS?
Title: Re: Problem with %bp tag...
Post by: Yotto on October 19, 2006, 10:04:12 PM
I can tell you for a fact that my theme, WLights, uses this code.  I think I stole borrowed it from jBlackGlass too.  Let me check it...

Yeah, here's what I use:

Code: [Select]
%?bp<%xdm|%?bl<%xdn|%xdo|%xdp|%xdq|%xdr>>

dm is "charging" ; dn, do, dp, dq, and dr are the levels.  And it works, I just tested it again, I'm using the ACE build which is butil on the 10/17 cvs so there's no reason.

Perhaps you have too many bitmaps in the line or something?  Cut it down to 4, or 8, and see if the problem persists.  Perhaps you've found a bug?
Title: Re: Problem with %bp tag...
Post by: iPodFoo on October 20, 2006, 06:10:24 AM
How come you have 16 images for the battery level? I thought the limit is 11? Yotto could be right about reducing the number of bmp's.
Title: Re: Problem with %bp tag...
Post by: Genre9mp3 on October 20, 2006, 06:37:27 AM
How come you have 16 images for the battery level? I thought the limit is 11? Yotto could be right about reducing the number of bmp's.

No. There's no limit anymore. This has been changed since: 26 Aug 13:25 Make volume and battery level enums dynamic, inspired by patch 4802. Almost backwards compatible; for the battery level, the first enum is used when the level is unknown, while the remaining enums are used as before.

@SorcererSteven: About your problem. Your code seems alright but maybe Nano's hardware cannot detect whether the charger is plugged in or not. I was expecting though that replacing "%bp" with "%bc" would work so here's another idea (maybe this will work):

Code: [Select]
%?bp<%?bc<%xdA|%xdQ>|%?bl<%xdB|%xdC|%xdD|%xdE|%xdF|%xdG|%xdH|%xdI|%xdJ|%xdK|%xdL|%xdM|%xdN|%xdO|%xdP|%xdQ>>
This combines "%bp" and "%bc" and it goes like: When plugged and charging show bmp A, When plugged and not charging (when charging is complete) show bmp Q (assuming that bmp Q is the full battery bmp)
Title: Re: Problem with %bp tag...
Post by: SorcererSteven on October 20, 2006, 05:00:07 PM
Thanks for the help guys, but it's still not working! I tried using the codes Yotto and Genre9mp3 gave me (switching my bmp letters for Yotto's, of course), and it still didn't work. I've tried a couple times now reducing the number of bmps, and there has been no change.
I can tell you for a fact that my theme, WLights, uses this code.  I think I stole borrowed it from jBlackGlass too.
Yeah... But both of those are iPod Video themes, not Nano. Does anyone have/know of one that uses %bp, to see if it works? Just to see if I haven't done anything weird? Or is there anyone willing to try my WPS on their Nano?
Title: Re: Problem with %bp tag...
Post by: Hweb21 on October 20, 2006, 08:26:28 PM
%xl|A|batt1.bmp|135|1|
%xl|B|batt2.bmp|135|1|
%xl|C|batt3.bmp|135|1|
%xl|D|batt4.bmp|135|1|
%xl|E|batt5.bmp|135|1|
%xl|F|battc.bmp|135|1|
%xl|G|battp.bmp|135|1|

%?bp<%?bc<%xdF|%xdG>|%?bl<%xdA|%xdB|%xdC|%xdD|%xdE>>


edit: used in clix for x5
Title: Re: Problem with %bp tag...
Post by: mightybrick on October 22, 2006, 08:32:03 AM
I'm having the same problem with a WPS I've converted from the X5 to the Nano, but adding that I can't get the battery level to even change from anything but near empty.   ???

Here's the code that I've modded to suit the Nano (no changes were made by me to the battery code)
Code: [Select]
%X|bground.bmp|
%P|pbar.bmp|
%xl|A|batt1.bmp|138|4|
%xl|B|batt2.bmp|138|4|
%xl|C|batt3.bmp|138|4|
%xl|D|batt4.bmp|138|4|
%xl|E|batt5.bmp|138|4|
%xl|F|battc.bmp|138|4|
%xl|G|battp.bmp|138|4|
%xl|H|hold.bmp|16|2|
%xl|I|nohold.bmp|16|2|
%xl|J|norep.bmp|115|20|
%xl|K|rep.bmp|115|20|
%xl|L|rep1.bmp|115|20|
%xl|M|repS.bmp|115|20|
%xl|N|repAB.bmp|115|20|
%xl|O|shuff.bmp|135|20|
%xl|P|ffcon.bmp|3|3|
%xl|Q|rwcon.bmp|3|3|
%xl|R|plcon.bmp|3|3|
%xl|S|pscon.bmp|3|3|
%xl|T|playing.bmp|0|0|
%xl|U|paused.bmp|0|0|
%wd


%al%t5   %pp of %pe;   %t5%pv dB

%s%t10%ac%?it<%it|%fn>
%s%t10%ac%?ia<%ia|%d2>
%s%t10%ac%?id<%id|%d1>

%ac%fb%?fc
%pb|7|7|153|
%al   %pc%ac%ar-%pr  

%s%alNext: %ar%Ia%t5;Next: %ar%Id%t5;Next: %ar%It%t5

%?bp<%xdG|%?bl<%xdA|%xdB|%xdC|%xdD|%xdE>>
%?mp<%xdU%xdS|%xdT%xdR|%xdU%xdS|%xdT%xdP|%xdT%xdQ>
%?mh<%xdH|%xdI>
%?mm<%xdJ|%xdK|%xdL|%xdM|%xdN>
%?ps<%xdO>
Any suggestions?
Title: Re: Problem with %bp tag...
Post by: Genre9mp3 on October 22, 2006, 10:08:20 AM
@ SorcererSteven, mightybrick or anyone with a Nano, please try this:

Switch to iCatcher and while playing music plug in the charger. This should trigger a battery icon animation (assuming that your battery isn't full).

iCatcher uses the same battery code for all targets. The animation uses the %bp and %bc tags. The animation works on my H340. If it doesn't work with the Nano then maybe there is indeed a problem with these tags on the Nano.
Title: Re: Problem with %bp tag...
Post by: Llorean on October 22, 2006, 10:28:27 AM
The iPod Nano does not show charging animations (the #define isn't enabled in the code, for some reason, I believe, this can be changed I believe in the appropriate target specific config .h file I believe). Instead of showing the charging animation it just always shows the battery level.
Title: Re: Problem with %bp tag...
Post by: mightybrick on October 23, 2006, 02:20:42 PM
@ SorcererSteven, mightybrick or anyone with a Nano, please try this:

Switch to iCatcher and while playing music plug in the charger. This should trigger a battery icon animation (assuming that your battery isn't full).

iCatcher uses the same battery code for all targets. The animation uses the %bp and %bc tags. The animation works on my H340. If it doesn't work with the Nano then maybe there is indeed a problem with these tags on the Nano.
I don't get any charging animation with iCatcher on my Nano.  I don't believe any theme I've used has produced a charging icon/animation on my Nano.
The main problem now is that the battery level in my current theme won't display the current charge.  The battery on my Nano has 3/4 of a full charge, but the WPS still displays near-empty.  See attached screendump:

[attachment deleted by admin, too old]