def getTransponderInfo(self, info, ref, fmt):
result = ""
if self.tpdata is None:
if ref:
self.tpdata = ref and info.getInfoObject(ref, iServiceInformation.sTransponderData)
else:
self.tpdata = info.getInfoObject(iServiceInformation.sTransponderData)
if not isinstance(self.tpdata, dict):
self.tpdata = None
return result
if self.isStream:
type = 'IP-TV'
else:
type = self.tpdata.get('tuner_type', '')
if not fmt or fmt == 'T':
if type == 'DVB-C':
fmt = ["t ","F ","Y ","i ","f ","M"] #(type frequency symbol_rate inversion fec modulation)
elif type == 'DVB-T':
if ref:
fmt = ["O ","F ","h ","m ","g ","c"] #(orbital_position code_rate_hp transmission_mode guard_interval constellation)
else:
fmt = ["t ","F ","h ","m ","g ","c"] #(type frequency code_rate_hp transmission_mode guard_interval constellation)
elif type == 'IP-TV':
return _("Streaming")
else:
fmt = ["O ","F","p ","Y ","f"] #(orbital_position frequency polarization symbol_rate fec)
for line in fmt:
f = line[:1]
if f == 't': # %t - tuner_type (dvb-s/s2/c/t)
if type == 'DVB-S':
result += _("Satellite")
elif type == 'DVB-C':
result += _("Cable")
elif type == 'DVB-T':
result += _("Terrestrial")
elif type == 'IP-TV':
result += _('Stream-tv')
else:
result += 'N/A'
elif f == 's': # %s - system (dvb-s/s2/c/t)
if type == 'DVB-S':
x = self.tpdata.get('system', 0)
result += x in range(2) and {0:'DVB-S',1:'DVB-S2'}
else:
result += type
elif f == 'F': # %F - frequency (dvb-s/s2/c/t) in KHz
if type in ('DVB-S','DVB-C','DVB-T'):
result += '%d'%(self.tpdata.get('frequency', 0) / 1000)
elif f == 'f': # %f - fec_inner (dvb-s/s2/c/t)
if type in ('DVB-S','DVB-C'):
x = self.tpdata.get('fec_inner', 15)
result += x in range(10)+[15] and {0:'Auto',1:'1/2',2:'2/3',3:'3/4',4:'5/6',5:'7/8',6:'8/9',7:'3/5',8:'4/5',9:'9/10',15:'None'}
elif type == 'DVB-T':
x = self.tpdata.get('code_rate_lp', 5)
result += x in range(6) and {0:'1/2',1:'2/3',2:'3/4',3:'5/6',4:'7/8',5:'Auto'}
elif f == 'i': # %i - inversion (dvb-s/s2/c/t)
if type in ('DVB-S','DVB-C','DVB-T'):
x = self.tpdata.get('inversion', 2)
result += x in range(3) and {0:'On',1:'Off',2:'Auto'}
elif f == 'O': # %O - orbital_position (dvb-s/s2)
if type == 'DVB-S':
x = self.tpdata.get('orbital_position', 0)
result += x > 1800 and "%d.%d°W"%((3600-x)/10, (3600-x)%10) or "%d.%d°E"%(x/10, x%10)
elif type == 'DVB-T':
result += 'DVB-T'
elif type == 'DVB-C':
result += 'DVB-C'
elif type == 'Iptv':
result += 'Stream'
elif type == '':
result += 'Stream'