Merge pull request #3091 from dhalbert/update-jeplayer

Update JEPlayer for adafruit_progressbar changes; fix background.bmp
This commit is contained in:
Dan Halbert 2025-08-01 13:11:05 -04:00 committed by GitHub
commit 371bd7ba16
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 6 deletions

View file

@ -38,7 +38,7 @@ import time
import adafruit_bitmap_font.bitmap_font import adafruit_bitmap_font.bitmap_font
import adafruit_display_text.label import adafruit_display_text.label
from adafruit_progressbar import ProgressBar from adafruit_progressbar.horizontalprogressbar import HorizontalProgressBar
import sdcardio import sdcardio
import analogjoy import analogjoy
import audioio import audioio
@ -75,9 +75,12 @@ class PlaybackDisplay:
def __init__(self): def __init__(self):
self.group = displayio.Group() self.group = displayio.Group()
self.glyph_width, self.glyph_height = font.get_bounding_box()[:2] self.glyph_width, self.glyph_height = font.get_bounding_box()[:2]
self.pbar = ProgressBar(0, 0, board.DISPLAY.width, self.pbar = HorizontalProgressBar((0, 0),
self.glyph_height*2, bar_color=0x0000ff, (board.DISPLAY.width, self.glyph_height*2),
outline_color=0x333333, stroke=1) min_value = 0.0, max_value = 1.0,
bar_color=0x0000ff,
outline_color=0x333333,
fill_color=0x000000)
self.iconbar = icons.IconBar() self.iconbar = icons.IconBar()
self.iconbar.group.y = 1000 self.iconbar.group.y = 1000
for i in range(5, 8): for i in range(5, 8):
@ -115,11 +118,11 @@ class PlaybackDisplay:
@property @property
def progress(self): def progress(self):
"""The fraction of progress through the current track""" """The fraction of progress through the current track"""
return self.pbar.progress return self.pbar.value
@progress.setter @progress.setter
def progress(self, frac): def progress(self, frac):
self.pbar.progress = frac self.pbar.value = frac
def set_bitmap(self, candidates): def set_bitmap(self, candidates):
"""Find and use a background from among candidates, or else the fallback bitmap""" """Find and use a background from among candidates, or else the fallback bitmap"""

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 27 KiB