Rockbox Technical Forums

Support and General Use => Theming and Appearance Customization => Topic started by: millim on May 21, 2021, 05:06:39 AM

Title: [320x240] Tile based main menu
Post by: millim on May 21, 2021, 05:06:39 AM
Dear community,

I like the Rockbox features and it works well on my ipod 6g. Quick question:  Is it possible to do some sort of tile based main menu appearance? I mean like today's mobile phones do.

Any help welcome! I have checked already the source code and I have the impression it is not supported natively. I do have C/C++ experience and I am wondering why a standard GUI library was not used instead of this unstructured "spaghetti" type of code for the lists and menus. Sure, there might be a good reason for this.

Maybe somebody as already worked in it, willing to share the code.

millim


Title: Re: [320x240] Tile based main menu
Post by: gevaerts on May 21, 2021, 05:43:12 AM
It's been a *long* time since I've played with themes, so I don't remember any details, but https://www.rockbox.org/wiki/CustomWPS#Drawing_the_lists_using_a_skin does mention a tile mode for list views which I seem to remember may actually work.
Title: Re: [320x240] Tile based main menu
Post by: millim on May 25, 2021, 12:39:39 PM
Hello gevaerts!

Thank you very much for your instant reply! Well, this answer does not help much, sorry. I have checked the documentation and all information end where it is getting interesting. Is there a step by step tutorial available? I am not sure what is faster: Debugging the source code or starting trial and error approach writing cryptic .WPS or .SPS files.

Why wasn't the engine based on XML or other proven concepts taken from e.g. Winamp or foobar2000? There might be a good reason for it?

millim
Title: Re: [320x240] Tile based main menu
Post by: gevaerts on May 26, 2021, 09:51:38 AM
As I said, it's been years (nearly a decade) since I played with this, so I don't know. What have you tried?

I can't find a theme that uses tiling, but there are examples that use %Lb for themed lists (for which tiling is an option)
http://themes.rockbox.org/index.php?themeid=2862&target=ipod6g seems to be one of the easier to read ones.
Title: Re: [320x240] Tile based main menu
Post by: millim on May 26, 2021, 11:45:14 AM
Thank you for your answer.

I have already searched the Themes database for an example already  :D - hard luck, no match.
How was this function ever tested, if there is no testcase available?

I want just do it for the main menu, as a "home screen". All other trees should be regular lists.

I see this will be a dead end...

millim
Title: Re: [320x240] Tile based main menu
Post by: Frankenpod on May 26, 2021, 12:22:41 PM
Is this only relevant to touchscreen devices?  Can't really tell from the documentation on the custom WPS page, but seems, intuitively, as if tiles would only make sense in that case.  Unless there's actually something implemented to make the button controls (and clickwheel) move the focus around a tile interface rather than a list menu?

If it's only for touchscreens, that's probably part of the reason why no themes have been written for it, as the majority of themes are not intended for touchscreens.

If it does work for non-touch devices, you (millim) could try writing a theme to use it.  I'm now considering giving it a go, though I can't, at first glance, make a lot of sense out of the linked bit of WPS documentation.
Title: Re: [320x240] Tile based main menu
Post by: millim on May 26, 2021, 03:07:31 PM
Hello Frankenpod!

It makes a lot of sense what you are stating. I think it's not necessarily to be a touch screen. To navigate, left, right, up down or even click wheel would work to navigate through the tile grid. I just want to reach my goal right away, that's why I am asking for already available features of the code requiring minimum effort on changes.

The idea of a "home screen" would be as follows: One could put a flexible number of apps onto the home screen (like on today's mobiles). It is more or less a quick launch screen. With the left, right, up down or even click wheel one could navigate from one app to another (so focus is moving). Two custom bitmaps per app are used to show focus/non-focus behavior (could be general skin style). By clicking select, the app holding focus is executed. So, one could put favorite games, viewers or plugins onto this "home screen". It is not so much different to a standard main menu list, it's custom and 2D with an additional "special" bitmap highlighting focus. The app-list can be defined through the Themes .cfg file. On 320x240 display, 8 to 12 apps would fit, scrolling would do the rest.

If I would understand the skin_engine a bit better, or even get on speed much faster, adding this feature would be fairly easy.
Don't get me wrong, it is a cool thing, I like it. But, I think, customization on code level is not part of the architecture.

millim
 
Title: Re: [320x240] Tile based main menu
Post by: Frankenpod on May 26, 2021, 07:58:30 PM
Unfortunately I really can't make head-nor-tail of the description of how to implement 'tiling' for the main menu.  Sounds as if maybe it would be possible to do it (i.e. make the menu be an N- by-M grid of just the icons, rather than the usual text menu with icons running down the left side), but I can't figure out the WPS syntax to do it.  As you say, it would be a lot easier if there were, even one existing theme that did that already. But there don't seem to be any.  Maybe nobody else could figure out the syntax either?
Title: Re: [320x240] Tile based main menu
Post by: millim on May 27, 2021, 01:47:05 AM
I think it is well documented what needs to be done here:
https://www.rockbox.org/wiki/RoadToSkinLists (https://www.rockbox.org/wiki/RoadToSkinLists)

The article dates back to 18 Feb 2013 (JonathanGordon), quite some time ago..
To quote with a music tile: "Talking Heads - Road to Nowhere"  ;)

