Commit b0c5fa75 by BellCodeEditor

save project

parent e52480f9
Showing with 19 additions and 0 deletions
...@@ -60,6 +60,9 @@ while True: ...@@ -60,6 +60,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_len=music.get_length()
music_len=int(music_len)
play_button = stop_img play_button = stop_img
if click % 2 == 0: if click % 2 == 0:
click += 2 click += 2
...@@ -72,6 +75,9 @@ while True: ...@@ -72,6 +75,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_len=music.get_length()
music_len=int(music_len)
play_button = stop_img play_button = stop_img
if click % 2 == 0: if click % 2 == 0:
click += 2 click += 2
...@@ -84,13 +90,24 @@ while True: ...@@ -84,13 +90,24 @@ 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_len=music.get_length()
music_len=int(music_len)
play_time=pygame.mixer.music.get_pos() play_time=pygame.mixer.music.get_pos()
play_time=int(play_time/1000) play_time=int(play_time/1000)
play_m=play_time//60 play_m=play_time//60
play_s=play_time%60 play_s=play_time%60
info=str(play_m)+':'+str(play_s) info=str(play_m)+':'+str(play_s)
if play_s<10:
play_s='0'+str(play_s)
s=new_font.render(info,True,(255,255,255)) s=new_font.render(info,True,(255,255,255))
music_m=music_len//60
music_s=music_len%60
info=str(music_m)+':'+str(music_s)
if music_s<10:
play_s='0'+str(play_s)
s1=new_font.render(info,True,(0,0,0))
new_logo=pygame.transform.rotate(logo_img,angle) new_logo=pygame.transform.rotate(logo_img,angle)
new_rect=new_logo.get_rect(center=(320,200)) new_rect=new_logo.get_rect(center=(320,200))
pos=(new_rect[0],new_rect[1]) pos=(new_rect[0],new_rect[1])
...@@ -103,6 +120,7 @@ while True: ...@@ -103,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(s,(120,440)) screen.blit(s,(120,440))
screen.blit(s1,(150,440))
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
f.tick(60) f.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