Skip to content
Snippets Groups Projects
Verified Commit 3a8bc242 authored by dos's avatar dos
Browse files

Display song progress in the middle circle

parent a32d79b3
Branches
No related tags found
No related merge requests found
...@@ -199,19 +199,24 @@ class SongView(BaseView): ...@@ -199,19 +199,24 @@ class SongView(BaseView):
ctx.line_width = 3 ctx.line_width = 3
if not self.debug or True:
ctx.gray(0.69)
ctx.arc(0, 0, RADIUS + 1.5, 0, tau, 0)
ctx.fill()
for i in range(5): for i in range(5):
ctx.gray(math.sqrt(self.missed[i]) * 0.6) ctx.gray(math.sqrt(self.missed[i]) * 0.55)
ctx.arc(0, 0, RADIUS - 1.5, (tau / 5) * (i - 2.25 - 0.5), (tau / 5) * (i - 2.25 + 0.5), 0) ctx.arc(0, 0, RADIUS, (tau / 5) * (i - 2.25 - 0.5), (tau / 5) * (i - 2.25 + 0.5), 0)
ctx.line_to(0, 0) ctx.line_to(0, 0)
ctx.fill() ctx.fill()
if not self.started:
pro = 0.0
elif self.finished:
pro = 1.0
else: else:
ctx.begin_path() pro = media.get_position() / media.get_duration()
ctx.gray(1.0) ctx.gray(0.64)
utils.circle(ctx, 0, 0, RADIUS) ctx.arc(0, 0, RADIUS, tau / 4 + tau * pro - 0.01, tau / 4 + tau, 0)
ctx.stroke()
ctx.gray(0.86)
ctx.arc(0, 0, RADIUS, tau / 4, tau / 4 + tau * pro, 0)
ctx.stroke()
ctx.save() ctx.save()
ctx.rotate(tau / 10 + tau / 5) ctx.rotate(tau / 10 + tau / 5)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment