Rockbox Technical Forums

Support and General Use => Theming and Appearance Customization => Topic started by: wintermute23 on April 30, 2008, 04:30:41 PM

Title: Maximum number of viewports?
Post by: wintermute23 on April 30, 2008, 04:30:41 PM
I have a WPS which worked fine, and then I added an innocuous extra bit of information to it, and it hung whenever I went to play music; it didn't even give me the default WPS, just froze up saying "Loading".

A little investigation discovered that it was because I had increased the number of viewports (not including the implicit, fullscreen VP) from 15 to 16. Am I right in thinking that this is a hard limit? Does it vary between targets? Is this a bug to be fixed, or a feature that will remain for the forseeable future?

I think the Wiki page on building custom WPS's ought to include this datum, but (as a newcomer here (though not to RockBox)) I don't plan to change it without knowing other people's opinions. I have no idea what discussions on this topic I've missed.
Title: Re: Maximum number of viewports?
Post by: gevaerts on April 30, 2008, 04:36:22 PM
I'm not a viewport specialist, but the code contain the line
Code: [Select]
#define WPS_MAX_VIEWPORTS   16so I think you are correct. This limit is the same for all players with a bitmap screen.
Title: Re: Maximum number of viewports?
Post by: hhannah on April 30, 2008, 05:25:32 PM
Additionally, by experience, I'd say that the limit would "normally" be enough to make WPS's work; it would take a quite complicated WPS to need more viewports; what I'm saying is, if you feel you need an extra viewport, you could probably "eliminate" an unnecessary viewport definition, to have a free viewport under the limit.
Title: Re: Maximum number of viewports?
Post by: wintermute23 on April 30, 2008, 06:08:14 PM
That is indeed what I discovered. I've successfully eliminated three, and there are a couple of others that can go, too.

I'd just managed to get myself into a 1 datum per viewport mindset, which is convenient enough, so long as you don't have too much data on the WPS.
Title: Re: Maximum number of viewports?
Post by: BdN3504 on July 01, 2008, 08:13:52 AM
Sorry for hijacking this thread but the title fits my concerns...
In the commit changing the wps syntax etc. the maximum number of VPs has been increased to 24. In the original discussion thread to this commit, it has been suggested that this number could easily be raised to 32. I'm recently working on a WPS that uses conditional viewports and have now come to the conclusion that 24 VPs is too little, 32 would be perfect. Could we still change this without breaking everything else in the recent build?
Title: Re: Maximum number of viewports?
Post by: JdGordon on July 01, 2008, 10:35:09 AM
show us the WPS... im willing to bet it can be cleaned up so it doesnt need more than 24...

AND PLEASE CHANGE YOUR AVATAR!
Title: Re: Maximum number of viewports?
Post by: BdN3504 on July 02, 2008, 06:00:57 AM
Code: [Select]
%wd
%X|bg.bmp|
%xl|P|pla.bmp|7|94|5|
%xl|S|shu.bmp|94|4|2|
%xl|H|hol.bmp|128|3|2|
%xl|R|rep.bmp|114|5|2|
%xl|V|vol.bmp|115|19|20|
%xl|B|bat.bmp|155|5|5|
%xl|A|AA.bmp|86|134|
%xl|N|noAA.bmp|0|133|
%pb|pb.bmp|6|80|164|9|

%?mp<%xdPa|%xdPb|%xdPc|%xdPd|%xdPe>
%?mh<%xdHa|%xdHb>
%?mm<%xdRa|%xdRb|%xdRb|%xdRb%xdSa|%xdRb>
%?ps<%xdSa|%xdSb>
%?bl<%xdBa|%xdBa|%xdBb|%xdBc|%xdBd|%xdBe|%xdBe>
%?pv<%xdVa|%xdVb|%xdVc|%xdVd|%xdVe|%xdVf|%xdVg|%xdVh|%xdVi|%xdVj|%xdVk|%xdVl|%xdVm|%xdVn|%xdVo|%xdVp|%xdVq|%xdVr|%xdVs|%xdVt>
%Cl|7|138|c75|c75|
%?C<%C%xdA|%xdN>
%?C<%Vda%Vdb%Vdc%Vdd%Vde%Vdf%Vdg%Vdh%Vdi%Vdj|%Vdk%Vdl%Vdm%Vdn%Vdo%Vdp%Vdq%Vdr%Vds%Vdt>

%V|8|6|78|10|0|333333|333333|
%ar%ca, %cH:%cM:%cS
%V|8|17|78|10|0|333333|333333|
%ar%cd.%cm.%cY
%V|139|5|13|10|0|e5ecf8|e5ecf8|
%bl
%V|94|17|18|10|0|e5ecf8|e5ecf8|
%ar%pv
%V|136|46|28|10|0|333333|333333|
%ac%pp/%pe
%V|100|43|36|14|1|333333|333333|
%ac%fc
%V|98|61|68|14|0|333333|333333|
%ac%pc/%pt
%V|12|36|68|14|1|f3f7ff|ff00ff|
%ac-%pr
%V|48|55|36|10|0|d1d7e2|d1d7e2|
%ac%fb
%V|48|64|36|10|0|d1d7e2|d1d7e2|
%ac%fk
%V|30|93|137|14|1|e9effb|e9effb|
%s%al%?ia<%ia|Artist unknown> - %?it<%it|%fn>
%V|8|114|162|14|1|dae0eb|dae0eb|
%t2Next Up:;%t8%s%al%?Ia<%Ia|Artist unknown> - %?It<%It|%Fn>;

