Test commit
[couchpytato.git] / mod_showcase.py
bloba0dafdb59f452f96aa5e73b6ff37623800644aa8
1 import gui, pygame, os, time, mod, cfg
2 from pygame.locals import *
4 class Module(mod.Module):
5 def __init__(self, screen):
6 mod.Module.__init__(self, screen)
7 import playlist
8 self.addloop('PlaylistUpdate', self._listupd)
10 def keyhandler(self, event):
11 if event.type == KEYDOWN:
12 if event.key == K_LEFT: self._quit()
13 if event.key == K_ESCAPE: self._quit()
15 def _quit(self):
16 cfg.modname = 'mainmenu'
17 cfg.modcf = cfg.cf['modules'][cfg.modname]
18 self.loadmodule = cfg.modname
20 def _listupd(self):
21 import playlist
22 self.changebykey('PLAYLIST-5', playlist.PLAYLIST.track(True, -5))
23 self.changebykey('PLAYLIST-4', playlist.PLAYLIST.track(True, -4))
24 self.changebykey('PLAYLIST-3', playlist.PLAYLIST.track(True, -3))
25 self.changebykey('PLAYLIST-2', playlist.PLAYLIST.track(True, -2))
26 self.changebykey('PLAYLIST-1', playlist.PLAYLIST.track(True, -1))
27 self.changebykey('PLAYLIST+1', playlist.PLAYLIST.track(True, 1))
28 self.changebykey('PLAYLIST+2', playlist.PLAYLIST.track(True, 2))
29 self.changebykey('PLAYLIST+3', playlist.PLAYLIST.track(True, 3))
30 self.changebykey('PLAYLIST+4', playlist.PLAYLIST.track(True, 4))
31 self.changebykey('PLAYLIST+5', playlist.PLAYLIST.track(True, 5))