X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/67b53c1cb06988394c35a6e965c99b72b67fe1be..15171632716c0734526eefc55e3d0601be177b45:/lib/python/Screens/ServiceInfo.py diff --git a/lib/python/Screens/ServiceInfo.py b/lib/python/Screens/ServiceInfo.py index 01cfc61a..4606f883 100644 --- a/lib/python/Screens/ServiceInfo.py +++ b/lib/python/Screens/ServiceInfo.py @@ -14,6 +14,9 @@ TYPE_VALUE_DEC = 2 TYPE_VALUE_HEX_DEC = 3 TYPE_SLIDER = 4 +def to_unsigned(x): + return x & 0xFFFFFFFF + def ServiceInfoListEntry(a, b, valueType=TYPE_TEXT, param=4): res = [ ] @@ -23,11 +26,11 @@ def ServiceInfoListEntry(a, b, valueType=TYPE_TEXT, param=4): print "b:", b if type(b) is not str: if valueType == TYPE_VALUE_HEX: - b = ("0x%0" + str(param) + "x") % b + b = ("0x%0" + str(param) + "x") % to_unsigned(b) elif valueType == TYPE_VALUE_DEC: b = str(b) elif valueType == TYPE_VALUE_HEX_DEC: - b = ("0x%0" + str(param) + "x (%dd)") % (b, b) + b = ("0x%0" + str(param) + "x (%dd)") % (to_unsigned(b), b) else: b = str(b) @@ -101,8 +104,10 @@ class ServiceInfo(Screen): 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" @@ -115,26 +120,29 @@ class ServiceInfo(Screen): ("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)) + ("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)) + ("Namespace", self.getServiceInfoValue(iServiceInformation.sNamespace), TYPE_VALUE_HEX, 8), + ("Service Reference", refstr, TYPE_TEXT)) self.fillList(Labels) else: if self.transponder_info: conv = { "type" : _("Transponder Type"), + "system" : _("System"), + "modulation" : _("Modulation"), + "orbital position" : _("Orbital Position"), "frequency" : _("Frequency"), "symbolrate" : _("Symbolrate"), - "orbital position" : _("Orbital Position"), - "inversion" : _("Inversion"), - "fec inner" : _("FEC"), - "modulation" : _("Modulation"), + "bandwidth" : _("Bandwidth"), "polarization" : _("Polarization"), + "inversion" : _("Inversion"), + "pilot" : _("Pilot"), "roll off" : _("Rolloff"), - "system" : _("System"), - "bandwidth" : _("Bandwidth"), + "fec inner" : _("FEC"), "code rate lp" : _("Coderate LP"), "code rate hp" : _("Coderate HP"), "constellation" : _("Constellation"), @@ -183,7 +191,9 @@ class ServiceInfo(Screen): ("Symbolrate", frontendData["symbol_rate"], TYPE_VALUE_DEC), ("Polarization", frontendData["polarization"], TYPE_TEXT), ("Inversion", frontendData["inversion"], TYPE_TEXT), - ("FEC inner", frontendData["fec_inner"], TYPE_TEXT)) + ("FEC inner", frontendData["fec_inner"], TYPE_TEXT), + ("Pilot", frontendData.get("pilot", None), TYPE_TEXT), + ("Rolloff", frontendData.get("rolloff", None), TYPE_TEXT)) elif frontendData["tuner_type"] == "DVB-C": return (("NIM", ['A', 'B', 'C', 'D'][frontendData["tuner_number"]], TYPE_TEXT), ("Type", frontendData["tuner_type"], TYPE_TEXT), @@ -210,6 +220,8 @@ class ServiceInfo(Screen): tlist = [ ] for item in Labels: + if item[1] is None: + continue; value = item[1] if len(item) < 4: tlist.append(ServiceInfoListEntry(item[0]+":", value, item[2]))