Skip to content

Commit 83402f3

Browse files
committed
Update JEPlayer for adafruit_progressbar changes; fix background.bmp
1 parent 4a80a4a commit 83402f3

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

CircuitPython_JEplayer_mp3/code.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
import adafruit_bitmap_font.bitmap_font
4040
import adafruit_display_text.label
41-
from adafruit_progressbar import ProgressBar
41+
from adafruit_progressbar.horizontalprogressbar import HorizontalProgressBar
4242
import sdcardio
4343
import analogjoy
4444
import audioio
@@ -75,9 +75,12 @@ class PlaybackDisplay:
7575
def __init__(self):
7676
self.group = displayio.Group()
7777
self.glyph_width, self.glyph_height = font.get_bounding_box()[:2]
78-
self.pbar = ProgressBar(0, 0, board.DISPLAY.width,
79-
self.glyph_height*2, bar_color=0x0000ff,
80-
outline_color=0x333333, stroke=1)
78+
self.pbar = HorizontalProgressBar((0, 0),
79+
(board.DISPLAY.width, self.glyph_height*2),
80+
min_value = 0.0, max_value = 1.0,
81+
bar_color=0x0000ff,
82+
outline_color=0x333333,
83+
fill_color=0x000000)
8184
self.iconbar = icons.IconBar()
8285
self.iconbar.group.y = 1000
8386
for i in range(5, 8):
@@ -115,11 +118,11 @@ def text(self, text):
115118
@property
116119
def progress(self):
117120
"""The fraction of progress through the current track"""
118-
return self.pbar.progress
121+
return self.pbar.value
119122

120123
@progress.setter
121124
def progress(self, frac):
122-
self.pbar.progress = frac
125+
self.pbar.value = frac
123126

124127
def set_bitmap(self, candidates):
125128
"""Find and use a background from among candidates, or else the fallback bitmap"""
9.07 KB
Binary file not shown.

0 commit comments

Comments
 (0)