Rockbox Technical Forums

Support and General Use => Theming and Appearance Customization => Topic started by: [Saint] on December 21, 2009, 08:39:30 AM

Title: Help find bug/code error in WPS.........Anyone?
Post by: [Saint] on December 21, 2009, 08:39:30 AM
Hi,

I've been working on a WPS for iPod Nano 1st/2nd Gen for some time now, and I'm at a point now where I *could* release it, if it wasn't for an odd behaviour with alternating sublines used in conditional viewports that for the life of me, I just can't figure out.

The code I have written seems to suggest the behaviour I am getting is not possible, but I'll leave that for someone with more technical experience in this field than myself to judge with any certainty.

I have 3 Conditional Viewports that display different Track Information when;

Album Art is present
Album Art is NOT present
Hold Switch is ON

They are all of the same size, in the same place, but none are called at the same time so no overlapping occurs.

AA present/NOT present viewports have alternating sublines.
Hold Switch ON viewport displays differing info if playing/paused.

The Problem:

When hold is on the AA Present/AA NOT Present viewports are NOT displayed, but the alternating sublines in AA Present/NOT Present are still queued (apparently) and are displayed in rapid succession (approximately 0.1 sec intervals) upon releasing the hold switch.
The sub-lines will not resume their propper alternation (10 & 2.5 second intervals) until the total amount of alternations for the period the hold switch was on for is displayed.
ie. If the hold switch was on for 10 minutes, 60 - 240 alternations must seemingly be displayed before the propper rate is resumed, and nothing can be done to skip this.

I assume if the hold switch was left on it would eventually overflow the buffer but have not tested this.

I am REALLY keen to get this sorted out so I can finally upload this WPS to the Theme Site.

I've tried a great many number of ways of achieving the same effect in differing ways, but all lead to the same result and I'm at a point now where I just can't figure it out by myself.
Please help me get this WPS finished and on the theme site finally, it's been a long time coming!


A copy of the WPS is attached, a full .Zipped version can be PMed or Emailed on an individual basis upon request (if you want to actually see the error happening), if it helps I can even suppy a current SIM for iPod Nano (r24095-091222) if needed as well.



[St.]
Title: Re: Help needed to find bug/code error in WPS
Post by: JdGordon on December 21, 2009, 01:58:49 PM
attach the theme to the thread or dont expect to get any assistance.
Title: Re: Help needed to find bug/code error in WPS
Post by: mc2739 on December 21, 2009, 02:11:07 PM
Also, it would help to know which version or revision of Rockbox you are working with.
Title: Re: Help needed to find bug/code error in WPS
Post by: [Saint] on December 21, 2009, 11:49:24 PM
Sorry, the version is (r24095-091222)

I have now editted my original post to include the WPS file:

http://forums.rockbox.org/index.php?action=dlattach;topic=23443.0;attach=4001


Sincerely,
[St.]
Title: Re: Help needed to find bug/code error in WPS
Post by: JdGordon on December 22, 2009, 12:23:38 AM
upload the zip somewhere.. yousendit.com or something.... first imediate thing is you are drawing the the default viewport which isnt allowed if other viewports are specified
Title: Re: Help needed to find bug/code error in WPS
Post by: [Saint] on December 22, 2009, 04:59:51 AM
upload the zip somewhere..

I've uploaded the WPS here:

http://www.datafilehost.com/download-ce21757f.html

And I've uploaded a current SIM for the iPod Nano 1st Gen (r24095-091222)  here:

http://www.datafilehost.com/download-77639b1c.html

The links to these downloads will remain active as long as someone downloads them at least once every 30 days.

To reproduce the problem set the hold position to ON for a minute or so in the WPS screen whilst playing a track, then release hold and watch the alternating sublines for the track info have a huge spaz-out.


first immediate thing is you are drawing the the default viewport which isn't allowed if other viewports are specified

But this is easily fixed though right?
*I'd just need to specify a viewport at the beginning of the WPS code that is the same size as the screen...yes?

As in:

%V|0|0|176|132|1|FFFFFF|000000| <-176X132 for the Nano
#
*begin the WPS from here...etc.*

That fixes *that* problem at least....right?


*EDIT: (I tried this, and it broke stuff, so...guessing I took it too literally, or did it wrong. Everything seems OK in the code I've uploaded except the sublines on exiting from hold=ON)

How *should* I change it re: the viewports?


Thanks for pointing it out for me, it wasn't something I was aware of.
There has been more than a few learning curves for me whilst building this WPS, it's more complicated than anything I've attempted before now.
But that's not a bad thing at all.

Cheers all,
[St.]