From b5ca0a1b4676eea8cf2fd9966634cac73bd46e5b Mon Sep 17 00:00:00 2001 From: Andreas Monzner Date: Tue, 10 Oct 2006 19:54:15 +0000 Subject: show radio (rds) text when available... feel free to make it nicer --- lib/python/Components/Sources/RadioText.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 lib/python/Components/Sources/RadioText.py (limited to 'lib/python/Components/Sources/RadioText.py') diff --git a/lib/python/Components/Sources/RadioText.py b/lib/python/Components/Sources/RadioText.py new file mode 100644 index 00000000..6faad317 --- /dev/null +++ b/lib/python/Components/Sources/RadioText.py @@ -0,0 +1,28 @@ +from Components.PerServiceDisplay import PerServiceBase +from Components.Element import cached +from enigma import iPlayableService +from Source import Source + +class RadioText(PerServiceBase, Source, object): + def __init__(self, navcore): + Source.__init__(self) + PerServiceBase.__init__(self, navcore, + { + iPlayableService.evStart: self.gotEvent, + iPlayableService.evUpdatedRadioText: self.gotEvent, + iPlayableService.evEnd: self.gotEvent + }, with_event=True) + + @cached + def getText(self): + service = self.navcore.getCurrentService() + info = service and service.radioText() + return info and info.getRadioText() + + radiotext = property(getText) + + def gotEvent(self, what): + if what in [iPlayableService.evStart, iPlayableService.evEnd]: + self.changed((self.CHANGED_CLEAR,)) + else: + self.changed((self.CHANGED_ALL,)) -- cgit v1.2.3