Rockbox Technical Forums

Support and General Use => Theming and Appearance Customization => Topic started by: yzflcyq on April 30, 2010, 06:26:56 AM

Title: Sth. wrong with my WPS!
Post by: yzflcyq on April 30, 2010, 06:26:56 AM
I made it for my VX747.I can use it under a older Rockbox,but when after upgrading the lastest Rockbox,IT DOESN'T WORK!

How can I edit it to make it work?

Thanks for all the help!
Title: Re: Sth. wrong with my WPS!
Post by: AlexP on April 30, 2010, 10:27:15 AM
Depending on how old "older Rockbox" is, quite a few tags have changed.  Compare what you have with www.rockbox.org/wiki/CustomWPS and correct any differences.
Title: Re: Sth. wrong with my WPS!
Post by: yzflcyq on May 02, 2010, 07:26:14 AM
Thanks for replying.
I did checked my WPS carefully,though I couldn't find any mistake.Please tell me where the mistake is.
Title: Re: Sth. wrong with my WPS!
Post by: jtrodriguez on May 02, 2010, 08:13:00 PM
Thanks for replying.
I did checked my WPS carefully,though I couldn't find any mistake.Please tell me where the mistake is.

Download the appropriate simulator http://rasher.dk/rockbox/simulator/  then copy your theme into the .rockbox folder and load it up take a look at the errors given in the DOS prompt it tells you the line it hangs on you can analyze it from there and fix each problem that arises until you can load it.
Title: Re: Sth. wrong with my WPS!
Post by: karashata on May 02, 2010, 08:23:04 PM
@jtrodriguez: No offense to your suggestion, but did you take a look at how old those simulator builds are..? Considering his theme is no longer working with more recent builds, a simulator as out-dated as the ones currently being hosted might not help... (Unless the simulator is newer than the build the OP was using... I suppose it can't hurt to try it after all, but if the sim's too old and the theme works, then it's no help...)

@yzflcyq: Try submitting your theme to the theme site, the parser should catch any errors and spit them out at you so you can fix them. I know it's not the best way to do it but given that the Windows sims haven't been updated since Feb. 20th and your problems are with recent builds...
Title: Re: Sth. wrong with my WPS!
Post by: [Saint] on May 02, 2010, 10:52:24 PM
yzflcyq,

Just had a quick glance then...nothing I can immediately see stands out as being *obviously wrong*, but I have a few suggestions:

-I *think* (without actually seeing the intended layout of the .wps) there may be instances where using bitmap-strips could help clean up your code.
-There are quite a few things drawn in the "default" viewport, which I personally would put in viewports.
-"%xl|"ing all your .bmps at the beginning of the .wps can help a lot to clean the code up visually, make it easier to read, and make errors easier to spot.

Oh, and I've just noticed now that line 46 "#%x|y|ylfull.bmp|42|302|" is completely irrelevant, a: it's commented out, and b: It's the only place in the .wps "ylfull.bmp" exists (it's not loaded anywhere first...)

None of the things should stop the .wps from working though...Not drawing in the default viewport, using bitmap-strips where you can, etc. are just "good housekeeping" in my opinion and shouldn't have any effect on the output.
And line 46 isn't really hurting anyone sitting there doing nothing...but, for the final product everything helps (remember, you may not be the only one reading your code ;))

I'll run checkwps on it when I get home, and if no-one else has found it by then I'll post the output.


