diff 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
line wrap: on
line diff
--- a/vixm/playlist.py	Sat Aug 12 20:21:06 2006 -0400
+++ b/vixm/playlist.py	Sat Aug 12 21:00:00 2006 -0400
@@ -1,15 +1,28 @@
 # a playlist definition
 
+import xmms
+
+LIST_PRIO	= 0
+LIST_DEFAULT	= 1
+
 class playlist:
-	def __init__(self):
+	def __init__(self, allowrandom=False):
 		self.__list = []
+		self.__allowrand = allowrandom # allow randomization of this list
 	
-	def enqueue(self, song)
+	def enqueue(self, song):
+		""" Append a song to the list """
 		self.__list.append(song)
 	
-	def dequeue(self, song)
+	def dequeue(self, song):
+		""" Remove a song from the list """
 		self.__list.remove(song)
 	
 	def pop(self):
-		self.__list.pop(0)
+		""" Pop the next song """
+		return self.__list.pop(0)
 
+	def __getitem__(self, i):
+		""" Get item at position i """
+		return self.__list[i]
+