Commit 3c5d4816 by BellCodeEditor

save project

parent 62453fa5
Showing with 19 additions and 1 deletions
...@@ -25,6 +25,7 @@ pygame.mixer.music.set_volume(volume) # 初始播放音量 ...@@ -25,6 +25,7 @@ pygame.mixer.music.set_volume(volume) # 初始播放音量
click = 0 click = 0
angle=0 angle=0
play_button = stop_img play_button = stop_img
music_length = 0
while True: while True:
...@@ -55,6 +56,10 @@ while True: ...@@ -55,6 +56,10 @@ while True:
else: else:
play_button = play_img play_button = play_img
pygame.mixer.music.pause() pygame.mixer.music.pause()
# music1=pygame.mixer.Sound(path:+"\\"+music_list(num))
music1 = pygame.mixer.Sound(path+"\\"+music_list[num])
music_length=music1.get_length()
music_length=int(length)
if x > 420 and x < 520 and y > 350 and y < 400: # 下一曲 if x > 420 and x < 520 and y > 350 and y < 400: # 下一曲
num += 1 num += 1
if num > len(music_list) - 1: if num > len(music_list) - 1:
...@@ -66,7 +71,9 @@ while True: ...@@ -66,7 +71,9 @@ while True:
click += 2 click += 2
else: else:
click += 1 click += 1
music1 = pygame.mixer.Sound(path+"\\"+music_list[num])
music_length=music1.get_length()
music_length=int(length)
if x > 120 and x < 220 and y > 350 and y < 400: # 上一曲 if x > 120 and x < 220 and y > 350 and y < 400: # 上一曲
num -= 1 num -= 1
if num < 0: if num < 0:
...@@ -78,6 +85,9 @@ while True: ...@@ -78,6 +85,9 @@ while True:
click += 2 click += 2
else: else:
click += 1 click += 1
music1 = pygame.mixer.Sound(path+"\\"+music_list[num])
music_length=music1.get_length()
music_length=int(length)
if pygame.mixer.music.get_busy() == False: if pygame.mixer.music.get_busy() == False:
num += 1 num += 1
...@@ -89,8 +99,16 @@ while True: ...@@ -89,8 +99,16 @@ while True:
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
if play_s <10:
play_s="0"+str(play_s)
info=str(play_m) +":"+str(play_s) info=str(play_m) +":"+str(play_s)
music_m=music_length//60
music_s=music_length%60
if music_s < 10:
music_s="0"+str(music_s)
info2=str(music_m)+":"+str(music_s)
new_logo=pygame.transform.rotate(logo_img,angle) new_logo=pygame.transform.rotate(logo_img,angle)
newRect=new_logo.get_rect(center=(320,200)) newRect=new_logo.get_rect(center=(320,200))
pos=(newRect[0]), newRect[1] pos=(newRect[0]), newRect[1]
......
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