Commit e8e8e7ab by BellCodeEditor

save project

parent c400e49a
Showing with 19 additions and 2 deletions
...@@ -61,6 +61,9 @@ while True: ...@@ -61,6 +61,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()
music1=pygame.mixer.Sound(path + "\\" + music_list[num])
music_length=music1.get_length()
music_length=int(music_length)
play_button = stop_img play_button = stop_img
if click % 2 == 0: if click % 2 == 0:
click += 2 click += 2
...@@ -73,6 +76,9 @@ while True: ...@@ -73,6 +76,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()
music1=pygame.mixer.Sound(path + "\\" + music_list[num])
music_length=music1.get_length()
music_length=int(music_length)
play_button = stop_img play_button = stop_img
if click % 2 == 0: if click % 2 == 0:
click += 2 click += 2
...@@ -84,13 +90,22 @@ while True: ...@@ -84,13 +90,22 @@ while True:
if num > len(music_list)-1: if num > len(music_list)-1:
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=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
music_m=music_length//60
music_s=music_length%60
if play_s<10:
play_s="0"+str(play_s)
if music_s<10:
music_s="0"+str(music_s)
info=str(play_m)+":"+str(play_s) info=str(play_m)+":"+str(play_s)
info2=str( music_m)+":"+str(music_s)
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])
...@@ -98,7 +113,7 @@ while True: ...@@ -98,7 +113,7 @@ while True:
angle+=1 angle+=1
img=my_font.render(info,True,(255,255,255)) img=my_font.render(info,True,(255,255,255))
img2=my_font.render("\"+info2,True,(0,0,0))
# 绘制画面 # 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景 screen.blit(bg_img, (0, 0)) # 填充背景
screen.blit(play_button, (270, 330)) # 暂停按钮 screen.blit(play_button, (270, 330)) # 暂停按钮
...@@ -106,6 +121,7 @@ while True: ...@@ -106,6 +121,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(img,(120,450)) screen.blit(img,(120,450))
screen.blit(img2,(220,450))
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
clock.tick(60) clock.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