[St.]
Title: Re: Sth. wrong with my WPS!
Post by: yzflcyq on May 02, 2010, 11:18:33 PM
But it's commented...
I'll try to delete all the comment.
Title: Re: Sth. wrong with my WPS!
Post by: jtrodriguez on May 02, 2010, 11:47:30 PM
@jtrodriguez: No offense to your suggestion, but did you take a look at how old those simulator builds are..? Considering his theme is no longer working with more recent builds, a simulator as out-dated as the ones currently being hosted might not help... (Unless the simulator is newer than the build the OP was using... I suppose it can't hurt to try it after all, but if the sim's too old and the theme works, then it's no help...)

He can follow the instructions and build the latest version its not that hard.

**
If you haven't tried it... try the simulators that are there they are not that old I think they are 3.5 assuming you were using a rockbox much older to make the tags broken.



...
EDIT

Went ahead and grabbed the simulator and loaded up took a few min but from what I can tell you are calling on non-existing images

%xl|J|
%xl|I|

need to be added or removed from being called in other words your code should be

Code: [Select]
%X|wps.bmp|
%wd
%xl|G|ab.bmp|160|275|
#
%xl|H|lock.bmp|5|9|
%xl|Z|rating.bmp|175|97|11|
%?rr<%xdZa|%xdZb|%xdZc|%xdZd|%xdZe|%xdZf|%xdZg|%xdZh|%xdZi|%xdZj|%xdZk>
%xl|h|hdd.bmp|21|11|
%?lh<%xdh>
%xl|b|bat.bmp|209|2|6|
%xl|p|charging.bmp|176|2|2|
%?bl<%xdba|%xdbb|%xdbc|%xdbd|%xdbe|%xdbf>
%?bp<%xdpb>
#
%xl|K|all.bmp|160|356|
%xl|L|one.bmp|160|356|
%xl|M|shuffle.bmp|160|356|
%T|160|355|25|23|repmode|
#
%xl|N|shuffle_on.bmp|185|355|
%xl|O|shuffle_off.bmp|185|355|
%T|185|355|24|23|shuffle|
#
%xl|T|stop.bmp|12|341|
%xl|U|play.bmp|12|341|
%T|61|345|46|48|play|
%T|61|345|46|48|&stop|
%xl|V|pause.bmp|12|341|
%xl|W|ff.bmp|12|341|
%T|12|355|46|23|prev|
%T|110|355|46|23|next|
%T|12|355|46|23|&rwd|
%T|110|355|46|23|&ffwd|
%xl|X|rew.bmp|12|341|
%xl|Y|Top.bmp|20|130|
#
%pb|pb.bmp|0|336|240|4|
%?mh<%xdH> ############# Was %?mh<%xdH|%xdI>
%?ps<%xdN|%xdO>
%?mm<|%xdK|%xdL|%xdM|%xdG> ######## Was %?mm<%xdJ|%xdK|%xdL|%xdM|%xdG>
%?mp<%xdT|%xdU|%xdV|%xdW|%xdX>
#
%xl|v|ylbg.bmp|12|302|
%?mv5<%xdv%Vdv>
%xl|w|ylstep.bmp|42|302|10|
#%x|y|ylfull.bmp|42|302|
%?pv<|%xdwa|%xdwb|%xdwc|%xdwd|%xdwe|%xdwf|%xdwg|%xdwh|%xdwi|%xdwj>
#
%T|0|336|240|4|progressbar|
%T|20|3|134|23|browse|
%T|20|3|134|23|&menu|
%T|103|28|136|20|playlist|
%T|2|129|236|85|contextmenu|
%T|2|129|236|85|&playlist|
%T|3|29|98|98|contextmenu|
%T|2|230|236|50|playlist|
%T|16|302|26|26|voldown|
%T|201|302|26|26|volup|
%T|42|302|155|26|volume|
#
%V|50|4|104|30|1|-|-|
%s%al%?pn<%pn>
#
%V|4|30|96|96|0|-|-|
%Cl|0|0|c96|c96|
%C
#
%V|216|18|24|8|0|ffffff|-|
%bl%%
#
%V|105|28|134|20|1|e8e4b4|-|
%s%ac%pp/%pe
#
%V|103|51|136|16|0|-|-|
%s%ar%?fv<~>%fbKbps %fc,%ffHz
%ar%fsKB%?iv<,ID3 v%iv>
#
%V|103|72|136|8|0|-|-|
%s%arU.Rating:%?rr<0.0|0.5|1.0|1.5|2.0|2.5|3.0|3.5|4.0|4.5|5.0>/5.0
%V|143|72|72|8|0|ffffff|-|
%s%arU.Rating:%?rr<0.0|0.5|1.0|1.5|2.0|2.5|3.0|3.5|4.0|4.5|5.0>
%V|103|80|136|16|0|-|-|
%s%arA.Rating:%?ra<0.0|0.5|1.0|1.5|2.0|2.5|3.0|3.5|4.0|4.5|5.0>/5.0
%s%arPlayed %rp
%V|197|80|19|8|0|ffffff|-|
%s%?ra<0.0|0.5|1.0|1.5|2.0|2.5|3.0|3.5|4.0|4.5|5.0>
#
%V|103|111|136|16|0|-|-|
%s%ar%?bs<SleepTimer>
%ar%?bs<%bs>
#
%V|18|129|220|20|1|e8e4b4|-|
%s%al%?ik<Disc %ik->%?in<Nº %in.>%?it<%it|%fn>
%V|18|149|220|85|1|ffffff|-|
%s%al%?ia<%ia|--->
%s%al%?id<%id|--->
%s%al%?ig<%t3%ig|%t3--->;%s%al%?iy<%t3%iy|%t0>
#
%V|18|216|220|70|1|ffffff|-|
%Vp|1|%s%it-%ia|%s%fn|
#
%V|12|292|215|8|0|e8e4b4|-|
%acVolume:%pvdB   RGain:%?rg<Off|%rg|%rg|%rg|%rg|%rg|No tag>
%Vl|v|12|292|215|8|0|ffffff|-|
%acVolume:%pvdB   RGain:%?rg<Off|%rg|%rg|%rg|%rg|%rg|No tag>
#
%V|0|341|60|8|0|ffffff|-|
-%pr/%pc
#
%V|215|341|25|8|0|ffffff|-|
%pt
Title: Re: Sth. wrong with my WPS!
Post by: [Saint] on May 03, 2010, 12:16:12 AM
I wanted to show you what I meant by "cleaned up a little/easier to read"

Code: [Select]
%wd
#
%X|wps.bmp|
#
%xl|b|bat.bmp|209|2|6|
%xl|h|hdd.bmp|21|11|
%xl|p|charging.bmp|176|2|2|
%xl|v|ylbg.bmp|12|302|
%xl|w|ylstep.bmp|42|302|10|
%xl|G|ab.bmp|160|275|
%xl|H|lock.bmp|5|9|
%xl|K|all.bmp|160|356|
%xl|L|one.bmp|160|356|
%xl|M|shuffle.bmp|160|356|
%xl|N|shuffle_on.bmp|185|355|
%xl|O|shuffle_off.bmp|185|355|
%xl|T|stop.bmp|12|341|
%xl|U|play.bmp|12|341|
%xl|V|pause.bmp|12|341|
%xl|W|ff.bmp|12|341|
%xl|X|rew.bmp|12|341|
%xl|Y|Top.bmp|20|130|
%xl|Z|rating.bmp|175|97|11|
#
%?pv<|%xdwa|%xdwb|%xdwc|%xdwd|%xdwe|%xdwf|%xdwg|%xdwh|%xdwi|%xdwj>
%?rr<%xdZa|%xdZb|%xdZc|%xdZd|%xdZe|%xdZf|%xdZg|%xdZh|%xdZi|%xdZj|%xdZk>
%?lh<%xdh>
%?bl<%xdba|%xdbb|%xdbc|%xdbd|%xdbe|%xdbf>
%?bp<%xdpb>
%?mv5<%xdv%Vdv>
%?mh<%xdH|%xdI>
%?ps<%xdN|%xdO>
%?mm<%xdJ|%xdK|%xdL|%xdM|%xdG>
%?mp<%xdT|%xdU|%xdV|%xdW|%xdX>
%pb|pb.bmp|0|336|240|4|
#
%T|160|355|25|23|repmode|
%T|185|355|24|23|shuffle|
%T|61|345|46|48|play|
%T|61|345|46|48|&stop|
%T|12|355|46|23|prev|
%T|110|355|46|23|next|
%T|12|355|46|23|&rwd|
%T|110|355|46|23|&ffwd|
%T|0|336|240|4|progressbar|
%T|20|3|134|23|browse|
%T|20|3|134|23|&menu|
%T|103|28|136|20|playlist|
%T|2|129|236|85|contextmenu|
%T|2|129|236|85|&playlist|
%T|3|29|98|98|contextmenu|
%T|2|230|236|50|playlist|
%T|16|302|26|26|voldown|
%T|201|302|26|26|volup|
%T|42|302|155|26|volume|
#
%V|50|4|104|30|1|-|-|
%s%al%?pn<%pn>
#
%V|4|30|96|96|0|-|-|
%Cl|0|0|c96|c96|
%C
#
%V|216|18|24|8|0|ffffff|-|
%bl%%
%V|105|28|134|20|1|e8e4b4|-|
%s%ac%pp/%pe
%V|103|51|136|16|0|-|-|
%s%ar%?fv<~>%fbKbps %fc,%ffHz
%ar%fsKB%?iv<,ID3 v%iv>
%V|103|72|136|8|0|-|-|
%s%arU.Rating:%?rr<0.0|0.5|1.0|1.5|2.0|2.5|3.0|3.5|4.0|4.5|5.0>/5.0
%V|143|72|72|8|0|ffffff|-|
%s%arU.Rating:%?rr<0.0|0.5|1.0|1.5|2.0|2.5|3.0|3.5|4.0|4.5|5.0>
%V|103|80|136|16|0|-|-|
%s%arA.Rating:%?ra<0.0|0.5|1.0|1.5|2.0|2.5|3.0|3.5|4.0|4.5|5.0>/5.0
%s%arPlayed %rp
%V|197|80|19|8|0|ffffff|-|
%s%?ra<0.0|0.5|1.0|1.5|2.0|2.5|3.0|3.5|4.0|4.5|5.0>
%V|103|111|136|16|0|-|-|
%s%ar%?bs<SleepTimer>
%ar%?bs<%bs>
%V|18|129|220|20|1|e8e4b4|-|
%s%al%?ik<Disc %ik->%?in<Nº %in.>%?it<%it|%fn>
%V|18|149|220|85|1|ffffff|-|
%s%al%?ia<%ia|--->
%s%al%?id<%id|--->
%s%al%?ig<%t3%ig|%t3--->;%s%al%?iy<%t3%iy|%t0>
%V|18|216|220|70|1|ffffff|-|
%V|12|292|215|8|0|e8e4b4|-|
%acVolume:%pvdB   RGain:%?rg<Off|%rg|%rg|%rg|%rg|%rg|No tag>
%V|0|341|60|8|0|ffffff|-|
-%pr/%pc
%V|215|341|25|8|0|ffffff|-|
%pt
#
%Vl|v|12|292|215|8|0|ffffff|-|
%acVolume:%pvdB   RGain:%?rg<Off|%rg|%rg|%rg|%rg|%rg|No tag>
#
%Vp|1|%s%it-%ia|%s%fn|


I hope you can see from this, how much easier it would be for someone else coming along to read the code, and probably yourself also...
I haven't made any functional changes to your code, just organised it a little better, and into sections of similar groups of code (which I personally find a lot easier to follow both visually and mentally)
A few more things:

-Why are the identifier tags for the .bmps so seemingly erratic?
Why not: "%xl|A|, %xl|B|, %xl|C| etc?
I put them in alphabetical order at least in my example, I find the identifiers *really* hard to follow in the code you posted.
-I also noticed that "%?bp" calls "%xdpb", but there is no call anywhere for "%xdpa" so, that is one instance where you can *remove* the use of a bitmap-strip (Which contradicts my earlier post a little ;))
-Oh, I also removed that commented line I mentioned earlier.