millim
Title: Re: [320x240] Tile based main menu
Post by: ginkgo on May 27, 2021, 11:04:11 AM
Hi millim, I've been designing a theme for the Fiio M3K and have been able to create a tiled main menu (using the instructions on this page https://www.rockbox.org/wiki/CustomWPS#Drawing_the_lists_using_a_skin). The example given on that page for using the skin list doesn't use tiling and is a little cryptic but after fiddling it is easy enough. I've attached a screenshot of the theme so far.

To make a tiled style interface you need to set a %Vi (ui viewport) tag, then use an %Lb tag with a labelled viewport (%Vl) to fill the ui viewport with copies of the labelled viewport. I've included some of my .sbs file to demonstrate below. To make the buttons display, I used a bitmap strip.
 
%Vi(-,0,20,-,-,1) # ui viewport

# if we are on the main screen, draw the list using viewport 'main'
%?if(%cs, =, 1)<%Lb(main,120,90,tile)%Vd(titlebar)>

# main viewport
%Vl(main,0,0,120,90,1) # the coordinates here are relative to the %Lb's width and height
%xl(M,mainmenu.bmp,0,0,8) # normal icons
%xl(S,mainmenu-sel.bmp,0,0,8) # selected icons
%?Lc<%xd(S, %LN)|%xd(M, %LN)> # highlights selected icons

# shows the list items title at the bottom of the screen
%Vl(titlebar,0,280,-,-,1)
%s%ac%LT

It's also possible to style the other menus like this, like the settings menu and so on.

I hope you find this helpful, if you need any clarification feel free to reply and I will try to help out.