%Vl|a|84|136|88|10|0|333333|333333|
Artist:
%Vl|b|84|146|88|8|0|4b4c51|4b4c51|
%s%ac%?ia<%ia|unknown>

%Vl|c|84|156|88|10|0|333333|333333|
Album:
%Vl|d|84|166|88|8|0|4b4c51|4b4c51|
%t2%ac%?id<%id|%d1>;%t6%ac%s%?id<%id|%d1>;

%Vl|e|84|177|40|10|0|333333|333333|
Year:
%Vl|f|84|187|40|8|0|4b4c51|4b4c51|
%t2%ar%?iy<%iy|unknown>;%t4%s%ar%?iy<%iy|unknown>;
%Vl|g|128|177|44|10|0|333333|333333|
Size:
%Vl|h|128|187|44|8|0|4b4c51|4b4c51|
%t2%ar%?fs<%fs|unknown>;%t4%s%ar%?fs<%fs|unknown>;

%Vl|i|84|199|40|20|0|6e6f77|6e6f77|
Rating:
%s%ar%rr
%Vl|j|128|199|44|20|0|6e6f77|6e6f77|
%t2Times Played:;%t4%sTimes Played:;
%s%ar%rp

%Vl|k|2|136|172|10|0|333333|333333|
Artist:
%Vl|l|2|146|172|8|0|4b4c51|4b4c51|
%s%ac%?ia<%ia|unknown>

%Vl|m|2|156|172|10|0|333333|333333|
Album:
%Vl|n|2|166|172|8|0|4b4c51|4b4c51|
%t2%ac%?id<%id|%d1>;%t6%ac%s%?id<%id|%d1>;

%Vl|o|2|177|86|10|0|333333|333333|
Year:
%Vl|p|2|187|86|8|0|4b4c51|4b4c51|
%t2%ar%?iy<%iy|unknown>;%t4%s%ar%?iy<%iy|unknown>;
%Vl|q|88|177|86|10|0|333333|333333|
Size:
%Vl|r|88|187|86|8|0|4b4c51|4b4c51|
%t2%ar%?fs<%fs|unknown>;%t4%s%ar%?fs<%fs|unknown>;

%Vl|s|2|199|86|20|0|6e6f77|6e6f77|
Rating:
%s%ar%rr
%Vl|t|88|199|86|20|0|6e6f77|6e6f77|
%t2Times Played:;%t4%sTimes Played:;
%s%ar%rp

The Problem is, if you don't have the different colours this theme will lose it's originality. Because the original of it uses the multifont patch and as i wanted to make it standard svn compliant, i removed the multiple fonts, so all that's left for alternation are the text colours. Plus on the bottom, you can't merge the two VPs that go together, because the space is needed for a line that is in the background that would be overdrawn if you changed the dimensions of these VPs (i.e. making the height of each 10+8 into 18 or 20 as it's done with the last 2 VPs).

What's wrong with my avatar? Please stop getting angry about things that don't matter. i would understand it, if my avatar was too big and would take up too much space or distort the layout. But it's just a small gif, so i don't think it needs change.
Title: Re: Maximum number of viewports?
Post by: PaulJam on July 02, 2008, 06:31:28 AM
Hi,

i think you could get rid of many viewports by just displaying images (with pink background, so you can reuse them) containing the static texts (Album, Year, etc.).
By the way, you can use the same descriptor for multiple viewports that are shown on the same condition. This would improve readability a bit.

OT: concerning your avatar: that heavy flickering is very disturbing and makes it hard to concentrate on the text and people might loose interest to read it further. So it would be in your own interest to change that.
Title: Re: Maximum number of viewports?
Post by: BdN3504 on July 02, 2008, 07:48:34 AM
By the way, you can use the same descriptor for multiple viewports that are shown on the same condition. This would improve readability a bit.
Do you mean this
Code: [Select]
%Vl|a|84|136|88|10|0|333333|333333|
Artist:
%Vl|a|84|146|88|8|0|4b4c51|4b4c51|
%s%ac%?ia<%ia|unknown>

%Vl|a|84|156|88|10|0|333333|333333|
Album:
%Vl|a|84|166|88|8|0|4b4c51|4b4c51|
%t2%ac%?id<%id|%d1>;%t6%ac%s%?id<%id|%d1>;
instead of this:
Code: [Select]
%Vl|a|84|136|88|10|0|333333|333333|
Artist:
%Vl|b|84|146|88|8|0|4b4c51|4b4c51|
%s%ac%?ia<%ia|unknown>

%Vl|c|84|156|88|10|0|333333|333333|
Album:
%Vl|d|84|166|88|8|0|4b4c51|4b4c51|
%t2%ac%?id<%id|%d1>;%t6%ac%s%?id<%id|%d1>;

I haven't thought about that, good point. And to make the static Text into bitmaps is also good. Update will follow soon - Thank you!