I realised that running it in a SIM isn't going to do me any good, as you haven't posted the full .wps (including images .etc), so I can't help you any more than I have already really (not without the full .wps zip at least).

My best suggestion would be to go with what karashata said, and attempt to submit your .wps to the themesite.

The themesite runs checkwps to parse the theme for errors and gives you an output telling you what you need to fix before the theme can be accepted (this prevents "broken" themes/themes with unacceptable values from being submitted to the themesite) including an approximate line number of where the code fails (it is supposed to be the exact line number, but it very rarely is...it is usually +/- 1 line).

Unfortunately though, it will only list the first error it finds so you may have to submit/correct your code multiple times before it is finally able to be parsed correctly.
This is probably the best way you can do it without setting up your own build environment and building your own (recent) simulator, or posting the full .wps zip and hoping that someone eventually finds the error for you.


[St.]
Title: Re: Sth. wrong with my WPS!
Post by: jtrodriguez on May 03, 2010, 12:23:10 AM
Code: [Select]
%wd
#
%X|wps.bmp|
#
%xl|b|bat.bmp|209|2|6|
%xl|h|hdd.bmp|21|11|
%xl|p|charging.bmp|176|2|2|
%xl|v|ylbg.bmp|12|302|
%xl|w|ylstep.bmp|42|302|10|
%xl|G|ab.bmp|160|275|
%xl|H|lock.bmp|5|9|
%xl|K|all.bmp|160|356|
%xl|L|one.bmp|160|356|
%xl|M|shuffle.bmp|160|356|
%xl|N|shuffle_on.bmp|185|355|
%xl|O|shuffle_off.bmp|185|355|
%xl|T|stop.bmp|12|341|
%xl|U|play.bmp|12|341|
%xl|V|pause.bmp|12|341|
%xl|W|ff.bmp|12|341|
%xl|X|rew.bmp|12|341|
%xl|Y|Top.bmp|20|130|
%xl|Z|rating.bmp|175|97|11|
#
%?pv<|%xdwa|%xdwb|%xdwc|%xdwd|%xdwe|%xdwf|%xdwg|%xdwh|%xdwi|%xdwj>
%?rr<%xdZa|%xdZb|%xdZc|%xdZd|%xdZe|%xdZf|%xdZg|%xdZh|%xdZi|%xdZj|%xdZk>
%?lh<%xdh>
%?bl<%xdba|%xdbb|%xdbc|%xdbd|%xdbe|%xdbf>
%?bp<%xdpb>
%?mv5<%xdv%Vdv>
%?mh<%xdH>                    ######## Was %?mh<%xdH|%xdI>
%?ps<%xdN|%xdO>
%?mm<|%xdK|%xdL|%xdM|%xdG>                       ####### Was %?mm<%xdJ|%xdK|%xdL|%xdM|%xdG>
%?mp<%xdT|%xdU|%xdV|%xdW|%xdX>
%pb|pb.bmp|0|336|240|4|
#
%T|160|355|25|23|repmode|
%T|185|355|24|23|shuffle|
%T|61|345|46|48|play|
%T|61|345|46|48|&stop|
%T|12|355|46|23|prev|
%T|110|355|46|23|next|
%T|12|355|46|23|&rwd|
%T|110|355|46|23|&ffwd|
%T|0|336|240|4|progressbar|
%T|20|3|134|23|browse|
%T|20|3|134|23|&menu|
%T|103|28|136|20|playlist|
%T|2|129|236|85|contextmenu|
%T|2|129|236|85|&playlist|
%T|3|29|98|98|contextmenu|
%T|2|230|236|50|playlist|
%T|16|302|26|26|voldown|
%T|201|302|26|26|volup|
%T|42|302|155|26|volume|
#
%V|50|4|104|30|1|-|-|
%s%al%?pn<%pn>
#
%V|4|30|96|96|0|-|-|
%Cl|0|0|c96|c96|
%C
#
%V|216|18|24|8|0|ffffff|-|
%bl%%
%V|105|28|134|20|1|e8e4b4|-|
%s%ac%pp/%pe
%V|103|51|136|16|0|-|-|
%s%ar%?fv<~>%fbKbps %fc,%ffHz
%ar%fsKB%?iv<,ID3 v%iv>
%V|103|72|136|8|0|-|-|
%s%arU.Rating:%?rr<0.0|0.5|1.0|1.5|2.0|2.5|3.0|3.5|4.0|4.5|5.0>/5.0
%V|143|72|72|8|0|ffffff|-|
%s%arU.Rating:%?rr<0.0|0.5|1.0|1.5|2.0|2.5|3.0|3.5|4.0|4.5|5.0>
%V|103|80|136|16|0|-|-|
%s%arA.Rating:%?ra<0.0|0.5|1.0|1.5|2.0|2.5|3.0|3.5|4.0|4.5|5.0>/5.0
%s%arPlayed %rp
%V|197|80|19|8|0|ffffff|-|
%s%?ra<0.0|0.5|1.0|1.5|2.0|2.5|3.0|3.5|4.0|4.5|5.0>
%V|103|111|136|16|0|-|-|
%s%ar%?bs<SleepTimer>
%ar%?bs<%bs>
%V|18|129|220|20|1|e8e4b4|-|
%s%al%?ik<Disc %ik->%?in<Nº %in.>%?it<%it|%fn>
%V|18|149|220|85|1|ffffff|-|
%s%al%?ia<%ia|--->
%s%al%?id<%id|--->
%s%al%?ig<%t3%ig|%t3--->;%s%al%?iy<%t3%iy|%t0>
%V|18|216|220|70|1|ffffff|-|
%V|12|292|215|8|0|e8e4b4|-|
%acVolume:%pvdB   RGain:%?rg<Off|%rg|%rg|%rg|%rg|%rg|No tag>
%V|0|341|60|8|0|ffffff|-|
-%pr/%pc
%V|215|341|25|8|0|ffffff|-|
%pt
#
%Vl|v|12|292|215|8|0|ffffff|-|
%acVolume:%pvdB   RGain:%?rg<Off|%rg|%rg|%rg|%rg|%rg|No tag>
#
%Vp|1|%s%it-%ia|%s%fn|

