hankhank10 / music-screen-api

Display the playing Sonos track in real time on an e-ink display - also includes functionality for last.fm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Title track name text is over written by artist/album text when the track name is too long for a single line

ashenshugarRET opened this issue · comments

Love this app, however, I've noticed that when the music I'm listening to has a very long title the artist/album text overwrites the second line of the title
Capture_Title_Too_Long

I can adapt the display_controller.py file to reduce the thumbnail size by updating lines 12-16 in the standard file to the following:
SCREEN_W = 720
SCREEN_H = 720
THUMB_W = 580
THUMB_H = 580

and to shrink the text by using by updating lines 73-77:
if show_artist_and_album:
track_font = tkFont.Font(family="Helvetica", size=25)
else:
track_font = tkFont.Font(family="Helvetica", size=30)
detail_font = tkFont.Font(family="Helvetica", size=15)

My question is can the code be updated to respond to the length of the track name being displayed and use these updated settings only if the track name is going to be displayed on two lines?

@jjlawren As you wrote the original code, can you help?

I've managed to implement this in pull request #57
Capture_Title_Too_Long_Fixed

Here is a better display of the improved handling of track title, album and artist text lengths.
sonos-music-api Examples of Display Modes

as you already had a look at the source...

i just opened an issue regarding the idea that it would be better to habe the text overlay the image instead of scaling the image. that would avoid flickering and also the image would habe to be scaled only once.

this in combination with your changes would be great.

maybe you already have seen how this could be implemented?

as you already had a look at the source...

i just opened an issue regarding the idea that it would be better to habe the text overlay the image instead of scaling the image. that would avoid flickering and also the image would habe to be scaled only once.

this in combination with your changes would be great.

maybe you already have seen how this could be implemented?

Hello,

Yes, I saw this suggestion, I'm not sure I have the skill to implement it though, as my solution only required minor modification of @jjlawren code. I'll have a try as I like a challenge.

@justme-1968 is this the effect you are looking for?
Capture_Overlay_Text

yes! exactly

OK, great. I'm going to close my current pull requests and create a single one with the improvement to text handling and BBC Sounds service in a single request.

This is fixed in pull request #58

great! thank you.