Commit 1a09fed2 by BellCodeEditor

save project

parent 730b836d
Showing with 19 additions and 0 deletions
...@@ -67,6 +67,11 @@ while True: ...@@ -67,6 +67,11 @@ while True:
pygame.mixer.music.play() pygame.mixer.music.play()
click=0 click=0
play_button = stop_img play_button = stop_img
music1=pygame.mixer.Sound(path+'\\'+music_list[num])
music_length=music1.get_length()
music_length=int(music_length)
if x>420 and y>350 and x<520 and y<400: if x>420 and y>350 and x<520 and y<400:
num+=1 num+=1
if num>len(music_list)-1: if num>len(music_list)-1:
...@@ -76,12 +81,20 @@ while True: ...@@ -76,12 +81,20 @@ while True:
click=0 click=0
play_button = stop_img play_button = stop_img
music1=pygame.mixer.Sound(path+'\\'+music_list[num])
music_length=music1.get_length()
music_length=int(music_length)
if pygame.mixer.music.get_busy() == False: if pygame.mixer.music.get_busy() == False:
num+=1 num+=1
if num>len(music_list): if num>len(music_list):
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()
music1=pygame.mixer.Sound(path+'\\'+music_list[num])
music_length=music1.get_length()
music_length=int(music_length)
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)
...@@ -89,6 +102,11 @@ while True: ...@@ -89,6 +102,11 @@ while True:
play_s=play_time%60 play_s=play_time%60
info=str(play_m)+':'+str(play_s) info=str(play_m)+':'+str(play_s)
test=my_font.render(info,True,(255,255,255)) test=my_font.render(info,True,(255,255,255))
muisc_m=music_length//60
muisc_s=music_length%60
info1='/'+str(muisc_m)+':'+str(muisc_s)
test1=my_font.render(info1,True,(0,0,0))
new_logo=pygame.transform.rotate(logo_img,angle) new_logo=pygame.transform.rotate(logo_img,angle)
z=new_logo.get_rect(center=(320,200)) z=new_logo.get_rect(center=(320,200))
...@@ -103,5 +121,6 @@ while True: ...@@ -103,5 +121,6 @@ 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(test,(120, 440)) screen.blit(test,(120, 440))
screen.blit(test1,(160,440))
# 刷新画面 # 刷新画面
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