diff options
| author | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2007-03-24 00:49:20 +0000 |
|---|---|---|
| committer | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2007-03-24 00:49:20 +0000 |
| commit | d1e450f95a9b79b144a00dcf0f9356ff6cb9bfb2 (patch) | |
| tree | 85131a89500ccc60f343732e6727f00df907bc17 /lib/python/Components/Converter/RdsInfo.py | |
| parent | 058d38ca9bcfe94c5c551eac231f808330af3581 (diff) | |
| download | enigma2-d1e450f95a9b79b144a00dcf0f9356ff6cb9bfb2.tar.gz enigma2-d1e450f95a9b79b144a00dcf0f9356ff6cb9bfb2.zip | |
add a radiomode background picture (mvi file.. changable in
/etc/enigma2/config ... config.misc.radiopic = /bla/blubber.mvi
add support for radio text plus,
add rass (radio screen show) support (yes used by SWR3, cont.ra and DASDING)
thanks to seddi for some piece of code
for better single iframe support its recommend to update in
dreambox-dvb-modules.bb CVSDATE for dm7025 to 20070323
Diffstat (limited to 'lib/python/Components/Converter/RdsInfo.py')
| -rw-r--r-- | lib/python/Components/Converter/RdsInfo.py | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/lib/python/Components/Converter/RdsInfo.py b/lib/python/Components/Converter/RdsInfo.py new file mode 100644 index 00000000..3a7b2be3 --- /dev/null +++ b/lib/python/Components/Converter/RdsInfo.py @@ -0,0 +1,53 @@ +from enigma import iRdsDecoder, iPlayableService +from Components.Converter.Converter import Converter +from Components.Element import cached + +class RdsInfo(Converter, object): + RASS_INTERACTIVE_AVAILABLE = 0 + RTP_TEXT_CHANGED = 1 + RADIO_TEXT_CHANGED = 2 + + def __init__(self, type): + Converter.__init__(self, type) + self.type = { + "RadioText": self.RADIO_TEXT_CHANGED, + "RtpText": self.RTP_TEXT_CHANGED, + "RasInteractiveAvailable": self.RASS_INTERACTIVE_AVAILABLE + }[type] + + self.interesting_events = { + self.RADIO_TEXT_CHANGED: [iPlayableService.evUpdatedRadioText], + self.RTP_TEXT_CHANGED: [iPlayableService.evUpdatedRtpText], + self.RASS_INTERACTIVE_AVAILABLE: [iPlayableService.evUpdatedRassInteractivePicMask] + }[self.type] + + @cached + def getText(self): + decoder = self.source.decoder + text = "" + if decoder: + if self.type == self.RADIO_TEXT_CHANGED: + text = decoder.getText(iRdsDecoder.RadioText) + elif self.type == self.RTP_TEXT_CHANGED: + text = decoder.getText(iRdsDecoder.RtpText) + else: + print "unknown RdsInfo Converter type", self.type + return text + + text = property(getText) + + @cached + def getBoolean(self): + decoder = self.source.decoder + if self.type == self.RASS_INTERACTIVE_AVAILABLE: + mask = decoder and decoder.getRassInteractiveMask() + return (mask and mask[0] & 1 and True) or False + elif self.type == self.RADIO_TEXT_CHANGED: + return (len(decoder.getText(iRdsDecoder.RadioText)) and True) or False + elif self.type == self.RTP_TEXT_CHANGED: + return (len(decoder.getText(iRdsDecoder.RtpText)) and True) or False + boolean = property(getBoolean) + + def changed(self, what): + if what[0] != self.CHANGED_SPECIFIC or what[1] in self.interesting_events: + Converter.changed(self, what) |
