Commit fea33995 by BellCodeEditor

save project

parent baeabf5d
Showing with 22 additions and 5 deletions
......@@ -12,7 +12,7 @@ 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') # 下一曲按钮
basic_font = pygame.font.Font('neuropol.ttf',14)
music_list = []
path = "C:\\Users\\Administrator\\Desktop\\test"
filelist = os.listdir(path)
......@@ -75,7 +75,20 @@ while True:
click += 2
else:
click += 1
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 = int(play_time/1000)
play_m = play_time//60
play_s = play_time % 60
info = str(play_m) + ":" + str(play_s)
print("当前的播放进度:"+info)
music_m = music_length//60
music_s = music_length % 60
foin='/'+str(music_m)+":"+str(music_s)
print(foin)
play_time = pygame.mixer.music.get_pos()
if pygame.mixer.music.get_busy() == False:
num += 1
if num > len(music_list)-1:
......@@ -92,5 +105,9 @@ while True:
screen.blit(new_logo,pos)
screen.blit(last_img, (120, 350))
screen.blit(next_img, (420, 350))
pygame.display.update()
\ No newline at end of file
scoreSurf = basic_font.render(info,True,(255,255,255))
scoreSuf = basic_font.render(foin,True,(255,255,255))
screen.blit(scoreSurf,(120,440))
screen.blit(scoreSuf,(165,440))
pygame.display.update()
#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