Commit ad8995b8 by BellCodeEditor

save project

parent 6cccd6a7
Showing with 18 additions and 1 deletions
...@@ -59,6 +59,9 @@ while True: ...@@ -59,6 +59,9 @@ while True:
num = 0 num = 0
pygame.mixer.music.load(path + "\\" + music_list[num]) pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.play() pygame.mixer.music.play()
music=pygame.mixer.Sound(path + "\\" + music_list[num])
music_lcugth=music.get_length()
music_lcugth=int(music_lcugth)
play_button = stop_img play_button = stop_img
if click % 2 == 0: if click % 2 == 0:
click += 2 click += 2
...@@ -71,6 +74,9 @@ while True: ...@@ -71,6 +74,9 @@ while True:
num = len(music_list) - 1 num = len(music_list) - 1
pygame.mixer.music.load(path + "\\" + music_list[num]) pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.play() pygame.mixer.music.play()
music=pygame.mixer.Sound(path + "\\" + music_list[num])
music_lcugth=music.get_length()
music_lcugth=int(music_lcugth)
play_button = stop_img play_button = stop_img
if click % 2 == 0: if click % 2 == 0:
click += 2 click += 2
...@@ -83,13 +89,23 @@ while True: ...@@ -83,13 +89,23 @@ while True:
num = 0 num = 0
pygame.mixer.music.load(path + "\\" + music_list[num]) pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.play() pygame.mixer.music.play()
music=pygame.mixer.Sound(path + "\\" + music_list[num])
music_lcugth=music.get_length()
music_lcugth=int(music_lcugth)
play_time=pygame.mixer.music.get_pos() play_time=pygame.mixer.music.get_pos()
play_time=play_time//1000 play_time=play_time//1000
play_m=play_time//60 play_m=play_time//60
play_s=play_time%60 play_s=play_time%60
if play_s<10:
play_s="0"+str(play_s)
info=str(play_m)+":"+str(play_s) info=str(play_m)+":"+str(play_s)
text=my_font.render(info,True,(255,255,255)) text=my_font.render(info,True,(255,255,255))
music_m=music_lcugth//60
music_s=music_lcugth%60
if music_s<10:
music_s="0"+str(music_s)
info1=str(music_m)+":"+str(music_s)
text1=my_font.render("/"+info1,True,(255,255,255))
if play_button==stop_img: if play_button==stop_img:
new_logo=pygame.transform.rotate(logo_img,angle) new_logo=pygame.transform.rotate(logo_img,angle)
...@@ -104,6 +120,7 @@ while True: ...@@ -104,6 +120,7 @@ while True:
screen.blit(last_img, (120, 350)) # 上一曲 screen.blit(last_img, (120, 350)) # 上一曲
screen.blit(next_img, (420, 350)) # 下一曲 screen.blit(next_img, (420, 350)) # 下一曲
screen.blit(text,(120,420)) screen.blit(text,(120,420))
screen.blit(text1,(180,420))
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
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