Commit 423b67de by BellCodeEditor

save project

parent a5396bc9
Showing with 15 additions and 1 deletions
...@@ -14,6 +14,8 @@ next_img = pygame.image.load('next.png') # 下一曲按钮 ...@@ -14,6 +14,8 @@ next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img = pygame.image.load('logo.png') # 下一曲按钮 logo_img = pygame.image.load('logo.png') # 下一曲按钮
fo=pygame.font.Font('neuropol.ttf',14) fo=pygame.font.Font('neuropol.ttf',14)
music_list=[] music_list=[]
path = "C:\\Users\\EDZ\\Desktop\\新建文件夹 (2)" path = "C:\\Users\\EDZ\\Desktop\\新建文件夹 (2)"
filelist = os.listdir(path) filelist = os.listdir(path)
num = -1 num = -1
...@@ -28,6 +30,15 @@ fps=pygame.time.Clock() ...@@ -28,6 +30,15 @@ fps=pygame.time.Clock()
b=0 b=0
fps.tick(60) fps.tick(60)
while True: while True:
mu=pygame.mixer.Sound(path+'\\'+music_list[num])
ta=int(mu.get_length())
ta_m=ta//60
ta_s=ta%60
if ta_s<10:
ta_s='0'+str(ta_s)
if ta_m<10:
ta_m='0'+str(ta_m)
tas='/'+str(ta_m)+':'+str(ta_s)
time=pygame.mixer.music.get_pos()/1000 time=pygame.mixer.music.get_pos()/1000
time_m=int(time//60) time_m=int(time//60)
time_s=int(time%60) time_s=int(time%60)
...@@ -105,8 +116,10 @@ while True: ...@@ -105,8 +116,10 @@ while True:
screen.blit(n, (nr[0], nr[1])) # 中间logo图 screen.blit(n, (nr[0], nr[1])) # 中间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)) # 下一曲
ts=fo.render(tms,True,(255,255,255)) ts=fo.render(tms,True,(0,0,0))
tss=fo.render(tas,True,(255,255,255))
print(tms) print(tms)
screen.blit(ts,(120,440)) screen.blit(ts,(120,440))
screen.blit(tss,(190,440))
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
\ 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