ginkgo
Title: Re: [320x240] Tile based main menu
Post by: Frankenpod on May 27, 2021, 01:57:47 PM
Hey, thanks very much for that - that example makes the whole thing much more comprehensible.  Been faffing about with it a bit and have a first draft at such an icon menu for the ipod 6/7g.  Needs a _lot_ more work yet, but your example code got me past the complete mental block I was having trying to understand that custom WPS documentation (which, really, I couldn't make head-nor-tail of).

PS - where did you get the icons you used from?   Was looking at wikimedia commons, but yours look better than the tango ones I was trying.
Title: Re: [320x240] Tile based main menu
Post by: ginkgo on May 27, 2021, 03:43:12 PM
PS - where did you get the icons you used from?   Was looking at wikimedia commons, but yours look better than the tango ones I was trying.

Hi Frankenpod, I'm glad you found my post useful. I made the icons myself, they're not online; however, the symbols in the buttons are borrowed from the Papirus icon set (https://github.com/PapirusDevelopmentTeam/papirus-icon-theme) which is GPL-3 licensed.
Title: Re: [320x240] Tile based main menu
Post by: Frankenpod on May 27, 2021, 04:53:03 PM
Well, got a top level tile/icon menu working, but when I try to implement the next level down, it all goes wonky.  It works for that level menu, but you can no longer get the text menus for the level below that - it carries on trying to use the second-level menu icons for everything, and I can't figure out why it's doing that.

I have this code in there:


# if we are on the settings screen, draw the list using viewport 'set'
%?if(%cs, =, 6)<%Lb(set,60,60,tile)%Vd(titlebar)>


# Settings menu viewport
%Vl(set,0,0,60,60,1)
%xl(N,ICONS60x60_SET_whte.bmp,0,0,7) # normal icons
%xl(T,ICONS60x60_SET_whte_S.bmp,0,0,7) # selected icons
%?Lc<%xd(T, %LN)|%xd(N, %LN)> # highlights selected icons

But despite that first conditional statement, it still tries to use that settings viewport/menu in place of all the subsequent lower-level menus, ie.g. the theme selection menu.  Can't work out why it is doing that.

Edit - ah, so once you go into a submenu, e.g. the "Settings" menu, all the menus below that one (e.g. the "Theme settings" sub-sub-menu) have the same %cs number (6, in the case of the settings menu).  Not sure how you deal with that.  Even the 'theme list' returns the same value for %cs.
Title: Re: [320x240] Tile based main menu
Post by: Frankenpod on May 28, 2021, 03:59:17 AM
Gotten it to work up to a point, but the theme engine seems to have a lot of undocumented/inconsistent behaviour.  Can't get the labelled menu viewport thing to work, so can't get the "settings" menu to be centred in the display.
Title: Re: [320x240] Tile based main menu
Post by: Frankenpod on May 28, 2021, 04:11:44 AM
Was trying to get the "settings" menu look more like this, but if I try to do that by creating different labelled %Vi menus with different positions/dimensions, it insists on using the wrong one - or, rather, weirdly, it uses the dimensions of the main one with the content of the sub-menu one, no matter what I do.
Title: Re: [320x240] Tile based main menu
Post by: Frankenpod on May 28, 2021, 02:57:54 PM
Uploaded a first attempt at this.  Only the top-level menu and the 'settings' menu are done with icons.  Ran into problems when I tried to add others (also, not sure what's an 'intuitive' icon to represent something like "perceptual base enhancement" or "auditory fatigue reduction" - might as well just use text)
Title: Re: [320x240] Tile based main menu
Post by: Frankenpod on May 29, 2021, 10:00:50 AM
Really baffled how to get sub-menus to work.

I have a 'plugins menu' for example.  But if you then select an item from it, e.g. 'games', instead of then giving you the textual listing of games to choose, it keeps the plugs icon menu on the screen, and tries to use that to select the games (which doesn't work as there are a lot more than 3 entries in the games list).  How do you tell it to _stop_ using an icon menu once you go to a lower-level menu?

Do you have to use a separate, labelled, "%Vi(label...)" statement for every sub-menu?  Even that doesn't seem to work as expected, as it seems to use the _content_ of the labelled menu, but retains the _dimensions_ of the previous menu (hence menus with fewer icons can't be properly formatted to put the icons centrally, they all end up at the top of the display).  Plus you can't use %cs to work out which menu you are on as the same %cs value is re-used for sub-menus (e.g. every sub-menu to the 'settings' menu returns a %cs value of 6)

Really can't work out the logic of it all.

Partly wonder if the menu-skinning functionality was never quite completed?  Or am i entirely misunderstanding the logic of the WPS scripting?

Anyone have any advice?
Title: Re: [320x240] Tile based main menu
Post by: Frankenpod on May 29, 2021, 09:08:29 PM
OK, made some progress.  Can't figure out what's going on with the %Vi(label...) statement - it seems to ignore the dimensions you give for them and just use those of one of the other menu viewports you've defined (the first or the last, maybe?), but with the contents of the one you want to use.  Also it's a nuisance that %cs doesn't differentiate between top level menus and all the sub-menus, but seems like one can get round that by using %Lt. Unless I'm completely misunderstanding the whole logic of it and am only getting it to work by sheer accident?

Managed to get the icons arranged better by just changing their size by padding them out with black borders.  Maybe there's a better way to do it?

All menus now have icons, except the database, the sound settings and the general settings.  Struggled a bit to invent icons for the likes of 'haas surround sound'.
Really run out of energy for it now.  Might finish the last few menus some other time.  For now it will have to do.  (Also part of the battery meter graphic keeps flashing on-and-off as if something is overwriting it, but I can't figure out what.)
Title: Re: [320x240] Tile based main menu
Post by: Frankenpod on May 30, 2021, 03:35:37 PM
The database menu is done, but I've concluded that so many of the remaining menus have multiple items that are impossible to signify with an intuitive icon (e.g. how do you represent "constrain directory auto change" or "cuesheet support" in icon form?) that I'm leaving the rest as text menus.
Also I'm finding when first switching to the theme it comes out garbled, until you go down and up a menu level, then it seems to sort itself out and functions normally from then on.  Not sure what's going on there.  Must be something to do with the order in which viewports get set.  If anyone can get the theme working more robustly(or has some great ideas for representing complicated technical menu options in icon form), feel free to upload an improved version.
Title: Re: [320x240] Tile based main menu
Post by: millim on May 30, 2021, 03:48:24 PM
very cool progress, ginkgo, Frankenpod  :D

@Frankenpod can you share your code so far? I still have difficulties from where to start. It would be really helpful to have a working theme with all the necessary files to start my customization.

Thank you,
millim

 
Title: Re: [320x240] Tile based main menu
Post by: Frankenpod on May 30, 2021, 06:46:17 PM
Well a recent version is already uploaded to the theme site - you could just download that and work with it.
(I've done a bit more since, but I've currently broken it again while trying to add stuff...will upload another version when that's fixed).

Really finding it hard to make sensible icons for things.  Found myself looking for an icon of someone using a skipping rope, to represent 'prevent track skipping', then decided it's getting silly.
Title: Re: [320x240] Tile based main menu
Post by: Frankenpod on May 30, 2021, 09:47:14 PM
Now have icon menus for the database, playback settings, and general settings menus.  Will upload to the theme site at some point.

@millim - I assume you are aware that the scripts are all in the themes as downloaded, i.e. in the .wps and .sbs and .cfg files?  Mostly, in this case, all the tricky stuff is in the .sbs file.
Title: Re: [320x240] Tile based main menu
Post by: cereal_killer on May 31, 2021, 03:22:28 AM
Really finding it hard to make sensible icons for things.

Rockbox has so many different settings, that I can't imagine anyone has made an icon for them anywhere in other projects. I personally think it's fine to use a general settings icon for the extraordinary ones.

By the way, great work from all of you. This makes the look of Rockbox better.
Title: Re: [320x240] Tile based main menu
Post by: Frankenpod on May 31, 2021, 04:36:48 AM
Database, playback settings, and general settings menus.

Notice slightly desperate attempts at icons to represent the likes of "track" and "pause on headphone unplug".  And that I gave up entirely with a few entries.

Honestly, I'm really not at all sure I've understood the WPS engine syntax correctly, or if I've just got things to work by accident.  In particular I don't understand the order of execution of things and how it relates to the order of declaration - sometimes it seems like WPS scripting is strictly procedural, other times it seems more 'function' based (if that's the right terminology to describe the issue - I'm even confused about that).  Can't figure out the meaning of where statements are placed within a script - sometimes that seems to matter and other times it doesn't.
Title: Re: [320x240] Tile based main menu
Post by: Frankenpod on May 31, 2021, 06:04:47 AM
Interesting that all that effort was made to put all this 'skinning' functionality into the core code, but nobody ever bothered to make use of it.  Maybe it's because the syntax for doing so is so opaque?  Don't think I'd have bothered if ginkgo hadn't figured out the fundamentals of it.
Title: Re: [320x240] Tile based main menu
Post by: gevaerts on May 31, 2021, 06:20:04 AM
Interesting that all that effort was made to put all this 'skinning' functionality into the core code, but nobody ever bothered to make use of it.  Maybe it's because the syntax for doing so is so opaque?  Don't think I'd have bothered if ginkgo hadn't figured out the fundamentals of it.

I suspect it's because it was all near the end of the "active" theme engine work, so some of those glitches never got sorted out, and yes, the syntax is opaque. Many themes may have a lot of work put into graphics and visuals, but there were only ever a handful people who even tried out those fancy features.
Title: Re: [320x240] Tile based main menu
Post by: millim on May 31, 2021, 10:27:13 AM
@gevaerts

well, rockbox has a long history and meanwhile the society is getting used to the "app-tile-based" interfaces, standard on today's IT equipment. Sure, it always depends on the requirements and it's priorities. Still, if the "WHY" cannot be answered, it is better to omit these fancy features rather than getting a syntax being opaque. :)


@ Frankenpod
I have tried it, but getting error on this line:
%Fl(2,12-Roboto-Bold.fnt)

The Roboto font, I cannot find, also the downloaded font package for the classic does not include the font. Also the github repos pointing to Roboto font set are empty? How can I resolve this?

I am using the ipod Classic rockboxui. When I load the theme, I cannot see the tiling (still the common list style), maybe mentioned due to this font issue?

millim 
Title: Re: [320x240] Tile based main menu
Post by: Frankenpod on May 31, 2021, 10:49:13 AM
Hmmm, yes, seems the robotofonts package download is no longer at site linked to from this one.  Didn't realise I used it in the theme (and hadn't included it in the zip).  Puzzling, because usually the syntax-checker complains about missing font problems like that when you upload a theme.  When I get a moment will check if I used it in the theme (and failed to include it in the zip) and if so, add it to the zip and reupload it.

Yea, seems that I switched between bold and regular fonts and didn't change the one in the zip.  Will fix that with next upload.  Still rather puzzled why the syntax-checker didn't notice that issue - got used to relying on it picking up that sort of problem.

In the meantime you could edit the sbs file to look for 12-Roboto-Regular (which is what I included in the zip) instead of 12-Roboto-Bold.  That might fix it.
Title: Re: [320x240] Tile based main menu
Post by: millim on May 31, 2021, 11:32:17 AM
thank you,

I was getting it to work 8) , still had to change:

%Vi(MainMenu,32,20,252,180,1) to %Vi(-,32,20,252,180,1) to get the bitmaps correctly aligned to the backdrop boundaries. Otherwise, its getting ignored and defaults back to (0,0,320,240). Maybe there is a need to have a default viewport? I use the git version of rockbox roughly two weeks back.

BTW which tool can you prefer to draw and collect the icons to one bitmap? Maybe you can advice a tool that is free and runs on Linux.

Thank you very much for your help!
millim
Title: Re: [320x240] Tile based main menu
Post by: Frankenpod on May 31, 2021, 12:55:47 PM
@millim

Thanks for that point about the viewport - it does seem as if putting a default viewport in as well as the labelled ones solves the glitch of it having messed-up views when you first load it (that problem seemed to go away after going into a sub-menu and coming back out again, but with a default viewport in there as well it seems to work correctly from the start).  I really don't fully grasp how the logic of viewports works, I think (really couldn't get the thing to correctly switch between menu viewports with different dimensions), but that seems to solve that problem so I've put it in there for the next upload, along with that missing font.

(Maybe a dev or someone could also look into the roboto font collection no longer being at the link where it used to be available?)

Title: Re: [320x240] Tile based main menu
Post by: Frankenpod on May 31, 2021, 02:43:13 PM
Hmmm, noticed another bug I didn't catch - seems when the text menus are "hand-crafted" you have to explicitly tell them to scroll.  Hence long file names are not fully readable in the file view as it currently stands.  Will fix that for the next "release" (i.e. will have to reupload yet again).

Edit -this should now be fixed with the new version uploaded.  Also added icon/tiles for all the remaining menus (bar the recording one).

Edit 2 - drat, making the entries in the file view scroll seems to create a strange problem whereby the background and text colours become the same so you can't read it.  And furthermore, this only happens on the ipod itself, not in the simulator, so it's  really tricky to test/debug.  (I wonder if it's related to the long-standing bug where scrolling text on the SBS gets the background from the WPS?  I can't see any reason for it in the SBS script itself).
Title: Re: [320x240] Tile based main menu
Post by: millim on June 01, 2021, 11:35:41 AM
... inspired by the Nucleo Theme, I have used on Winamp decades, I am about to develop a skin for the ipod classic (320x240)

Here a very early draft. It holds two L/R VU meters on the bottom still not finished.

At the moment, I do have issues to understand how to put the picture flow and some games into the tiling main menu? Hopefully somebody can help me further.

millim
Title: Re: [320x240] Tile based main menu
Post by: Frankenpod on June 01, 2021, 02:54:47 PM
Looks promising (nice tasteful colour scheme).  Are you saying you want to have the picture flow plug-in moved up from the 'demos' plug in sub-menu to a higher-level menu?  Not sure if that's possible within the scope of the theme engine.  Or is your plan to make the games and demos menus tiled?  I guess that would work the same way as the other menus.

One potential problem that's just occurred to me is that any change to the core code that adds or removes entries from the menus will confuse themes that use icons (causing entries to get the wrong icons).  That already seems to be the case with one menu entry that isn't in the rockbox version used in the simulator but is in the later dev releases ("set wps context plug-in" on the general settings menu).  If you iconify the plug-in sub-menus that would get even worse, if any plug-ins are added or removed.
Title: Re: [320x240] Tile based main menu
Post by: millim on June 01, 2021, 03:16:26 PM
I just want to tile the main menu, all other menus shall be common text lists (no tiling).
Right, I want to move some plugins to highest level (main menu) for faster access. It will not be much, the picture flow, some games and emulators.

I can imagine that the text list entries must be well aligned with the icon (tile) list. I think there is no tag that overcomes this issue, and it will break the general usage.

millim   
Title: Re: [320x240] Tile based main menu
Post by: Frankenpod on June 02, 2021, 06:44:22 AM
I hope you can get it to work - more "tiled" themes would be good.
But I don't know how you'd move those plug-ins up the menu tree - seems like that would need changes to the underlying code base, not something that could be done via the existing theme engine.
Title: Re: [320x240] Tile based main menu
Post by: millim on June 02, 2021, 11:28:23 AM
Hi,

thank you for the greetings! :D

Meanwhile the baseline is done - I will call the Theme "iRetro". Still a lot to learn for me. There are so many details to learn how to use the skin engine. It is really a massive tool with a lot of features I need to understand. Hopefully you can help me again when I am stuck in the details I cannot sort out myself.

millim
Title: Re: [320x240] Tile based main menu
Post by: dconrad on June 03, 2021, 10:11:58 AM
... inspired by the Nucleo Theme, I have used on Winamp decades, I am about to develop a skin for the ipod classic (320x240)

Here a very early draft. It holds two L/R VU meters on the bottom still not finished.

At the moment, I do have issues to understand how to put the picture flow and some games into the tiling main menu? Hopefully somebody can help me further.

millim

I don't have much to add but that wps looks way cool   8)
Hopefully I can try it out sometime on my Eros Q, I believe it has the same resolution.
Title: Re: [320x240] Tile based main menu
Post by: millim on June 05, 2021, 04:43:15 AM
@ dconrad

thank you, hopefully I will make it to the finish line..

@Frankenpod

I think, I need your help again. The SPS looks ok now (see attached). Now I am working on the WPS. The layout and backdrop is basically done. Working on the details now..

Actually I have a problem with multicolor fonts. I want to match exactly the track time, sampling rate and some other text style exactly to the backdrop embedded text, which is multicolor. Maybe there are two ways?

1.) I have checked the convttf.c, there is a depth of 4bit specified, that could hold multicolor? I don't know.
2.) simply draw every single character that is taken from a bitmap list. So bit mapped numbers/characters shown as bit mapped icons.

