FS#5551 - Adapt vu_meter to fullscreen on all targets

Attached to Project: Rockbox
Opened by Robert Keevil (obo) - Thursday, 15 June 2006, 18:20 GMT
Task Type Patches
Category Plugins
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


WIP on making the vu_meter plugin fullscreen on all targets.
Only adjusted the analog meter so far.

Need to tweak the y_values for all the new targets (nearly there...)
Digital meter

I'll clean up and post the C programme I wrote to calculate the analog_db_scale and y_values for each screen resolution.
(application/octet-stream)    vu.patch (10.9 KiB)
This task depends upon

Closed by  Jonas Häggqvist (rasher)
Wednesday, 12 July 2006, 20:09 GMT
Reason for closing:  Accepted
Additional comments about closing:  Committed.
Comment by Zakk Roberts (midkay) - Friday, 16 June 2006, 03:41 GMT
This is something I've been meaning to do, but hadn't gotten around to it yet.

Since you've already got a program to generate the tables and scale (in C, no less) - why not simply generate the tables at the start of the plugin? That allows the plugin to run on any screen size and be automatically scaled, preventing more work for future models and lots of #if/#elses.
Comment by Robert Keevil (obo) - Friday, 16 June 2006, 18:16 GMT
I was originally planning on calculating in the plugin - the problem is I'm using log10 (although any log function will do, it can always be converted) and sqrt - I spent awhile trying to get some fixed-point log implementations to work, but I couldn't get any meaningful output from them. No idea what I was doing wrong, but I've got them here if you want a look.
Anyway, attached is the quick and dirty bit of code for doing the calculations, plus the plugin with updated values.

I've got no idea what to do with the digital meter, there is a lot of screen real estate to fill...
Comment by Zakk Roberts (midkay) - Friday, 16 June 2006, 22:44 GMT
Ah.. maybe somehow a method could be formulated for this, using e.g. a sine function (which I already use in my clock plugin, and the same function can be found in a number of places).

As for the digital meter, simply larger bitmaps are probably best for now - which I'd be happy to do.
Comment by Robert Keevil (obo) - Saturday, 17 June 2006, 20:30 GMT
Version using fixed-point log and sqrt.
The analog_db_scale is off a bit - it really needs log10 instead of log.

Midkay, if you could do the bitmaps that would be great - I'm not really any good at making things look nice :)
(application/octet-stream)    vu.patch (10.1 KiB)
Comment by Robert Keevil (obo) - Sunday, 18 June 2006, 23:14 GMT
Fixed the analog_db_scale - analog side is (I think) as it should be now.
(application/octet-stream)    vu.patch (10.1 KiB)
Comment by Robert Keevil (obo) - Monday, 10 July 2006, 22:22 GMT
Now also fullscreen the digital scale - uses lcd_fillrect instead of handmade rounded rectangles.
Comment by Robert Keevil (obo) - Tuesday, 11 July 2006, 18:45 GMT
Parentheses police.