Skip to content

Commit 6496dcf

Browse files
committed
Updated with more tweaks
1 parent 7b7abfd commit 6496dcf

File tree

4 files changed

+32663
-78664
lines changed

4 files changed

+32663
-78664
lines changed

CPB_AMS_Gizmo_BLE/cpb_ams_gizmo_ble.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@
1515
from adafruit_ble_apple_media import AppleMediaService
1616
from adafruit_circuitplayground import cp
1717

18-
BACKGROUND_COLOR = 0x444444 # Gray
18+
BACKGROUND_COLOR = 0x49523b # Gray
1919
TEXT_COLOR = 0xFF0000 # Red
2020
BORDER_COLOR = 0xAAAAAA # Light Gray
2121
STATUS_COLOR = BORDER_COLOR
2222

2323
# PyLint can't find BLERadio for some reason so special case it here.
2424
radio = adafruit_ble.BLERadio() # pylint: disable=no-member
25+
radio.name = "Now Playing Gizmo"
2526
a = SolicitServicesAdvertisement()
2627
a.solicited_services.append(AppleMediaService)
2728
radio.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

Comments
 (0)