Do you know how this works in rockbox? 

millim
Title: Re: [320x240] Tile based main menu
Post by: amachronic on June 05, 2021, 06:42:02 AM
1.) I have checked the convttf.c, there is a depth of 4bit specified, that could hold multicolor? I don't know.

Actually that is only an alpha channel to make TTF fonts blend properly, it appears the fonts are always monochrome.

2.) simply draw every single character that is taken from a bitmap list. So bit mapped numbers/characters shown as bit mapped icons.

I suppose you may already know this, but you can set the font color per-viewport so if all you need is to render each bit of text in a single color, it is already doable, you just need to create lots of little viewports.

If you genuinely need varying colors within the text itself it's possible you might be able to render a fixed-width string using bitmaps with %ss tag (https://download.rockbox.org/daily/manual/rockbox-ipod6g/rockbox-buildap4.html#x20-462000D.28) to pull out characters one at a time. Using it roughly like this, using %fb for sample rate as an example:
Code: [Select]
%xd(your_bitmap,%ss(0, 1, %fb))
%xd(your_bitmap,%ss(1, 1, %fb))
... etc...
Problems are (a) you'd have to repeat this as many times as desired and align everything manually, (b) I'm not sure this would work at all, and (c) even if it does, if the string happened to be shorter than the number of characters you decided to render, I am not sure what would happen, it depends on how %ss handles this case. Oh, and your bitmaps would need to be padded to match ASCII encoding, and Unicode is pretty much out of the question.

Sorry I can't give any good solutions. Your theme does look pretty cool by the way, awesome work! :D
Title: Re: [320x240] Tile based main menu
Post by: Frankenpod on June 05, 2021, 02:54:54 PM
Hmmm, noticed another bug I didn't catch - seems when the text menus are "hand-crafted" you have to explicitly tell them to scroll.  Hence long file names are not fully readable in the file view as it currently stands.  Will fix that for the next "release" (i.e. will have to reupload yet again).

Edit -this should now be fixed with the new version uploaded.  Also added icon/tiles for all the remaining menus (bar the recording one).

Edit 2 - drat, making the entries in the file view scroll seems to create a strange problem whereby the background and text colours become the same so you can't read it.  And furthermore, this only happens on the ipod itself, not in the simulator, so it's  really tricky to test/debug.  (I wonder if it's related to the long-standing bug where scrolling text on the SBS gets the background from the WPS?  I can't see any reason for it in the SBS script itself).

Quoting myself rather than editing, to make this a bit more obvious.  I really can't figure out what is going on with this.  If I make the text menu (e.g for listing files) scroll, using %s (so the line is %s%LT), the text and background colours just go all weird.  Either the text comes out the same colour as the background (so the lines are blank) or they do something really weird like "smear" across the line instead of scrolling.  And, furthermore, the behaviour is different in the simulator and on the actual device (with the latest dev version).  Seems to be no way I can find to make the purely-text menus scroll properly. So I've given up and left those menus non-scrolling.
Title: Re: [320x240] Tile based main menu
Post by: millim on June 06, 2021, 10:00:29 AM
@amachronic

