1515from adafruit_ble_apple_media import AppleMediaService
1616from adafruit_circuitplayground import cp
1717
18- BACKGROUND_COLOR = 0x444444 # Gray
18+ BACKGROUND_COLOR = 0x49523b # Gray
1919TEXT_COLOR = 0xFF0000 # Red
2020BORDER_COLOR = 0xAAAAAA # Light Gray
2121STATUS_COLOR = BORDER_COLOR
2222
2323# PyLint can't find BLERadio for some reason so special case it here.
2424radio = adafruit_ble .BLERadio () # pylint: disable=no-member
25+ radio .name = "Now Playing Gizmo"
2526a = SolicitServicesAdvertisement ()
2627a .solicited_services .append (AppleMediaService )
2728radio .start_advertising (a )
@@ -81,12 +82,12 @@ def set_status(label, action_text, player):
8182
8283 # Draw the text fields
8384 print ("Loading Font Glyphs..." )
84- title_label = make_label ("None" , 18 , 30 , TEXT_COLOR , font = "/fonts/Arial-Bold-24 .bdf" )
85- artist_label = make_label ("None" , 18 , 70 , TEXT_COLOR , font = "/fonts/Arial-22 .bdf" )
86- album_label = make_label ("None" , 18 , 170 , TEXT_COLOR , font = "/fonts/Arial-22 .bdf" )
85+ title_label = make_label ("None" , 12 , 30 , TEXT_COLOR , font = "/fonts/Arial-Bold-18 .bdf" )
86+ artist_label = make_label ("None" , 12 , 70 , TEXT_COLOR , font = "/fonts/Arial-16 .bdf" )
87+ album_label = make_label ("None" , 12 , 170 , TEXT_COLOR , font = "/fonts/Arial-16 .bdf" )
8788 status_label = make_label ("None" , 80 , 220 , STATUS_COLOR , font = "/fonts/Arial-16.bdf" )
8889 group .append (make_background (240 , 240 , BACKGROUND_COLOR ))
89- border = Rect (10 , 8 , 200 , 190 , outline = BORDER_COLOR , stroke = 1 )
90+ border = Rect (4 , 4 , 232 , 200 , outline = BORDER_COLOR , stroke = 2 )
9091 group .append (title_label )
9192 group .append (artist_label )
9293 group .append (album_label )
@@ -101,9 +102,9 @@ def set_status(label, action_text, player):
101102 print ("paired" )
102103
103104 ams = connection [AppleMediaService ]
104- set_label (title_label , ams .title , 12 )
105- set_label (album_label , ams .album , 13 )
106- set_label (artist_label , ams .artist , 13 )
105+ set_label (title_label , ams .title , 18 )
106+ set_label (album_label , ams .album , 21 )
107+ set_label (artist_label , ams .artist , 21 )
107108 action = "?"
108109 if ams .playing :
109110 action = "Playing"
@@ -126,5 +127,5 @@ def set_status(label, action_text, player):
126127
127128 print ("disconnected" )
128129 # Remove all layers
129- while group .__len__ ():
130+ while group .len ():
130131 group .pop ()
0 commit comments