Commit 417e7156 by BellCodeEditor

save project

parent 94ecc1f8
Showing with 23 additions and 3 deletions
...@@ -13,6 +13,7 @@ last_img = pygame.image.load('last.png') # 上一曲按钮 ...@@ -13,6 +13,7 @@ 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 logo_img = pygame.image.load('logo.png') # 中间logo
pygame.mixer.music.load("a.mp3") pygame.mixer.music.load("a.mp3")
v = pygame.font.Font("neuropol.ttf",5)
c=[] c=[]
tick = 0 tick = 0
a = 0.2 a = 0.2
...@@ -62,6 +63,9 @@ while True: ...@@ -62,6 +63,9 @@ while True:
pygame.mixer.music.play() pygame.mixer.music.play()
tick = 0 tick = 0
play_button = stop_img play_button = stop_img
y = pygame.mixer.Sound(d + "//" + c[num])
k = y.get_length()
k = int(k)
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
...@@ -71,6 +75,13 @@ while True: ...@@ -71,6 +75,13 @@ while True:
pygame.mixer.music.play() pygame.mixer.music.play()
tick = 0 tick = 0
play_button = stop_img play_button = stop_img
y = pygame.mixer.Sound(d + "//" + c[num])
k = y.get_length()
k = int(k)
if pygame.mixer.music.get_busy() == False: if pygame.mixer.music.get_busy() == False:
num +=1 num +=1
...@@ -78,13 +89,15 @@ while True: ...@@ -78,13 +89,15 @@ while True:
num = 0 num = 0
pygame.mixer.music.load(d + "//" + c[num]) pygame.mixer.music.load(d + "//" + c[num])
pygame.mixer.music.play() pygame.mixer.music.play()
y = pygame.mixer.Sound(d + "//" + c[num])
k = y.get_length()
k = int(k)
s = pygame.mixer.music.get_pos() s = pygame.mixer.music.get_pos()
s = int(s//1000) s = int(s//1000)
i = s//60 i = s//60
j = s%60 j = s%60
k = str(i)+":"+str(j) l = str(i)+":"+str(j)
print(k) print(k)
if b == stop_img: if b == stop_img:
...@@ -92,12 +105,19 @@ while True: ...@@ -92,12 +105,19 @@ while True:
w = pygame.transform.rotate(logo_img,angle) w = pygame.transform.rotate(logo_img,angle)
z = w.get_rect(center = (320,200)) z = w.get_rect(center = (320,200))
wz=(z[0],z[1]) wz=(z[0],z[1])
o = k//60
p = k%60
k = str(o)+":"+str(p)
print(k)
# 绘制画面 # 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景 screen.blit(bg_img, (0, 0)) # 填充背景
screen.blit(b, (270, 330)) # 暂停按钮 screen.blit(b, (270, 330)) # 暂停按钮
screen.blit(w, wz) # 中间logo图 screen.blit(w, wz) # 中间logo图
cd = v.render(l,True,(225,225,225))
screen.blit(cd,(120,440))
ab = v.render("/"+k,True,(0,0,0))
screen.blit(ab,(170,440))
screen.blit(last_img, (120, 350)) # 上一曲 screen.blit(last_img, (120, 350)) # 上一曲
screen.blit(next_img, (420, 350)) # 下一曲 screen.blit(next_img, (420, 350)) # 下一曲
# 刷新画面 # 刷新画面
......
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