thank you for you comprehensive explanation. Sounds a bit too complicated, need to find other ways how to accomplish that. Maybe you can consider this in a new release, would be really helpful to draw raw bitmaps fonts.

@Frankenpod
well, hopefully this does not hit me on the main menu scrolling, at the moment it is ok, but when putting the code changes on top with more apps on the main window, will run in the same problem. I think this is also one topic the development team can look into.

I still struggle with much more basic things...

Maybe I do not catch the concept of SBS and WPS. My understanding is that SBS is for the menus and WPS for the playback screen, totally isolated, but it doesn't? I want to display text on the menu screen but it should not be there on the playback screen. This sipped of code I have in the SBS file, I does not show the effect:

Code: [Select]
%?if(%cs, =, 1)<%Vd(text)>
%Vl(text, 100,210,150,16,3)%s%acABCDEFGHIJKLM1234567890 

When I now load a song, the WPS background is shown, but with the 100,210,150,16 region from the SBS section. What do I wrong. A screenshot is attached.

The WPS is short (for testing)

Code: [Select]
%we

# Load Backdrop
%X(BackgndWPS_16.bmp)

%V(0,0,320,240,-)

%?mp<%Vd(p)|%?C<%Vd(z)%Vd(a)|%Vd(z)%Vd(n)>|%Vd(p)|%?C<%Vd(z)%Vd(a)|%Vd(z)%Vd(n)>|%?C<%Vd(z)%Vd(a)|%Vd(n)%Vd(z)>>

