Support and General Use > Theming and Appearance Customization
probable upcoming feature: user customisable track info
JdGordon:
Hi all,
Here to explain a feature I'm working on ( http://gerrit.rockbox.org/r/347 ) for the skin engine to make themeing slightly less annoying for some users.
Currently, the track info that is displayed on the theme is chosen by the themer, but that person probably cares about different track info than the actual user (i.e the themer might care about album but the user might care about the composer). The current solution is for the user to go and edit the wps, but that sucks.
This new feature uses a seperate skin (metadata.txt) which has some specially named viewports which are used whenever the themes wps (or fms, sbs, etc) asks for track data (using the %iu or %Iu tag).
How to use it:
in your WPS you'd have a viewport where you'd ordinarily put a bunch of logic to show the track info... "%?ia<%ia>".... but instead of that you now just put %iu. When the screen is updated and it gets to the %iu tag it checks how many lines of text fit in the current viewport (based on the font the themer asked for) and does a quick search for a viewport in metadata.txt (or inbuilt) for what to display.
i.e if there is enough room to display 6 lines of text it will look for a viewport named "this_6", then "this_5", "this_4" etc untill it finds one. The text from that viewport is then dumped into the theme replacing %iu before continues to draw the rest of the theme.
There is also %Iu for next track info, and it looks for viewports with the "next_" prefix.
The code to make all this work is relativly small so it is quite likely it will be pushed in the next week or two, so I'm looking for some feedback and ideas...
As of patch version 3, you need to carefully name the viewports in metadata.txt, but I'm planning on adding a new viewport tag to just specify the number of lines and if it is this track or next.
Also, it is possible to have both %iu and %Iu in the same viewport, so im thinking about adding optional parameters for them to specify the max and min amount of lines to display.
comments?
sockbox:
Just a single metadata.txt file for multiple wps files? Why not have a UI file for each wps theme? That way a user can have different profiles for each theme. The name for the UI file can be the same as the WPS but with an extension such as *.ui.
I haven't played with this feature yet but will try it out once it gets committed.
herefornow:
Wondered if we would be able to go to a second "wps" for any info that didnt fit the original .wps. Maybe an %iu2 or something?
[Saint]:
--- Quote from: sockbox on November 04, 2012, 07:32:37 PM ---Why not have a UI file for each wps theme? That way a user can have different profiles for each theme. The name for the UI file can be the same as the WPS but with an extension such as *.ui.
--- End quote ---
At this point, the user may as well edit the .wps code themselves, which is precisely what this is supposed to avoid.
The idea here is for it to "just work" across multiple themes, with the (very reasonable) assumption that if the user has a particular set of information that they want displayed it is unlikely to change solely depending on the theme.
--- Quote from: herefornow on November 04, 2012, 09:46:35 PM ---Wondered if we would be able to go to a second "wps" for any info that didnt fit the original .wps. Maybe an %iu2 or something?
--- End quote ---
Hang on, ...wait...what?
[Saint]
JdGordon:
It looks like my explanation still needs some work... Try again.
Lets say you really like theme A, but for some reason the author has 3 lines of track data in some really wierd order (Disc number - disc title, artist, track name - number), or assumes that all tags are there when your files don't have them. currently you'd have to go and rewrite his theme to make it suit your needs...
This patch changes that so as long as he uses "%iu" instead of what *s/he* wants to display it will just work with what *you* want to display, and it will work again when you switch to theme B later.
So, no, there is no need for more than one of these magic files because you always want the same few lines if it fits.
Ditto, herefornow, that doesn't make sense with this use case. I'm providing %iu (placeholder for "show my track info") and %Iu (show the next tracks info) and maybe one for the radio screen, but there is no need for others.
Navigation
[0] Message Index
[#] Next page
Go to full version