Support and General Use > Theming and Appearance Customization

Artwork Tag in WPS - More than one tag in code doesnt work?

(1/2) > >>

bpg:
Hello world! :)

The tags %Cl and %Cd can't appear more than once in the code?

If I want to have the cover appear with different size/position depending on some condition, like hold switch on, I would make something like this:


--- Code: ---# Hold?
%?mh<%Vd(a)|%Vd(b)>
%Vl(a,1,1,50,50,1)
%Cl(0,0,50,50,c,c)%Cd
%Vl(b,50,50,100,100,1)
%Cl(0,0,100,100,c,c)%Cd
--- End code ---
or

--- Code: ---# Hold?
%?mh<%Vd(a)|%Vd(b)>
%?mh<%Cl(0,0,50,50,c,c)|%Cl(0,0,100,100,c,c)>
%Vl(a,1,1,50,50,1)
%Cd
%Vl(b,50,50,100,100,1)
%Cd
--- End code ---

but the %Cl tag that comes last is the one who defines the art no matter the conditionals.
I'm guessing the answer is no? Thanks for any help guys.

Tested on Fuze v1, Rockbox 3.13

[Saint]:
You are absolutely right, and, this is expected behaviour.

There's some work in progress in this area, but personally I haven't had much time for Rockbox lately barring occasionally handling support on the forum, so I haven't had much of a chance to torture test the code or speak of my views of preferred syntax should it indeed be included, which may never actually happen.

There was some speculation a while ago that we're going to try squeeze out a release either before, or during, DevCon. If this is the case, it definitely won't be happening before then (feature freeze).


[Saint]

JdGordon:
Hi, As [Saint] said I actually put up a patch to do just what you want last week! (and in fact your little snippet is almost exactly how I tested it :p )

http://gerrit.rockbox.org/r/#/c/839/ is the link (you need to compile it yourself) or you can use this (which I've just built for you) http://melb.jdgordon.info/rockbox/rockbox-multiaa.zip

Use this snippet to display it!


--- Code: ---# Hold?
%?mh<%Vd(a)|%Vd(b)>
%Vl(a,1,1,50,50,1)
%Cx(0,0,50,50,c,c)
%Vl(b,50,50,100,100,1)
%Cx(0,0,100,100,c,c)

--- End code ---

I'm eager to get feedback so this can be finished up and committed so let me know how it goes and how/if you think it should be changed.

My main issue is that I think it should be possible to check the next tracks AA image and have it displayed, and if that is possible how it should work.

bpg:
Great! I didn't exactly stress tested it but it seems to work just fine for conditional viewports, using the build you provided. On the other hand, I don't know if it's just me but with this build my battery seems to be draining a bit; I should benchmark it to see. Also, I tried to use multiple %Cx as alternating sublines out of curiosity, but it doesn't seem to work well though.

Anyway, with what you implemented there are much more possibilities with AA in WPS, like toggling between a big AA and other infos. It would be nice to have this committed.

Thanks a lot JdGordon and [Saint] also.

[Saint]:
The only reservation I have about this is the syntax.

Ideally, here's how I would like it to go:


--- Code: ---# Basic example theme to show syntax usage
%Cl(big_art,x,y,w,h,x-align,y-align)
%Cl(bigger_art,x,y,w,h,x-align,y-align)
%Cl(really_big_art,x,y,w,h,x-align,y-align)
%Cl(small_art,x,y,w,h,x-align,y-align)
#
%V(x,y,w,h,-)
%Cd(big_art)
#
%V(x,y,w,h,-)
%Cd(bigger_art)
#
%V(x,y,w,h,-)
%Cd(really_big_art)
#
%V(x,y,w,h,-)
%Cd(small_art)
--- End code ---

And so on.

This, in my opinion, has a few advantages over the proposed submission.
The most obvious one in my mind is consistency. This makes %Cl behave exactly the same (at least in regard to syntax) as any other preloaded theme element, images, viewports, fonts, etc.

The element is preloaded once, and can then be called upon as many times as desired after the fact using the element's identifier.
Exactly similar to how images and viewports are handled.

I think it is important to at least attempt to have a consistent syntax and flow, especially between similar elements.
In theory at least, album art is identical to any other image displayed in the theme and should be handled as such.

Ideally, I would like to change the %Cl tag to %cl as well, in order to make the case more consistent with other tags that perform similar functions, but that would be a skin breaking change (however, we could run a find and replace script across the theme server to minimize disruption as we have done in the past).

I would also like to change the %Cd tag to %cd, again for consistency, and the thought just occurred to me that one could use %cD as the "next album art" tag, which is consistent with the metadata display tag syntax for displaying the next item.


[Saint]

Navigation

[0] Message Index

[#] Next page

Go to full version