# pb moved to sbs

%Vl(p,35,18,250,20,1)%Vf(ffffff)%Vb(000000)
%s%ac%?it<%it|%fn>
%Vl(z,35,22,250,20,1)%Vf(ffffff)%Vb(000000)
%s%ac%?it<%it|%fn>
%Vl(z,35,45,250,20,1)%Vf(ffffff)%Vb(000000)
%s%ac%ia
%Vl(z,35,68,250,20,1)%Vf(ffffff)%Vb(000000)
%s%ac%id 

p.s. The font topic is really taken me a lot of time. You cannot imagine how difficult it is to find and get a proper 3x7 (4x8) font to work on Linux and Windows. Actually, I do the background graphics on Windows MS Paint (btw a very good tool for bitmap manipulation), the rest with bash scripting and inkscape on Linux. The font needs to be ttf and fnt for closing the loop, but still not there...

millim 
Title: Re: [320x240] Tile based main menu
Post by: amachronic on June 06, 2021, 12:18:06 PM
@millim am I right to think you just need a basic font like the brown "ABCEDF..." in your screenshot? It looks like simple foreground/background colors would serve your needs if you had a font... the problem is getting some ready-made font you can convert to the Rockbox format.

I think .bdf bitmapped fonts are what you need -- those can be converted to the Rockbox font format using convbdf. Some googling suggests FontForge can work with basic bitmap fonts, see this (https://fontforge.org/docs/tutorial/editexample8.html#editing-bitmaps). If you're already drawing fonts by hand in paint then it seems not much different in fontforge, except it can probably save to a "proper" .bdf file you can convert to Rockbox's format. It seems there might be other .bdf font editors if you go looking, if FontForge is not your thing.

Quote
My understanding is that SBS is for the menus and WPS for the playback screen, totally isolated, but it doesn't?
Try putting %wd (disable status bar) in your WPS file instead of %we. When you use an SBS file in your theme I am pretty sure %we will make Rockbox draw the SBS over top of the WPS.
Title: Re: [320x240] Tile based main menu
Post by: cereal_killer on June 06, 2021, 05:01:38 PM
The Roboto font, I cannot find, also the downloaded font package for the classic does not include the font. Also the github repos pointing to Roboto font set are empty? How can I resolve this?

I found the anti aliased font pack and the roboto font pack from [Saint] and could upload them to a free file hoster, if there are no legal objections.
Title: Re: [320x240] Tile based main menu
Post by: millim on June 07, 2021, 09:54:32 AM
@amachronic

yes, putting %wd solved the issue, thank you for that! I was also able to find a solution for the thin track information font mentioned recently. Half way done, I think, I have reached the point of no return  :).
Title: Re: [320x240] Tile based main menu
Post by: Frankenpod on June 10, 2021, 10:49:59 PM
@millim

Great work.  I like the tasteful subdued icons.

Seems as if it might be impossible to do the whole thing with icons all the way down, because of this weird scrolling-related issue that seems to crop up with the text lists (of filenames, themes etc) if you use icons for any menu below the top level one.  Maybe I'm misunderstanding something but I can't find a way to make it work.
Title: Re: [320x240] Tile based main menu
Post by: Frankenpod on June 12, 2021, 06:57:42 PM
@millim

Hey, I found a glitch with the theme - but to be honest, it's the exact same glitch I've been having with my own icon-using themes.  If you go into the files menu, and there are long file names that need to scroll, it causes a problem when you come back out again - see the screenshots.

Either there's something we both get wrong about the logic of viewports, or there's a bug to do with scrolling text that only comes up when one does things with custom %vi statements to use icons.  The fact that there's already a bug with scrolling text, relating to the backgrounds of the SBS and WPS, makes me think it's the latter.

Title: Re: [320x240] Tile based main menu
Post by: Frankenpod on June 13, 2021, 04:32:23 AM
I do suspect there's a bug in rockbox with how scrolling is implemented.  As well as this, I get other strange things happening with scrolling lines if I define a text-based %vi viewport.  And at least at one point there was a known existing bug where scrolling text on the WPS gets the background from the SBS.
Title: Re: [320x240] Tile based main menu
Post by: millim on June 13, 2021, 04:07:48 PM
Hello Frankenpod,

