Bugzilla – Bug 1761
sliderBar function does not allow for changes in bar graphic size
Last modified: 2008-12-15 13:06:49 UTC
The sliderBar function for Squeezebox[G|2] assumes that progress bar graphics are only 1 pixel wide. However those in the 'full' font are 2 pixels wide so a progress bar constructed with this font ends up twice as large as it should be. This causes a problem in the Music Info Screensaver. I guess you could either shrink the font or check the text width in the function?
the sliderBar function has a width parameter, intended for just such a use. the plugin could check font size and adjust the width sent.
and it seems that this is already done in the current version of the plugin. This is probably the better location for such a calculation since the caller is already aware of what line and what font is being used for the sliderBar, whereas the sliderBar function has no access to this. I expect that providing the needed info woudl be no simpler than the line of code already there to calculate width.
Punting this post-6.1 unless it's a significant issue for that release.
Therefore the code should be added in nowPlayingModeLines to adapt the width of the progress bar relative to the text size. Calling the nowPlayingModeLines function you can't choose a width so you have to fake the size of the other element to get the progress bar at a reasonable size. (nasty). Even if you could you would need to work out what elements are being added to the progress bar (eg time remaining) in order to work out what width it should be, and then you're duplicating the work that's done in nowPlayingModeLines! (also note that the code that's in the plugin crashes on Squeezebox2/Full font because measureText(' ',1) returns 0)
There's another problem with $client->measureText(' ', 1): it's returning 0 for SB2 when in full size mode, but SliMP3 returns 1. This should be consistent. But as Dean said: maybe not major enough to be considered for 6.1.
fixing measureText makes sense. altering sliderBar to add several params just for one case doesn't. as for nowPlayingModeLines, I'm sure its flexible enough to work with. Plugins are always going to suffer some need for redundancy (I've been there). the inconsistency will need to be sorted, but certainly post 6.1
Why not just fix the font?
I did suggest that originally. Of course it would make the slider bar less rounded!
I don't think that this is an issue anymore. Reopen if it is.
This bug appears to have been fixed in the latest release! If you are still experiencing this problem, feel free to reopen the bug with your new comments and we'll have another look. Make sure to include the version number of the software you are seeing the error with.