1 from Components.HTMLComponent import *
2 from Components.GUIComponent import *
3 from Screen import Screen
4 from Components.ActionMap import ActionMap
5 from Components.Label import Label
6 from Components.MenuList import MenuList
7 from ServiceReference import ServiceReference
8 from enigma import eListboxPythonMultiContent, eListbox, gFont, iServiceInformation
12 def ServiceInfoListEntry(a, b):
15 #PyObject *px, *py, *pwidth, *pheight, *pfnt, *pstring, *pflags;
16 res.append((0, 0, 200, 30, 0, RT_HALIGN_LEFT, ""))
17 res.append((0, 0, 150, 25, 0, RT_HALIGN_LEFT, a))
18 res.append((170, 0, 150, 25, 0, RT_HALIGN_LEFT, b))
22 class ServiceInfoList(HTMLComponent, GUIComponent):
23 def __init__(self, source):
24 GUIComponent.__init__(self)
25 self.l = eListboxPythonMultiContent()
27 self.l.setList(self.list)
28 self.l.setFont(0, gFont("Arial", 23))
30 def GUIcreate(self, parent):
31 self.instance = eListbox(parent)
32 self.instance.setContent(self.l)
33 self.instance.setItemHeight(25)
36 self.instance.setContent(None)
39 class ServiceInfo(Screen):
40 def __init__(self, session):
41 Screen.__init__(self, session)
43 self["actions"] = ActionMap(["OkCancelActions"],
49 service = session.nav.getCurrentService()
50 if service is not None:
51 self.info = service.info()
55 Labels = ( ("Name", ServiceReference(self.session.nav.getCurrentlyPlayingServiceReference()).getServiceName()),
56 ("Provider", self.getValue(iServiceInformation.sProvider)),
57 ("VideoPID", self.getValue(iServiceInformation.sVideoPID)),
58 ("AudioPID", self.getValue(iServiceInformation.sAudioPID)),
59 ("PCRPID", self.getValue(iServiceInformation.sPCRPID)),
60 ("PMTPID", self.getValue(iServiceInformation.sPMTPID)),
61 ("TXTPID", self.getValue(iServiceInformation.sTXTPID)),
62 ("Videoformat", self.getValue(iServiceInformation.sAspect)),
63 ("TSID", self.getValue(iServiceInformation.sTSID)),
64 ("ONID", self.getValue(iServiceInformation.sONID)),
65 ("SID", self.getValue(iServiceInformation.sSID)),
66 ("Namespace", self.getValue(iServiceInformation.sNamespace)))
72 tlist.append(ServiceInfoListEntry(item[0]+":", value))
74 self["infolist"] = ServiceInfoList(tlist)
76 def getValue(self, what):
80 v = self.info.getInfo(what)
82 v = self.info.getInfoString(what)
84 if what in [iServiceInformation.sVideoPID,
85 iServiceInformation.sAudioPID, iServiceInformation.sPCRPID, iServiceInformation.sPMTPID,
86 iServiceInformation.sTXTPID, iServiceInformation.sTSID, iServiceInformation.sONID,
87 iServiceInformation.sSID]:
88 v = "0x%04x (%dd)" % (v, v)
89 elif what in [iServiceInformation.sNamespace]: