15
15
from adafruit_ble_apple_media import AppleMediaService
16
16
from adafruit_circuitplayground import cp
17
17
18
- BACKGROUND_COLOR = 0x444444 # Gray
18
+ BACKGROUND_COLOR = 0x49523b # Gray
19
19
TEXT_COLOR = 0xFF0000 # Red
20
20
BORDER_COLOR = 0xAAAAAA # Light Gray
21
21
STATUS_COLOR = BORDER_COLOR
22
22
23
23
# PyLint can't find BLERadio for some reason so special case it here.
24
24
radio = adafruit_ble .BLERadio () # pylint: disable=no-member
25
+ radio .name = "Now Playing Gizmo"
25
26
a = SolicitServicesAdvertisement ()
26
27
a .solicited_services .append (AppleMediaService )
27
28
radio .start_advertising (a )
@@ -81,12 +82,12 @@ def set_status(label, action_text, player):
81
82
82
83
# Draw the text fields
83
84
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" )
87
88
status_label = make_label ("None" , 80 , 220 , STATUS_COLOR , font = "/fonts/Arial-16.bdf" )
88
89
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 )
90
91
group .append (title_label )
91
92
group .append (artist_label )
92
93
group .append (album_label )
@@ -101,9 +102,9 @@ def set_status(label, action_text, player):
101
102
print ("paired" )
102
103
103
104
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 )
107
108
action = "?"
108
109
if ams .playing :
109
110
action = "Playing"
@@ -126,5 +127,5 @@ def set_status(label, action_text, player):
126
127
127
128
print ("disconnected" )
128
129
# Remove all layers
129
- while group .__len__ ():
130
+ while group .len ():
130
131
group .pop ()
0 commit comments