oh, I was not aware of this either. But, ginkgo should have run into the same issue? He did not mention this. Maybe there is a missing link how to manage this? I think %Vi( ) uses the display buffers in a different way. After booting the ipod, the SBS backdrop gets loaded nicely, when the interpreter gets to the point %Vi(-,32,20,256,192,1), this portion of the screen defaults back to the rockbox bootscreen for 1 second, then the tiles get visible. This might connect the the scrolling? Maybe the line gets registered somewhere to scroll, when going back to the tile screen, it does not get automatically de-registered or obsolete to update, respectively.   

Maybe ginkgo or the development team can comment on this?

millim
Title: Re: [320x240] Tile based main menu
Post by: millim on June 14, 2021, 11:36:58 AM
Some update...

I was checking a bit the code and I think it is indeed a bug in rockbox. Maybe it is connected to the fact that the skinlist concept is not completed, it still needs the classical skin list engine:

in list.c
Code: [Select]
    FOR_NB_SCREENS(i)
    {
#ifdef HAVE_LCD_BITMAP
        if (!skinlist_draw(&screens[i], gui_list))
#endif
        list_draw(&screens[i], gui_list);
    }

it looks that the gui_list structure is not correctly liked when stepping out from the list_draw to the skinlist_draw viewports, by pressing MENU actually when a list item is highlighted and scrolling so:

Code: [Select]
struct viewport *parent = (list->parent[screen]);
display->scroll_stop_viewport(parent);

has no effect.

millim

Title: Re: [320x240] Tile based main menu
Post by: millim on June 15, 2021, 05:06:27 AM
Some update...

found a simple fix. Unfortunately, need to modify the code. You may test if this also works for you. In list-skinned.c: need to add:

Code: [Select]
    if (listcfg[screen]->tile == true)
      display->scroll_stop();

Showing the skinlist_draw() function and how to add the fix:

Code: [Select]
bool skinlist_draw(struct screen *display, struct gui_synclist *list)
{
    int cur_line, display_lines;
    const int screen = display->screen_type;
    struct viewport *parent = (list->parent[screen]);
    char* label = NULL;
    const int list_start_item = list->start_item[screen];
    struct gui_wps wps;
    if (!skinlist_is_configured(screen, list))
        return false;

    current_list = list;
    wps.display = display;
    wps.data = listcfg[screen]->data;
    display_lines = skinlist_get_line_count(screen, list);
    label = (char *)SKINOFFSETTOPTR(get_skin_buffer(wps.data), listcfg[screen]->label);
    display->set_viewport(parent);
    display->clear_viewport();

    // fix the scrolling glitch
    if (listcfg[screen]->tile == true)
      display->scroll_stop();

millim
 
Title: Re: [320x240] Tile based main menu
Post by: Bilgus on June 16, 2021, 08:38:39 AM
I think last time I ran into this bug the order of displaying viewports made a difference but this was like 2016
Title: Re: [320x240] Tile based main menu
Post by: Bilgus on June 16, 2021, 08:43:01 AM
BTW @millim nice sleuthing :)

if you remove the if statement and make it
unconditionally call scroll_stop does it
work properly for you?
Title: Re: [320x240] Tile based main menu
Post by: millim on June 16, 2021, 04:50:09 PM
.. well had to investigate a bit how things play together  :). Yes, making it un-conditional works also for me. Do you plan to add this fix for the next release?

BTW, I have also added pictureflow to the main menu. It was already partially there, only three lines of code are necessary to make it work. Would also be nice if you can consider this extension.

I have attached the code with these modifications.

millim

Title: Re: [320x240] Tile based main menu
Post by: Frankenpod on June 16, 2021, 06:15:56 PM
@millim

Sounds as if you have honed-in on the problem.  Dealing with the Rockbox code itself is, as the phrase has it "above my pay-grade", so I'd rather leave it to any devs who care to take an interest to sort out.  I wonder to what extent it's the same problem I've found with custom %vi statements that aren't tile-based?  Difficult to provide a screenshot as they don't seem to happen the same way in the simulator as on the ipod.  Either the text and background come out the same colour (regardless of what colours you tell it to use) for selected lines that are long enough to trigger scrolling, or, even more weirdly, the scrolling fails to work correctly and the text instead of scrolling just sort of smears itself like wet ink being smudged across a page.
Title: Re: [320x240] Tile based main menu
Post by: dconrad on July 15, 2021, 09:36:01 PM
I finally got a chance to try this theme, it's looking great! I love the vu meters on the wps  ;D

This might have been covered in the thread already (I confess not to have read it all), but is there any chance the main menu icons could support reordering and arbitrary hiding/showing? (this is done in the main menu config plugin). That's probably a fairly hard problem but figured I would ask.

I have the Recent Bookmarks enabled, my device doesn't have recording, and I've reordered the menu a bit (put "Now Playing" at the top), so half of the icons no longer match.