Commit 52297d67 by BellCodeEditor

auto save

parent f60741eb
Showing with 7 additions and 11 deletions
...@@ -13,7 +13,7 @@ stop_img = pygame.image.load('stop.png') # 暂停按钮 ...@@ -13,7 +13,7 @@ stop_img = pygame.image.load('stop.png') # 暂停按钮
last_img = pygame.image.load('last.png') # 上一曲按钮 last_img = pygame.image.load('last.png') # 上一曲按钮
next_img = pygame.image.load('next.png') # 下一曲按钮 next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img = pygame.image.load('logo.png') # 下一曲按钮 logo_img = pygame.image.load('logo.png') # 下一曲按钮
basic_font=pygame.Font(neuropol.ttf)
music_list = [] music_list = []
path = "C:\\Users\\HP\\Desktop\\test" path = "C:\\Users\\HP\\Desktop\\test"
filelist = os.listdir(path) filelist = os.listdir(path)
...@@ -65,6 +65,9 @@ while True: ...@@ -65,6 +65,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(music_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
...@@ -77,7 +80,9 @@ while True: ...@@ -77,7 +80,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(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)-1: if num > len(music_list)-1:
...@@ -89,20 +94,12 @@ while True: ...@@ -89,20 +94,12 @@ while True:
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])
angle+=1 angle+=1
#
play_time=pygame.mixer.music.get_pos()
play_time=int(play_time/1000)
play_m=time//60
play_s=time%60
info=str(play_m)+":"+str(play_s)
# 绘制画面 # 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景 screen.blit(bg_img, (0, 0)) # 填充背景
screen.blit(play_button, (270, 330)) # 暂停按钮 screen.blit(play_button, (270, 330)) # 暂停按钮
screen.blit(new_logo, pos) # 中间logo图 screen.blit(new_logo, pos) # 中间logo图
screen.blit(last_img, (120, 350)) # 上一曲 screen.blit(last_img, (120, 350)) # 上一曲
screen.blit(next_img, (420, 350)) # 下一曲 screen.blit(next_img, (420, 350)) # 下一曲
scoreSurf=
(120,440)
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
FPS.tick(60) FPS.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