50 lines
1.2 KiB
Python
50 lines
1.2 KiB
Python
from list import List
|
|
|
|
class Queue(List):
|
|
def __init__(self,data,nextFunc,labelFunc,plause):
|
|
List.__init__(self,data,"Queue",nextFunc,labelFunc,plause)
|
|
self.data = data
|
|
#for file in self.data.curQ:
|
|
# List.insert(self,self.data.library.files[file])
|
|
self.populated = False
|
|
self.count = len(self.data.curQ)
|
|
self.makeLabel()
|
|
#self.filterRows("")
|
|
|
|
|
|
def getNext(self):
|
|
if len(self.list) == 0:
|
|
return False
|
|
# Queue ignores random settings and filtering
|
|
self.data.curSong = self.list[0][0]
|
|
self.data.curQ.pop(self.data.curQ.index(self.data.curSong))
|
|
self.remove(self.list.get_iter_root())
|
|
self.filterRows(self.string)
|
|
self.loadSong(self.data.library.files[self.data.curSong])
|
|
return True
|
|
|
|
|
|
def insert(self,file):
|
|
List.insert(self,file)
|
|
self.data.curQ += [file]
|
|
|
|
|
|
def visible(self,func):
|
|
List.visible(self,func)
|
|
if (func == "show") and (self.populated == False):
|
|
for file in self.data.curQ:
|
|
List.insert(self,file)
|
|
self.populated = True
|
|
self.makeLabel()
|
|
self.timeText()
|
|
|
|
|
|
def filterRows(self,string):
|
|
if self.populated == False:
|
|
self.visible("show")
|
|
List.filterRows(self,string)
|
|
|
|
|
|
def filterQuick(self,string):
|
|
List.filterQuick(self,self.data.curQ,string)
|