comparison vixm/ui.py @ 3:dd00b69169c6

Created initial ui thread code, fixed up playlist code
author Josef "Jeff" Sipek <jeffpc@josefsipek.net>
date Sat, 12 Aug 2006 21:00:00 -0400
parents
children 187453f856a7
comparison
equal deleted inserted replaced
2:80a717f97cef 3:dd00b69169c6
1 # all the user interface related bits
2
3 import time
4 from threading import Thread
5 import xmms
6
7 import playlist, song
8
9 def run():
10 """ this is where we start execution """
11
12 # first, let's create the two playlists
13 print "Creating playlists..."
14 lists = {}
15 lists[playlist.LIST_PRIO] = playlist.playlist()
16 lists[playlist.LIST_DEFAULT] = playlist.playlist(allowrandom=True)
17
18 # read in the info for all the songs in XMMS's playlist
19 print "Loading songs from XMMS's playlist..."
20 songs = []
21 listlength = xmms.control.get_playlist_length()
22 for i in range(0,listlength):
23 s = song.song(i)
24 lists[playlist.LIST_DEFAULT].enqueue(s)
25
26 print "Instanciating ui thread..."
27 ui = uiThread()
28 ui.start()
29
30 while True:
31 print "Checking for xmms events"
32 time.sleep(1)
33
34 class uiThread(Thread):
35 """ This is the main ui thread class, it does all the magic
36 necessary to have a vi-like interface """
37 def __init__(self):
38 Thread.__init__(self)
39
40 def run(self):
41 while True:
42 print "Checking for ui events"
43 time.sleep(1)
44