Rockbox Technical Forums

Support and General Use => Theming and Appearance Customization => Topic started by: Yotto on September 13, 2007, 09:31:30 PM

Title: iText new WPS (WAS: Same hardware, different volume limits?)
Post by: Yotto on September 13, 2007, 09:31:30 PM
First, to show off my new WPS-in-progress, iText.  It's inspired by (and would be impossible had the research not been done by) Bascule and his all-text themes.

First, a screen shot of the theme working:
(http://planetretcon.com/temp/iText_Good.png)
I think it looks pretty good.  I had some issue getting the "border" lines to stay still while the volume dB level changed string length, but I finally got it working due to some code that I'm both proud and ashamed of.  Note, in the next screen shot, that the length of both the volume dB and the battery percent are different than in the first screen shot, but the rest of the WPS stays in line:
(http://planetretcon.com/temp/iText_Good_2.png)
So, that's not my problem.  My problem is, in the simulator, the limit of volume is -40dB, but on my actual 5G (not 5.5G) iPod Video, the limit of volume is -58dB.  The way I am adjusting the lines to fit the spaces in is dependent on how many steps there are, so with the current iteration of the code (which works perfectly on my actual iPod, that goes to -58dB) looks like this for a couple volume clicks:
(http://planetretcon.com/temp/iText_Bad.png)
Here's the "proof" that the simulator goes to -40dB and stops:
(http://planetretcon.com/temp/iText_Limit.png)

So, after all this, here's my question: Is the simulator just wonky, and all iPods go to -58dB, so I can release my code so long as it looks good on my iPod?  Or is there something that could cause two different iPods to have two different "floors" of range?  I am hoping it's just the simulator, because I can't think of another way to do what I want to do without changing the layout of the WPS, and I like the layout of the WPS.
Title: Re: Same hardware, different volume limits?
Post by: Llorean on September 14, 2007, 01:50:04 AM
All iPod Videos should go to -58. Other models of iPod (4G, Nano, etc) have different hardware and may have a different floor (or rather, do) but all Videos should be fine, so you should be okay I believe.
Title: Re: Same hardware, different volume limits?
Post by: bascule on September 14, 2007, 04:02:46 AM
Cool...

...and thanks for the mention :)

EDIT: I'm a bit confused as to what your actual problem is. Is it purely with the numeric 'dB' indicator , not the volume bar length?

If so, I don't see how a different 'floor' value has any bearing on that, as the only adjustment you need to make is for the different number of characters from 1 (0-6dB) to 3 (-10dB and below)

You could post a code snippet and I'll have a look...

I'm also puzzled as to why the volume bar changes length, which IMHO looks odd, but as you seem happy with that, I'll let it lie.
Title: Re: Same hardware, different volume limits?
Post by: Yotto on September 14, 2007, 05:35:02 AM
The volume bar changing length is a joke, actually, because volume goes to "11" and breaks the bounds of the gray background. The problem I'm having (or not, if iPod Videos are always -58 to +6 dB) is with the reported dB only.

Below is the code for that line. I'm not pretending it's pretty and I'm not pretending it's the most efficient way to do it. I expanded %?pv<> out 60 times. 49 of these evaluate empty (for -58 to -10), 9 of them evaluate as a single space (To pad -9 to -1), and the final 2 evaluate as two spaces (To pad 0 to 6).

It doesn't seem that I could cut down the number of options within the <> brackets, but I didn't try.

Here's the entire line, all that matters is after %ar though.
Code: [Select]
%?mh<☼|•>─┼─Hold   │%ac%?fv%ar│   %?pv<||||||||||||||||||||||||||||||||||||||||||||||||| | | | | | | | | |  |  >%pv dB    
Title: Re: Same hardware, different volume limits?
Post by: bascule on September 14, 2007, 09:52:08 AM
The volume bar changing length is a joke, actually, because volume goes to "11" and breaks the bounds of the gray background.

I had a suspicion that was the case  ;D  Spinal Tap (http://en.wikipedia.org/wiki/This_Is_Spinal_Tap) strikes again!

Below is the code for that line. I'm not pretending it's pretty and I'm not pretending it's the most efficient way to do it. I expanded %?pv<> out 60 times. 49 of these evaluate empty (for -58 to -10), 9 of them evaluate as a single space (To pad -9 to -1), and the final 2 evaluate as two spaces (To pad 0 to 6).

OK, I see the problem now...

Obviously it works as you want it on target, but it certainly ain't pretty or easily portable to other targets.

As the CBR/VBR text length is fixed, you could just keep the code for that (%?fv) and the right-hand border graphic in the left-aligned section padded with spaces into the centre:

Code: [Select]
%?mh<☼|•>─┼─Hold   │    %?fv   |%ar%pv dB
Title: Re: Same hardware, different volume limits?
Post by: Yotto on September 14, 2007, 02:25:24 PM
The problem with that is, CBR and VBR are both 3 letters long, an to have the border lines match up with the above and below lines, they need to be an even number of letters long. I actually had CBRt and VBRt for a while but it bugged me, because the acronyms aren't CBRt and VBRt.  I could use "CBR " or " CBR" but then it doesn't match up with "MP3" above it, and I can't have " MP3" because then what happens when someone uses "FLAC"?  Plus, the space is small enough that you (Or at least I) notice it that it's off center.

And, in case you are thinking to suggest it, I've also nixed the idea of changing the borders so they better fit a 3-character string in the middle. The lines, right now, are exactly centered and 102 pixels of white separate them, and it looks really nice when I slip a 100x100 piece of album art over the stuff in the middle.
Title: Re: Same hardware, different volume limits?
Post by: bascule on September 15, 2007, 02:35:17 AM
Such are the trials of ASCII art...  :(

My only other suggestion (if you want it) is to have the whole central section (including borders) centralised:

Code: [Select]
%?mh<☼|•>─┼─Hold   %ac│    %?fv< VBR|CBR>   |%ar%pv dB

But I'm thinking that may still create some other problems.
Title: Re: Same hardware, different volume limits?
Post by: Yotto on September 20, 2007, 12:54:26 AM
Okay, I'm calling this guy done. I made some minor display changes in the left hand pane (Which looked ugly in my opinion with that vertical line, and with "Repeat" in the middle instead of on top).

I can't seem to get the Wiki to work from my computer here at work, so I'll try again when I get home.  In the meantime, if anybody wants it, the zipfile is at http://planetretcon.com/temp/iText.zip

If you uncomment the last two lines of the wps file, it's 100x100 album-art ready, and if you are using it with album art and want to see the text in the middle, switching "hold" on will hide the art.

Comments/suggestions/criticism/praise welcome.
Title: Re: iText new WPS (WAS: Same hardware, different volume limits?)
Post by: Chronon on September 20, 2007, 05:11:05 AM
I like it.  It sounds like it might be difficult to adapt to a different screen size.  I was thinking that something similar would work well for an H120.
Title: Re: iText new WPS (WAS: Same hardware, different volume limits?)
Post by: psycho_maniac on September 20, 2007, 05:25:20 AM
i like this theme. i havnt seen a text only theme in a long tine. since i had my h120. I like this theme mostly because its all text and i can change the colors. I spent like 5 mins changing the colors. so many color schemes for this its awesome. also, thank you so much for making it with the option of having album art.
Title: Re: iText new WPS (WAS: Same hardware, different volume limits?)
Post by: Yotto on September 20, 2007, 06:28:12 AM
Thanks for the kind words.  Though, to be honest, for me it was more of an option to not have album art :)

It has always bugged me that there are album art WPS's, and non-album-art WPS's, but no WPS's that handle both having and not having album art with grace.  I'm not saying this WPS does it with grace, but it at least does it.  I don't have album art for all my music, but I do for a lot of it.  When it's there I want it to show, and when it's not I don't want a gaping hole in 1/8th of my screen.

As far as different screen sizes, it all depends on the font, and the number of steps for volume (The start of this thread).  I use ter-u16b.fnt and I see that ter-u12n font is the smallest in that family.  I changed to that font and it does have all the correct ascii-art things.  Assuming that gets you 15 rows and 40 columns (Not likely, but if you're close you can fiddle) all you need is to delete or add to the long line of | | | | | for the dB line, and move the progress bar to the correct spot (and resize it a bit).

If you're really interested, I'll happily help you do the fiddling  I've considered making it for several models but haven't bothered installing any simulators except the one for my iPod.
Title: Re: iText new WPS (WAS: Same hardware, different volume limits?)
Post by: Chronon on September 20, 2007, 01:12:31 PM
Okay.  I'll have a play with it and see how it goes.  I like the fact that it's all WPS (or .cfg) code. . . no images to rescale.