Commit 47f8d8a6 by BellCodeEditor

auto save

parent 09e0a9ea
Showing with 23 additions and 1 deletions
......@@ -70,6 +70,9 @@ while True:
click += 2
else:
click += 1
music1 = pygame.mixer.Sound(path + "\\" + music_list[num])
music1_length = music1.get_length()
music1_length = int(music1_length)
if x > 120 and x < 220 and y > 350 and y < 400: # 上一曲
num -= 1
......@@ -82,6 +85,9 @@ while True:
click += 2
else:
click += 1
music1 = pygame.mixer.Sound(path + "\\" + music_list[num])
music1_length = music1.get_length()
music1_length = int(music1_length)
if pygame.mixer.music.get_busy() == False:
num += 1
......@@ -90,11 +96,25 @@ while True:
pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.play()
music_time = pygame.mixer.music.get_pos()//1000
music1 = pygame.mixer.Sound(path + "\\" + music_list[num])
music1_length = music1.get_length()
music1_length = int(music1_length)
music_time = pygame.mixer.music.get_pos()
music_time = int(music_time/1000)
time_m = music_time//60
time_s = music_time%60
print(time_s)
if time_s < 10:
time_s = "0" + str(time_s)
text = my_font.render(str(time_m) + ":" + str(time_s),True,(0,255,0))
music_m = music1_length//60
music_s = music1_length%60
if music_s < 10:
music_s = "0" + str(music_s)
text2 = my_font.render(str(music_m) + ":" + str(music_s),True,(255,0,0))
logo_rotate = pygame.transform.rotate(logo_img,logo_angle)
logo_rect = logo_rotate.get_rect(center = (320,180))
......@@ -109,6 +129,7 @@ while True:
screen.blit(last_img, (120, 350)) # 上一曲
screen.blit(next_img, (420, 350)) # 下一曲
screen.blit(text,(120,250))
screen.blit(text2,(220,250))
# 刷新画面
pygame.display.update()
#FPS.tick(60)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment