From: Andreas Monzner Date: Tue, 10 Oct 2006 19:54:15 +0000 (+0000) Subject: show radio (rds) text when available... feel free to make it nicer X-Git-Tag: 2.6.0~2947 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/b5ca0a1b4676eea8cf2fd9966634cac73bd46e5b show radio (rds) text when available... feel free to make it nicer --- diff --git a/data/fonts/lcd.ttf b/data/fonts/lcd.ttf new file mode 100644 index 00000000..c84a9933 Binary files /dev/null and b/data/fonts/lcd.ttf differ diff --git a/data/skin.xml b/data/skin.xml index c096a5fe..eb690a94 100644 --- a/data/skin.xml +++ b/data/skin.xml @@ -39,8 +39,8 @@ - - + + @@ -61,13 +61,18 @@ - - + + + + Name + + + - - - - + + + + - - - + + + - + SNR - + AGC - + BER - + SNR - + AGC - + BER - + - + IsCrypted - + IsMultichannel - + IsWidescreen - + Name - + WithSeconds - + StartTime Default - + StartTime Default - + Name - + Name - + Remaining InMinutes - + Duration InMinutes - + Progress - + - + - + SubservicesAvailable - + SubservicesAvailable - + - + - + - + diff --git a/data/skin_default.xml b/data/skin_default.xml index 9b1e0b0b..40eb2355 100644 --- a/data/skin_default.xml +++ b/data/skin_default.xml @@ -1,4 +1,8 @@ + + + + @@ -222,7 +226,10 @@ - + + + Name + diff --git a/lib/python/Components/Converter/Makefile.am b/lib/python/Components/Converter/Makefile.am index 8b7d3a2b..e754a683 100644 --- a/lib/python/Components/Converter/Makefile.am +++ b/lib/python/Components/Converter/Makefile.am @@ -3,4 +3,4 @@ installdir = $(LIBDIR)/enigma2/python/Components/Converter install_PYTHON = \ __init__.py ClockToText.py Converter.py EventName.py StaticText.py EventTime.py \ Poll.py RemainingToText.py StringList.py ServiceName.py FrontendInfo.py ServiceInfo.py \ - ConditionalShowHide.py ServicePosition.py ValueRange.py + ConditionalShowHide.py ServicePosition.py ValueRange.py RadioText.py diff --git a/lib/python/Components/Converter/RadioText.py b/lib/python/Components/Converter/RadioText.py new file mode 100644 index 00000000..77ec58ed --- /dev/null +++ b/lib/python/Components/Converter/RadioText.py @@ -0,0 +1,15 @@ +from Components.Converter.Converter import Converter +from Components.Element import cached + +class RadioText(Converter, object): + def __init__(self, type): + Converter.__init__(self, type) + + @cached + def getText(self): + rt = self.source.radiotext + if rt is None: + return "N/A" + return rt + + text = property(getText) diff --git a/lib/python/Components/Sources/Makefile.am b/lib/python/Components/Sources/Makefile.am index a1609840..16513e82 100644 --- a/lib/python/Components/Sources/Makefile.am +++ b/lib/python/Components/Sources/Makefile.am @@ -2,4 +2,4 @@ installdir = $(LIBDIR)/enigma2/python/Components/Sources install_PYTHON = \ __init__.py Clock.py EventInfo.py Source.py MenuList.py CurrentService.py \ - FrontendStatus.py Boolean.py Config.py ServiceList.py + FrontendStatus.py Boolean.py Config.py ServiceList.py 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,)) diff --git a/lib/python/Screens/ChannelSelection.py b/lib/python/Screens/ChannelSelection.py index e0337450..756bd836 100644 --- a/lib/python/Screens/ChannelSelection.py +++ b/lib/python/Screens/ChannelSelection.py @@ -1134,7 +1134,7 @@ class ChannelSelection(ChannelSelectionBase, ChannelSelectionEdit, ChannelSelect self.revertMode = None self.close(None) -from Screens.InfoBarGenerics import InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord +from Screens.InfoBarGenerics import InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarRadioText class RadioInfoBar(Screen, InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord): def __init__(self, session): @@ -1144,7 +1144,7 @@ class RadioInfoBar(Screen, InfoBarEvent, InfoBarServiceName, InfoBarInstantRecor InfoBarInstantRecord.__init__(self) self["CurrentTime"] = Clock() -class ChannelSelectionRadio(ChannelSelectionBase, ChannelSelectionEdit, ChannelSelectionEPG): +class ChannelSelectionRadio(ChannelSelectionBase, ChannelSelectionEdit, ChannelSelectionEPG, InfoBarRadioText): ALLOW_SUSPEND = True @@ -1152,6 +1152,7 @@ class ChannelSelectionRadio(ChannelSelectionBase, ChannelSelectionEdit, ChannelS ChannelSelectionBase.__init__(self, session) ChannelSelectionEdit.__init__(self) ChannelSelectionEPG.__init__(self) + InfoBarRadioText.__init__(self) config.radio = ConfigSubsection(); config.radio.lastservice = ConfigText() diff --git a/lib/python/Screens/InfoBar.py b/lib/python/Screens/InfoBar.py index 41083777..6ee49522 100644 --- a/lib/python/Screens/InfoBar.py +++ b/lib/python/Screens/InfoBar.py @@ -13,7 +13,7 @@ from Components.config import config from Tools.Notifications import AddNotificationWithCallback from Screens.InfoBarGenerics import InfoBarShowHide, \ - InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, \ + InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarRadioText, \ InfoBarEPG, InfoBarEvent, InfoBarServiceName, InfoBarSeek, InfoBarInstantRecord, \ InfoBarAudioSelection, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, \ InfoBarSubserviceSelection, InfoBarTuner, InfoBarShowMovies, InfoBarTimeshift, \ @@ -28,7 +28,7 @@ from enigma import * import time class InfoBar(InfoBarShowHide, - InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, + InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, InfoBarRadioText, InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection, HelpableScreen, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarSubserviceSelection, InfoBarTuner, InfoBarTimeshift, InfoBarSeek, @@ -52,7 +52,7 @@ class InfoBar(InfoBarShowHide, for x in HelpableScreen, \ InfoBarShowHide, \ - InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, \ + InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, InfoBarRadioText, \ InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection, \ InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarSubserviceSelection, \ InfoBarTuner, InfoBarTimeshift, InfoBarSeek, InfoBarSummarySupport, InfoBarTimeshiftState, \ diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py index c6c93d1a..a2d1ec76 100644 --- a/lib/python/Screens/InfoBarGenerics.py +++ b/lib/python/Screens/InfoBarGenerics.py @@ -12,6 +12,7 @@ from Components.ProgressBar import * from Components.ServiceEventTracker import ServiceEventTracker from Components.Sources.CurrentService import CurrentService from Components.Sources.EventInfo import EventInfo +from Components.Sources.RadioText import RadioText from Components.Sources.FrontendStatus import FrontendStatus from Components.Sources.Boolean import Boolean from Components.Sources.Clock import Clock @@ -525,6 +526,11 @@ class InfoBarEvent: self["Event_Now"] = EventInfo(self.session.nav, EventInfo.NOW) self["Event_Next"] = EventInfo(self.session.nav, EventInfo.NEXT) +class InfoBarRadioText: + """provides radio (RDS) text info display""" + def __init__(self): + self["RadioText"] = RadioText(self.session.nav) + class InfoBarServiceName: def __init__(self): self["CurrentService"] = CurrentService(self.session.nav) @@ -1401,7 +1407,6 @@ class InfoBarAudioSelection: self.audioChannel.selectChannel(mode[1]) del self.audioChannel - class InfoBarSubserviceSelection: def __init__(self): self["SubserviceSelectionAction"] = HelpableActionMap(self, "InfobarSubserviceSelectionActions",