1 from HTMLComponent import *
2 from GUIComponent import *
4 from enigma import eListboxPythonMultiContent, eListbox, gFont
6 from enigma import eServiceReference, eServiceCenter, \
7 eServiceCenterPtr, iListableServicePtr, \
8 iStaticServiceInformationPtr
27 def MovieListEntry(serviceref, serviceHandler):
30 info = iStaticServiceInformationPtr()
32 if serviceHandler.info(serviceref, info):
33 # ignore service which refuse to info
37 len = info.getLength(serviceref)
39 len = "%d:%02d" % (len / 60, len % 60)
43 res.append((0, 0, 400, 30, 0, RT_HALIGN_LEFT, info.getName(serviceref)))
44 res.append((0, 30, 200, 20, 1, RT_HALIGN_LEFT, "Toller Film"))
45 res.append((0, 50, 200, 20, 1, RT_HALIGN_LEFT, "Aufgenommen: irgendwann"))
46 res.append((200, 50, 200, 20, 1, RT_HALIGN_RIGHT, len))
50 class MovieList(HTMLComponent, GUIComponent):
51 def __init__(self, root):
52 GUIComponent.__init__(self)
53 self.l = eListboxPythonMultiContent()
55 self.l.setList(self.list)
56 self.l.setFont(0, gFont("Arial", 30))
57 self.l.setFont(1, gFont("Arial", 18))
60 return self.l.getCurrentSelection()
62 def GUIcreate(self, parent):
63 self.instance = eListbox(parent)
64 self.instance.setContent(self.l)
65 self.instance.setItemHeight(75)
68 self.instance.setContent(None)
72 # this lists our root service, then building a
77 serviceHandler = eServiceCenterPtr()
78 eServiceCenter.getInstance(serviceHandler)
79 list = iListableServicePtr()
81 if serviceHandler.list(root, list):
82 raise "listing of movies failed"
86 s = eServiceReference()
95 self.list.append(MovieListEntry(ref, serviceHandler))