FS#5167 - Graphical Menu (proof of concept)

Attached to Project: Rockbox
Opened by Marcel van Eck (maeck) - Tuesday, 18 April 2006, 00:59 GMT
Last edited by Jonathan Gordon (jdgordon) - Tuesday, 31 July 2007, 07:07 GMT
Task Type Patches
Category Plugins
Status Closed
Assigned To No-one
Operating System iPod 5G
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


Gfxmenu rockbox plugin

This plugin is a proof of concept for a graphical menu,
it does about nothing except for showing a number of
icons in a nice 3d circle. Sliding around on the Ipod
scrollwheel will move the icons around. If you stop
scrolling the icons will refocus on the one icon closest
to the center. This is the icon you would 'select' if the
select key is clicked.

For the devices without a scrollwheel, the left and right
button lets you scroll through the menu. This is just not
as elegant as the scrollwheel (however it is very effective).

'Menu' takes you back to the menu.

things to do:
- Do something when 'select' is clicked.
- Insert this code into the existing menu drawing code so
the graphical menu is shown for Ipod videos on the
playlist/plugins menu.
- Scaling of the icons is done outside of Rockbox, just 10
variations of each icon have been provided to the plugin.
This is not the most memory effective way, However it is
the fastest solution (and I get away with not writing
code for real-time scaling...)
- Create paths and icons for Nano, Photo and greyscale Ipods.
Paths can be created using the code.
This task depends upon

Closed by  Jonathan Gordon (jdgordon)
Tuesday, 31 July 2007, 07:07 GMT
Reason for closing:  Out of Date
Comment by Max Ried (bot47) - Tuesday, 18 April 2006, 16:22 GMT
OK, I created paths for the nano.
I got some questions:

1st) Why do you use 24bit depth? The displays of iPods have just 16bit.
2nd) I was blind and didn't find the line where you display the item name. It has to be adjusted for the nano.
3rd) Isn't it fast enough to calculate the values at runtime or maybe there is a way to make the precompiler calculate them for us... I added precalculated values for the nano, because you did so, too.

Good work. (309.3 KiB)
Comment by Marcel van Eck (maeck) - Tuesday, 18 April 2006, 17:01 GMT
1. The 24bit depth images will be converted to 16 bit rockbox images at compile time and statically linked to the plugin.
2. The text placement is a bit weird. Need to select a font and place it correctly and restore is after closing the plugin.
3. I precalculated the paths for various reasons.
a. It is faster. I am not using any floats and complex math in the plugin. I could have precalculated the cos/sin values but that would have also left me with two tables of data.
b. Currently it is an oval, there is no reason to make the path flow differently if desired (for instance when we make these menus themable).

Thanks for converting for Nano.
Comment by Max Ried (bot47) - Tuesday, 18 April 2006, 20:28 GMT
This is a more general version which _SHOULD_ run on most targets, because it doesn't use precalculated values. Its main problem is that for some reason it seems to work only on iPod Simulators, not on others. The Sim always crashes or displays weired color mixes.
   gfxmenu.c (19.6 KiB)
Comment by Yorick Terweijden (twisted) - Tuesday, 18 April 2006, 20:38 GMT
I'll try to do some gfx's as we already discussed
Comment by Marcel van Eck (maeck) - Tuesday, 18 April 2006, 21:27 GMT
Bot47 very good change. I really appreciate the work you have done on it.
I'll include the changes in the current patch I am working on (releasing this proof of concept on the main menu).
Comment by Marcel van Eck (maeck) - Thursday, 20 April 2006, 02:07 GMT
Cleaned out the source a bit and changed the focus square be placed correctly (use the calculated path to figure out what the focal point on the path is).
   gfxmenu.c (19.6 KiB)
Comment by Max Ried (bot47) - Friday, 21 April 2006, 08:22 GMT
Unfortunately, it doesn't build for my if inserted into current CVS. It compiles, but linking fails.
Comment by Marcel van Eck (maeck) - Tuesday, 02 May 2006, 00:56 GMT
Repackaged the patch. This should link correctly.
The patch is more than just the gfxmenu,c file,
bitmaps and sources files are also changed.

This patch also includes new images (icons).
Comment by Jonathan Singh (Jon_) - Monday, 22 May 2006, 18:32 GMT
can someone patch me a copy for 5g ipod