-
- Labels = ( ("Name", ServiceReference(self.session.nav.getCurrentlyPlayingServiceReference()).getServiceName()),
- ("Provider", self.getValue(iServiceInformation.sProvider)),
- ("VideoPID", self.getValue(iServiceInformation.sVideoPID)),
- ("AudioPID", self.getValue(iServiceInformation.sAudioPID)),
- ("PCRPID", self.getValue(iServiceInformation.sPCRPID)),
- ("PMTPID", self.getValue(iServiceInformation.sPMTPID)),
- ("TXTPID", self.getValue(iServiceInformation.sTXTPID)),
- ("Videoformat", self.getValue(iServiceInformation.sAspect)),
- ("TSID", self.getValue(iServiceInformation.sTSID)),
- ("ONID", self.getValue(iServiceInformation.sONID)),
- ("SID", self.getValue(iServiceInformation.sSID)),
- ("Namespace", self.getValue(iServiceInformation.sNamespace)))
+ self.feinfo = None
+ else:
+ self.type = TYPE_SERVICE_INFO
+ self["red"] = Label(_("Serviceinfo"))
+ self["green"] = Label(_("PIDs"))
+ self["yellow"] = Label(_("Transponder"))
+ self["blue"] = Label(_("Tuner status"))
+ service = session.nav.getCurrentService()
+ if service is not None:
+ self.info = service.info()
+ self.feinfo = service.frontendInfo()
+ print self.info.getInfoObject(iServiceInformation.sCAIDs);
+ else:
+ self.info = None
+ self.feinfo = None
+
+ tlist = [ ]
+
+ self["infolist"] = ServiceInfoList(tlist)
+ self.onShown.append(self.information)
+
+ def information(self):
+ if self.type == TYPE_SERVICE_INFO:
+ if self.session.nav.getCurrentlyPlayingServiceReference():
+ name = ServiceReference(self.session.nav.getCurrentlyPlayingServiceReference()).getServiceName()
+ refstr = self.session.nav.getCurrentlyPlayingServiceReference().toString()
+ else:
+ name = "N/A"
+ refstr = "N/A"
+ aspect = self.getServiceInfoValue(iServiceInformation.sAspect)
+ if aspect in ( 1, 2, 5, 6, 9, 0xA, 0xD, 0xE ):
+ aspect = "4:3"
+ else:
+ aspect = "16:9"
+ width = self.info and self.info.getInfo(iServiceInformation.sVideoWidth) or -1
+ height = self.info and self.info.getInfo(iServiceInformation.sVideoHeight) or -1
+ if width != -1 and height != -1:
+ Labels = ( ("Name", name, TYPE_TEXT),
+ ("Provider", self.getServiceInfoValue(iServiceInformation.sProvider), TYPE_TEXT),
+ ("Videoformat", aspect, TYPE_TEXT),
+ ("Videosize", "%dx%d" %(width, height), TYPE_TEXT),
+ ("Namespace", self.getServiceInfoValue(iServiceInformation.sNamespace), TYPE_VALUE_HEX, 8),
+ ("Service Reference", refstr, TYPE_TEXT))
+ else:
+ Labels = ( ("Name", name, TYPE_TEXT),
+ ("Provider", self.getServiceInfoValue(iServiceInformation.sProvider), TYPE_TEXT),
+ ("Videoformat", aspect, TYPE_TEXT),
+ ("Namespace", self.getServiceInfoValue(iServiceInformation.sNamespace), TYPE_VALUE_HEX, 8),
+ ("Service Reference", refstr, TYPE_TEXT))
+ self.fillList(Labels)
+ else:
+ if self.transponder_info:
+ tp_info = ConvertToHumanReadable(self.transponder_info)
+ conv = { "tuner_type" : _("Transponder Type"),
+ "system" : _("System"),
+ "modulation" : _("Modulation"),
+ "orbital_position" : _("Orbital Position"),
+ "frequency" : _("Frequency"),
+ "symbol_rate" : _("Symbolrate"),
+ "bandwidth" : _("Bandwidth"),
+ "polarization" : _("Polarization"),
+ "inversion" : _("Inversion"),
+ "pilot" : _("Pilot"),
+ "rolloff" : _("Rolloff"),
+ "fec_inner" : _("FEC"),
+ "code_rate_lp" : _("Coderate LP"),
+ "code_rate_hp" : _("Coderate HP"),
+ "constellation" : _("Constellation"),
+ "transmission_mode": _("Transmission Mode"),
+ "guard_interval" : _("Guard Interval"),
+ "hierarchy_information": _("Hierarchy Information") }
+ Labels = [(conv[i], tp_info[i], TYPE_VALUE_DEC) for i in tp_info.keys()]
+ self.fillList(Labels)
+
+ def pids(self):
+ if self.type == TYPE_SERVICE_INFO:
+ Labels = ( ("VideoPID", self.getServiceInfoValue(iServiceInformation.sVideoPID), TYPE_VALUE_HEX_DEC, 4),
+ ("AudioPID", self.getServiceInfoValue(iServiceInformation.sAudioPID), TYPE_VALUE_HEX_DEC, 4),
+ ("PCRPID", self.getServiceInfoValue(iServiceInformation.sPCRPID), TYPE_VALUE_HEX_DEC, 4),
+ ("PMTPID", self.getServiceInfoValue(iServiceInformation.sPMTPID), TYPE_VALUE_HEX_DEC, 4),
+ ("TXTPID", self.getServiceInfoValue(iServiceInformation.sTXTPID), TYPE_VALUE_HEX_DEC, 4),
+ ("TSID", self.getServiceInfoValue(iServiceInformation.sTSID), TYPE_VALUE_HEX_DEC, 4),
+ ("ONID", self.getServiceInfoValue(iServiceInformation.sONID), TYPE_VALUE_HEX_DEC, 4),
+ ("SID", self.getServiceInfoValue(iServiceInformation.sSID), TYPE_VALUE_HEX_DEC, 4))
+ self.fillList(Labels)
+
+ def showFrontendData(self, real):
+ if self.type == TYPE_SERVICE_INFO:
+ frontendData = self.feinfo and self.feinfo.getAll(real)
+ Labels = self.getFEData(frontendData)
+ self.fillList(Labels)