Skip to content

Update JEPlayer for adafruit_progressbar changes; fix background.bmp #3091

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions CircuitPython_JEplayer_mp3/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

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

@progress.setter
def progress(self, frac):
self.pbar.progress = frac
self.pbar.value = frac

def set_bitmap(self, candidates):
"""Find and use a background from among candidates, or else the fallback bitmap"""
Expand Down
Binary file modified CircuitPython_JEplayer_mp3/rsrc/background.bmp
Binary file not shown.