Commit a74b6b0c by BellCodeEditor

save project

parent 88ff062b
Showing with 14 additions and 3 deletions
......@@ -12,10 +12,10 @@ stop_img = pygame.image.load('stop.png') # 暂停按钮
last_img = pygame.image.load('last.png') # 上一曲按钮
next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img = pygame.image.load('logo.png') # 下一曲按钮
we=pygame.font.Font(neuropol.ttf:)
we=pygame.font.Font('neuropol.ttf',18)
qaz=pygame.time.Clock()
music_list = []
path = "C:\\Users\\Administrator\\Desktop\\etr"
path = "C:\\Users\\Administrator\\Desktop\\gh"
filelist = os.listdir(path)
num = -1
for i in filelist:
......@@ -26,6 +26,8 @@ pygame.mixer.music.set_volume(volume) # 初始播放音量
click = 0
play_button = stop_img
et=0
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
......@@ -54,6 +56,7 @@ while True:
else:
play_button = play_img
pygame.mixer.music.pause()
if x > 420 and x < 520 and y > 350 and y < 400: # 下一曲
num += 1
if num > len(music_list) - 1:
......@@ -65,7 +68,9 @@ while True:
click += 2
else:
click += 1
music0=pygame.mixer.Sound(path+"\\"+music_list[num])
music_length=music0.get_length()
music_length=int(music_length)
if x > 120 and x < 220 and y > 350 and y < 400: # 上一曲
num -= 1
if num < 0:
......@@ -77,6 +82,9 @@ while True:
click += 2
else:
click += 1
music0=pygame.mixer.Sound(path+"\\"+music_list[num])
music_length=music0.get_length()
music_length=int(music_length)
play_time=pygame.mixer.music.get_pos()
play_time=int(play_time/1000)
play_m=play_time//60
......@@ -89,6 +97,9 @@ while True:
num = 0
pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.play()
music0=pygame.mixer.Sound(path+"\\"+music_list[num])
music_length=music0.get_length()
music_length=int(music_length)
e=pygame.transform.rotate(logo_img,et)
l=e.get_rect(center=(320,200))
if play_button==stop_img:
......
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