1 from enigma import iRdsDecoder, iPlayableService
2 from Components.Converter.Converter import Converter
3 from Components.Element import cached
5 class RdsInfo(Converter, object):
6 RASS_INTERACTIVE_AVAILABLE = 0
10 def __init__(self, type):
11 Converter.__init__(self, type)
13 "RadioText": self.RADIO_TEXT_CHANGED,
14 "RtpText": self.RTP_TEXT_CHANGED,
15 "RasInteractiveAvailable": self.RASS_INTERACTIVE_AVAILABLE
18 self.interesting_events = {
19 self.RADIO_TEXT_CHANGED: [iPlayableService.evUpdatedRadioText],
20 self.RTP_TEXT_CHANGED: [iPlayableService.evUpdatedRtpText],
21 self.RASS_INTERACTIVE_AVAILABLE: [iPlayableService.evUpdatedRassInteractivePicMask]
26 decoder = self.source.decoder
29 if self.type == self.RADIO_TEXT_CHANGED:
30 text = decoder.getText(iRdsDecoder.RadioText)
31 elif self.type == self.RTP_TEXT_CHANGED:
32 text = decoder.getText(iRdsDecoder.RtpText)
34 print "unknown RdsInfo Converter type", self.type
37 text = property(getText)
41 decoder = self.source.decoder
42 if self.type == self.RASS_INTERACTIVE_AVAILABLE:
43 mask = decoder and decoder.getRassInteractiveMask()
44 return (mask and mask[0] & 1 and True) or False
45 elif self.type == self.RADIO_TEXT_CHANGED:
46 return (len(decoder.getText(iRdsDecoder.RadioText)) and True) or False
47 elif self.type == self.RTP_TEXT_CHANGED:
48 return (len(decoder.getText(iRdsDecoder.RtpText)) and True) or False
49 boolean = property(getBoolean)
51 def changed(self, what):
52 if what[0] != self.CHANGED_SPECIFIC or what[1] in self.interesting_events:
53 Converter.changed(self, what)