This is fixed version of [St.]'s clean-up version
Title: Re: Sth. wrong with my WPS!
Post by: [Saint] on May 03, 2010, 12:36:28 AM
Thanks jtrodriguez,

I *really* should have seen that ;)

Though, it makes me wonder how this .wps EVER worked in the first place... ???
As far as I know, any version of rockbox should have failed to parse this .wps if an identifier is called but not loaded.


[St.]
Title: Re: Sth. wrong with my WPS!
Post by: jtrodriguez on May 03, 2010, 12:41:40 AM
Thanks jtrodriguez,

I *really* should have seen that ;)

Though, it makes me wonder how this .wps EVER worked in the first place... ???
As far as I know, any version of rockbox should have failed to parse this .wps if an identifier is called but not loaded.


[St.]

It must be a couple years old because I had the same issue when updating FSM... I had called non-existing stuff just as fillers :\
Title: Re: Sth. wrong with my WPS!
Post by: Yotto on May 03, 2010, 01:23:04 AM
If his build of Rockbox is *really* old (I'm talking years) then any errors in the wps would be ignored by the parser, and the wps would display anyway. It was quite possible (and possibly common) for wps' with errors to look perfectly fine and go unfixed.
Title: Re: Sth. wrong with my WPS!
Post by: jtrodriguez on May 03, 2010, 01:26:23 AM
If his build of Rockbox is *really* old (I'm talking years) then any errors in the wps would be ignored by the parser, and the wps would display anyway. It was quite possible (and possibly common) for wps' with errors to look perfectly fine and go unfixed.

Recently updated one of my themes after a couple years of it being dead and the simulator caught the errors in it... just like these errors were caught by the simulator that is available.
Title: Re: Sth. wrong with my WPS!
Post by: yzflcyq on May 03, 2010, 03:35:32 AM
Thanks for every help.
I've tried your codes and I also tried hard to fix it.However I finally failed.
Title: Re: Sth. wrong with my WPS!
Post by: [Saint] on May 03, 2010, 07:53:46 AM
yzflcyq,

Again..."try submitting this to the themesite (http://themes.rockbox.org/upload.php)"

This *will* tell you where your code is failing.
My cleanup changed nothing about the code apart from it's physical appearance, and jtrodriguez simply removed calls to images that are no longer/were never present (loaded, or "%xl|"ed).
My changes did nothing except for aesthetics, jtrodriguez made the syntax able to parse again.

However, in saying that, he *did* use a simulator and I'm not sure if he compiled the simulator from current SVN or wether he just grabbed the 3.5 sim from Rasher's page...

If he used the 3.5 simulator it would most certainly pick up *some* of the bugs/code errors but if you are using a current/daily build, then several .wps syntaxes have changed reasonably recently and the .wps will likely still fail.

If you are not inclined to make your own build environment (http://www.rockbox.org/wiki/DevelopmentGuide#Set_Up_Your_Environment)/compile (http://www.rockbox.org/wiki/DevelopmentGuide#Build_Rockbox) a sim from current SVN then my only suggestion is to attempt to upload this .wps to the themesite (http://themes.rockbox.org/upload.php) and make a note of the parsing errors that it spits out at you and fix them.
For you, this is probably the easiest option.


[St.]
Title: Re: Sth. wrong with my WPS!
Post by: yzflcyq on May 03, 2010, 07:57:31 AM
SOLVED:It load two more images that are not existed...(Top.bmp,stop.bmp)
Thanks!