Rockbox Technical Forums

Support and General Use => Theming and Appearance Customization => Topic started by: JoChn on November 03, 2011, 08:08:27 AM

Title: Sansa e260 - Woody theme
Post by: JoChn on November 03, 2011, 08:08:27 AM
Hey,
I have a problem, because the battery (while charging) displayed before. Now I've seen (after update software) that the graphic of the battery disappear while device is plug in. Does anyone know what's wrong?? I've check the code and I think it's ok.

Here's the code:
%wd
%Fl(2,12-Terminus.fnt)
%Fl(3,12-Nimbus.fnt)
%X(wpsbackdrop.bmp)
%xl(A,redHDD.bmp,168,2)
%xl(B,redLOCK.bmp,168,10,2)
%xl(C,playmode.bmp,3,106,5)
%xl(D,battery.bmp,7,3,10)
%xl(E,volume.bmp,130,164,10)
%xl(F,shuffle.bmp,31,132,2)
%xl(G,repeat.bmp,5,132,5)
%Cl(53,132,66,66)
#HDD and Lock
%?mh<%xd(Ba)|%xd(Bb)>
%?lh<%xd(A)>
#Playmode
%?mp<%xd(Ca)|%xd(Cb)|%xd(Cc)|%xd(Cd)|%xd(Ce)>
#Battery
%?bp<%?bc<%xd(Da)>|%?bl<|%xd(Db)|%xd(Dc)|%xd(Dd)|%xd(De)|%xd(Df)|%xd(Dg)|%xd(Dh)|%xd(Di)|%xd(Dj)>>
#Volume
%?pv<%xd(Ea)|%xd(Eb)|%xd(Ec)|%xd(Ed)|%xd(Ee)|%xd(Ef)|%xd(Eg)|%xd(Eh)|%xd(Ei)|%xd(Ej)>
#Shuffle and repeat
%?ps<%xd(Fa)|%xd(Fb)>
%?mm<%xd(Ga)|%xd(Gb)|%xd(Gc)|%xd(Gd)|%xd(Ge)>
#AlbumArt
%?C<%Cd|No Art>
#Date and clock
%Vf(00ff00)
%V(45,4,105,14,2)
%al%cd.%cm.%cY%ar%cH:%cM
%V(16,23,160,65,3) %Vf(00ff00)
%s%al%?ia<%ia|>

%s%al%?it<%it|%s%ac%fn>

%s%al%?id<%id|>
%Vf(00ff00)
#Time in song
%V(22,97,153,13,2)
%ac%pc/%pt
#Song info
%V(120,124,56,40,2)
%ac%pp/%pe
%ac%fb kbps
%ac@%fc
#Battery and volume info
%V(5,165,45,34,2)
B:%bl
V:%pvdB
#Next song
%V(22,-15,151,12,2)
%s%?Ia<%Ia - %It|%s%ac%Fn>

%V(26,113,147,5,-)
%pb(0,0,-,-,progress.bmp)
Title: Re: Sansa e260 - Woody theme
Post by: [Saint] on November 03, 2011, 11:09:55 AM
You *really* need to get your state icons/images into viewports...


[Saint]
Title: Re: Sansa e260 - Woody theme
Post by: JoChn on November 04, 2011, 09:57:26 AM
I'm sorry, but i really don't understand... What you mean?
Every state icons/images need to be in viewport? Or what?
Title: Re: Sansa e260 - Woody theme
Post by: AsusFreak on November 07, 2011, 04:25:53 AM
http://www.rockbox.org/wiki/CustomWPS

%bl 
Show numeric battery level in percent. Can also be used in a conditional: %?bl(-1|0|1|2|...|N)
where the -1 value is used when the battery level isn't known (it usually is). 

Means:
%bl(load,empty,step1,step 2, ...,full)

You used:
%?bl<|%xd(Db)|%xd(Dc)|%xd(Dd)|%xd(De)|%xd(Df)|%xd(Dg)|%xd(Dh)|%xd(Di)|%xd(Dj)>

So you droped exactly the responsible part of your stripped image for the loading.

