|
38 | 38 |
|
39 | 39 | import adafruit_bitmap_font.bitmap_font
|
40 | 40 | import adafruit_display_text.label
|
41 |
| -from adafruit_progressbar import ProgressBar |
| 41 | +from adafruit_progressbar.horizontalprogressbar import HorizontalProgressBar |
42 | 42 | import sdcardio
|
43 | 43 | import analogjoy
|
44 | 44 | import audioio
|
@@ -75,9 +75,12 @@ class PlaybackDisplay:
|
75 | 75 | def __init__(self):
|
76 | 76 | self.group = displayio.Group()
|
77 | 77 | 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) |
81 | 84 | self.iconbar = icons.IconBar()
|
82 | 85 | self.iconbar.group.y = 1000
|
83 | 86 | for i in range(5, 8):
|
@@ -115,11 +118,11 @@ def text(self, text):
|
115 | 118 | @property
|
116 | 119 | def progress(self):
|
117 | 120 | """The fraction of progress through the current track"""
|
118 |
| - return self.pbar.progress |
| 121 | + return self.pbar.value |
119 | 122 |
|
120 | 123 | @progress.setter
|
121 | 124 | def progress(self, frac):
|
122 |
| - self.pbar.progress = frac |
| 125 | + self.pbar.value = frac |
123 | 126 |
|
124 | 127 | def set_bitmap(self, candidates):
|
125 | 128 | """Find and use a background from among candidates, or else the fallback bitmap"""
|
|
0 commit comments