Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from appuifw import*
- from graphics import*
- from e32 import*
- import audio
- run = 1
- def quit():global run;run=0;A.stop()
- app.exit_key_handler = quit
- app.screen = 'full'
- app.body = c = Canvas()
- X,Y=c.size
- im = Image.new((X,Y))
- pth=u'e:\\Sounds\\'
- lagu={};j=[]
- def judul(pth):
- k=0
- for x in os.listdir(pth):
- if x.endswith('.mp3'):
- k+=1
- lagu[k]=pth+x
- j.append(unicode(x))
- judul(pth)
- ky=1
- def putar():
- global A,ky
- if ky>len(lagu):ky=1
- if ky<1:ky=len(lagu)
- A=audio.Sound.open(lagu[ky])
- A.play()
- putar()
- def U():global ky;ky-=1;A.stop();putar()
- def D():global ky;ky+=1;A.stop();putar()
- c.bind(63497,U)
- c.bind(63498,D)
- def gambar():
- im.text((10,130),j[ky-1],0xff00ff,(u'',20))
- while run:
- im.clear(0xfff0b0)
- gambar()
- c.blit(im)
- ao_sleep(0.1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement