Bug 1761 - sliderBar function does not allow for changes in bar graphic size
: sliderBar function does not allow for changes in bar graphic size
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Player UI
: 6.1.0
: All All
: P2 minor (vote)
: Future
Assigned To: Blackketter Dean
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-07-05 07:18 UTC by James Craig
Modified: 2008-12-15 13:06 UTC (History)
2 users (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James Craig 2005-07-05 07:18:50 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?
Comment 1 KDF 2005-07-05 11:40:24 UTC
the sliderBar function has a width parameter, intended for just such a use. the
plugin could check font size and adjust the width sent.
Comment 2 KDF 2005-07-05 13:03:46 UTC
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.
Comment 3 Blackketter Dean 2005-07-05 15:29:55 UTC
Punting this post-6.1 unless it's a significant issue for that release.
Comment 4 James Craig 2005-07-06 01:31:41 UTC
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)
Comment 5 Michael Herger 2005-07-06 01:48:42 UTC
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.
Comment 6 KDF 2005-07-06 02:00:23 UTC
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  
Comment 7 Blackketter Dean 2005-08-20 08:22:07 UTC
Why not just fix the font?
Comment 8 James Craig 2005-08-22 01:01:30 UTC
I did suggest that originally. 
Of course it would make the slider bar less rounded!
Comment 9 Blackketter Dean 2007-10-22 16:58:09 UTC
I don't think that this is an issue anymore.  Reopen if it is.
Comment 10 James Richardson 2008-12-15 13:06:49 UTC
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.