So I assume (but I don't know your battery.bmp) that you need to use:
%?bl<%xd(Da)|%xd(Db)|%xd(Dc)|%xd(Dd)|%xd(De)|%xd(Df)|%xd(Dg)|%xd(Dh)|%xd(Di)|%xd(Dj)>
Title: Re: Sansa e260 - Woody theme
Post by: [Saint] on November 07, 2011, 09:38:27 AM
http://www.rockbox.org/wiki/CustomWPS

%bl  
Show numeric battery level in percent. Can also be used in a conditional: %?bl(-1|0|1|2|...|N)
where the -1 value is used when the battery level isn't known (it usually is).  

Means:
%bl(load,empty,step1,step 2, ...,full)

You used:
%?bl<|%xd(Db)|%xd(Dc)|%xd(Dd)|%xd(De)|%xd(Df)|%xd(Dg)|%xd(Dh)|%xd(Di)|%xd(Dj)>

So you droped exactly the responsible part of your stripped image for the loading.

So I assume (but I don't know your battery.bmp) that you need to use:
%?bl<%xd(Da)|%xd(Db)|%xd(Dc)|%xd(Dd)|%xd(De)|%xd(Df)|%xd(Dg)|%xd(Dh)|%xd(Di)|%xd(Dj)>



I'm sorry...but, no.

I really don't think this is the case here. The first section of a %bl<||....> condition is almost always left blank, as, its not usually displayed. The battery state not being known would be a bug in most (all?) cases, its just there "in case".

I'm also confused by your use of "load", what are you meaning here? The first case for this condition is:
"Gee...whoops, I really have no idea what state the battery is in", but it should not affect the display during charging as this condition doesn't know if the battery is charging or not.

The "right" way to represent charging can be simplified to:

%?bp<%?bc<%xd(we're_charging)|%xd(we've_charged)>|%?bl(0,0,-,-,battery_state.bmp)>

Which is simply:

*Is the charger plugged in, or do we have power?
**Yes - Great
***Ok, are we charging?
****Yes - Display we're_charging to show we're charging
****No - We must be charged then, display we've_charged.
**No - The charger isn't plugged, and we're not charging...so display battery_state.

His condition neglects to cater for the state where the charger is plugged, and the battery fully charged. And will not display an image in this case.


[Saint]
Title: Re: Sansa e260 - Woody theme
Post by: AsusFreak on November 08, 2011, 04:57:02 AM
Hi Saint,

sorry, did the wrong word here: load means charging, means plugged to power.

You're right it's defined for uncertain status which is working wonderful on my D2 for showing the charging status in all of my themes.

But I'm quite sure that you will be right with the Sansa devices. As I don't own one of them I'm not able to prove this...
Title: Re: Sansa e260 - Woody theme
Post by: JoChn on November 08, 2011, 02:16:37 PM

The "right" way to represent charging can be simplified to:

%?bp<%?bc<%xd(we're_charging)|%xd(we've_charged)>|%?bl(0,0,-,-,battery_state.bmp)>

[Saint]
Ok but, what if I want to get (charging/charged) on the same part of bitmap?

#Battery
%?bp<%?bc<%xd(Da)>|%?bl<|%xd(Db)|%xd(Dc)|%xd(Dd)|%xd(De)|%xd(Df)|%xd(Dg)|%xd(Dh)|%xd(Di)|%xd(Dj)>>

Which means:
Battery power
if charging [don't matter if the battery is charging or charged (%?bc)] show first part,
if not, show other parts equal to the battery power.

So at all what should be look like the right code (with my solution)?
Because with your way need to declare 2 times the battery bitmap:
%xl(D,battery.bmp,7,3,10)
%?bp<%?bc<%xd(Da)|%xd(Db)>|%?bl(0,0,-,-,Battery.bmp)>
Title: Re: Sansa e260 - Woody theme
Post by: [Saint] on November 10, 2011, 12:39:51 PM

The "right" way to represent charging can be simplified to:

%?bp<%?bc<%xd(we're_charging)|%xd(we've_charged)>|%?bl(0,0,-,-,battery_state.bmp)>

[Saint]
Ok but, what if I want to get (charging/charged) on the same part of bitmap?

#Battery
%?bp<%?bc<%xd(Da)>|%?bl<|%xd(Db)|%xd(Dc)|%xd(Dd)|%xd(De)|%xd(Df)|%xd(Dg)|%xd(Dh)|%xd(Di)|%xd(Dj)>>

Which means:
Battery power
if charging [don't matter if the battery is charging or charged (%?bc)] show first part,
if not, show other parts equal to the battery power.

So at all what should be look like the right code (with my solution)?
Because with your way need to declare 2 times the battery bitmap:
%xl(D,battery.bmp,7,3,10)
%?bp<%?bc<%xd(Da)|%xd(Db)>|%?bl(0,0,-,-,Battery.bmp)>



I have no idea what you're asking here...

I can't provide a specific code solution because I don't a: have your bitmaps to see and b: don't quite understand what you're wanting to do anymore...I thought I did.

I was merely trying to point out that with the code you posted, once the battery is fully charged the batery display will disappear as you haven't provided a condition to catch this case.
The code solution I posted does, but it assumes you're using a different image to represent charging/charged and that you're using a "progress bar" style battery image, which you're not.
I thought you'd be able to edit these things yourself, and I was just trying to provide the syntax to show you how to cover the condition you missed in the charge code.


[Saint]
Title: Re: Sansa e260 - Woody theme
Post by: JoChn on November 10, 2011, 09:55:03 PM
(http://img38.imageshack.us/img38/8365/batteryj.png) (http://imageshack.us/photo/my-images/38/batteryj.png/)
Picture of my bitmap.

Want to:
Show first upper part (battery with lightning), when device is plug in (doesn't matter if it's charged or charging). Because this image doesn't display anymore (other parts works fine).

Sorry for incomprehension/understatement :)
Title: Re: Sansa e260 - Woody theme
Post by: sockbox on November 23, 2011, 02:05:13 AM
Want to:
Show first upper part (battery with lightning), when device is plug in (doesn't matter if it's charged or charging).

Code: [Select]
%?bp<%xd(Da)|%?bl<%xd(Db)|%xd(Db)|%xd(Dc)|%xd(Dd)|%xd(De)|%xd(Df)|%xd(Dg)|%xd(Dh)|%xd(Di)|%xd(Dj)|%xd(Dj)>>
You'll also want to display %xd(Dj) twice. The last %xd(Dj) only displays for levels exactly at 100%. You'll want to display the fully charged image for ~90-100%.

For a low battery, charge soon, indicator I flashed the empty batt icon when the batt level gets under a certain percentage. You can do something like this...

Code: [Select]
%?bp<%xd(Da)|%?if(%bl,<,6)<%t(.5)%xd(Db);%t(.3)%xd(Da)|%?bl<|%xd(Db)|%xd(Dc)|%xd(Dd)|%xd(De)|%xd(Df)|%xd(Dg)|%xd(Dh)|%xd(Di)|%xd(Dj)|%xd(Dj)>>>

I have no way of checking the code other than on the sim, which doesn't help with USB related issues.