comparison vixm/playlist.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 80a717f97cef
children 79340745c952
comparison
equal deleted inserted replaced
2:80a717f97cef 3:dd00b69169c6
1 # a playlist definition 1 # a playlist definition
2 2
3 import xmms
4
5 LIST_PRIO = 0
6 LIST_DEFAULT = 1
7
3 class playlist: 8 class playlist:
4 def __init__(self): 9 def __init__(self, allowrandom=False):
5 self.__list = [] 10 self.__list = []
11 self.__allowrand = allowrandom # allow randomization of this list
6 12
7 def enqueue(self, song) 13 def enqueue(self, song):
14 """ Append a song to the list """
8 self.__list.append(song) 15 self.__list.append(song)
9 16
10 def dequeue(self, song) 17 def dequeue(self, song):
18 """ Remove a song from the list """
11 self.__list.remove(song) 19 self.__list.remove(song)
12 20
13 def pop(self): 21 def pop(self):
14 self.__list.pop(0) 22 """ Pop the next song """
23 return self.__list.pop(0)
15 24
25 def __getitem__(self, i):
26 """ Get item at position i """
27 return self.__list[i]
28