aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>2006-10-10 19:54:15 +0000
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>2006-10-10 19:54:15 +0000
commitb5ca0a1b4676eea8cf2fd9966634cac73bd46e5b (patch)
tree2d00aed56854f146d065b812f209732fbf97a4bf
parent870022b905170f39bc9d26b38c5288ce45e69103 (diff)
downloadenigma2-b5ca0a1b4676eea8cf2fd9966634cac73bd46e5b.tar.gz
enigma2-b5ca0a1b4676eea8cf2fd9966634cac73bd46e5b.zip
show radio (rds) text when available... feel free to make it nicer
-rw-r--r--data/fonts/lcd.ttfbin0 -> 72680 bytes
-rw-r--r--data/skin.xml81
-rw-r--r--data/skin_default.xml9
-rw-r--r--lib/python/Components/Converter/Makefile.am2
-rw-r--r--lib/python/Components/Converter/RadioText.py15
-rw-r--r--lib/python/Components/Sources/Makefile.am2
-rw-r--r--lib/python/Components/Sources/RadioText.py28
-rw-r--r--lib/python/Screens/ChannelSelection.py5
-rw-r--r--lib/python/Screens/InfoBar.py6
-rw-r--r--lib/python/Screens/InfoBarGenerics.py7
10 files changed, 108 insertions, 47 deletions
diff --git a/data/fonts/lcd.ttf b/data/fonts/lcd.ttf
new file mode 100644
index 00000000..c84a9933
--- /dev/null
+++ b/data/fonts/lcd.ttf
Binary files 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 @@
<pixmap pos="bpBottomRight" filename="b_w_br.png" />
</borderset>
</windowstyle>
-
- <!-- this is for LCD -->
+
+ <!-- this is for LCD -->
<windowstyle type="skinned" id="1">
<color name="Background" color="#000000" />
<color name="LabelForeground" color="#ffffff" />
@@ -61,13 +61,18 @@
<font filename="ae_AlMateen.ttf" name="Replacement" scale="90" replacement="1" />
</fonts>
- <screen name="InfoBar" flags="wfNoBorder" position="0,380" size="720,148" title="InfoBar">
- <ePixmap position="0,0" zPosition="-1" size="720,148" pixmap="info-bg.png" />
+ <screen name="InfoBar" flags="wfNoBorder" position="0,330" size="720,198" title="InfoBar" backgroundColor="transparent" >
+
+ <widget source="RadioText" render="Label" position="50,0" size="620,50" font="LCD;25" backgroundColor="transparent">
+ <convert type="RadioText">Name</convert>
+ </widget>
+
+ <ePixmap position="0,50" zPosition="-1" size="720,148" pixmap="info-bg.png" />
<!-- not used in this skin yet -->
- <widget name="NimA" position="0,0" size="0,0" />
- <widget name="NimB" position="0,0" size="0,0" />
- <widget name="NimA_Active" position="0,0" size="0,0" />
- <widget name="NimB_Active" position="0,0" size="0,0" />
+ <widget name="NimA" position="0,50" size="0,0" />
+ <widget name="NimB" position="0,50" size="0,0" />
+ <widget name="NimA_Active" position="0,50" size="0,0" />
+ <widget name="NimB_Active" position="0,50" size="0,0" />
<!-- 'teletext available'
<widget source="CurrentService" render="Pixmap" pixmap="format.png" position="613,40" size="28,15">
@@ -77,113 +82,113 @@
-->
<!-- ............................................................................. -->
- <eLabel text="SNR:" position="195,0" size="40,22" font="Regular;15" transparent="1" />
- <eLabel text="AGC:" position="275,0" size="40,22" font="Regular;15" transparent="1" />
- <eLabel text="BER:" position="355,0" size="40,22" font="Regular;15" transparent="1" />
+ <eLabel text="SNR:" position="195,50" size="40,22" font="Regular;15" transparent="1" />
+ <eLabel text="AGC:" position="275,50" size="40,22" font="Regular;15" transparent="1" />
+ <eLabel text="BER:" position="355,50" size="40,22" font="Regular;15" transparent="1" />
- <widget source="FrontendStatus" render="Label" position="232,0" size="40,22" font="Regular;15" transparent="1" >
+ <widget source="FrontendStatus" render="Label" position="232,50" size="40,22" font="Regular;15" transparent="1" >
<convert type="FrontendInfo">SNR</convert>
</widget>
- <widget source="FrontendStatus" render="Label" position="314,0" size="40,22" font="Regular;15" transparent="1" >
+ <widget source="FrontendStatus" render="Label" position="314,50" size="40,22" font="Regular;15" transparent="1" >
<convert type="FrontendInfo">AGC</convert>
</widget>
- <widget source="FrontendStatus" render="Label" position="392,0" size="53,22" font="Regular;15" transparent="1" >
+ <widget source="FrontendStatus" render="Label" position="392,50" size="53,22" font="Regular;15" transparent="1" >
<convert type="FrontendInfo">BER</convert>
</widget>
- <widget source="FrontendStatus" render="Progress" position="447,1" size="88,6" pixmap="rtgbar.png" >
+ <widget source="FrontendStatus" render="Progress" position="447,51" size="88,6" pixmap="rtgbar.png" >
<convert type="FrontendInfo">SNR</convert>
</widget>
- <widget source="FrontendStatus" render="Progress" position="447,8" size="88,6" pixmap="rtgbar.png" >
+ <widget source="FrontendStatus" render="Progress" position="447,58" size="88,6" pixmap="rtgbar.png" >
<convert type="FrontendInfo">AGC</convert>
</widget>
- <widget source="FrontendStatus" render="Progress" position="447,15" size="88,6" >
+ <widget source="FrontendStatus" render="Progress" position="447,65" size="88,6" >
<convert type="FrontendInfo">BER</convert>
</widget>
- <widget name="BlinkingPoint" pixmap="record.png" position="430,31" zPosition="2" size="58,25" alphatest="on" />
+ <widget name="BlinkingPoint" pixmap="record.png" position="430,81" zPosition="2" size="58,25" alphatest="on" />
<!-- show 'is crypted' icon when service is crypted. -->
- <widget source="CurrentService" render="Pixmap" pixmap="crypt.png" position="570,40" size="12,15" >
+ <widget source="CurrentService" render="Pixmap" pixmap="crypt.png" position="570,90" size="12,15" >
<convert type="ServiceInfo">IsCrypted</convert>
<convert type="ConditionalShowHide" />
</widget>
<!-- show 'multichannel' icon when service has multichannel
audio. -->
- <widget source="CurrentService" render="Pixmap" pixmap="dolby.png" position="585,40" size="25,15">
+ <widget source="CurrentService" render="Pixmap" pixmap="dolby.png" position="585,90" size="25,15">
<convert type="ServiceInfo">IsMultichannel</convert>
<convert type="ConditionalShowHide" />
</widget>
- <widget source="CurrentService" render="Pixmap" pixmap="format.png" position="613,40" size="28,15">
+ <widget source="CurrentService" render="Pixmap" pixmap="format.png" position="613,90" size="28,15">
<convert type="ServiceInfo">IsWidescreen</convert>
<convert type="ConditionalShowHide" />
</widget>
- <widget source="CurrentService" render="Label" position="69,26" size="427,34" font="Regular;22" backgroundColor="#101258" >
+ <widget source="CurrentService" render="Label" position="69,76" size="427,34" font="Regular;22" backgroundColor="#101258" >
<convert type="ServiceName">Name</convert>
<!-- <convert type="ServiceName">Provider</convert> -->
</widget>
- <widget source="CurrentTime" render="Label" position="575,10" size="90,30" backgroundColor="dark" font="Regular;19" >
+ <widget source="CurrentTime" render="Label" position="575,60" size="90,30" backgroundColor="dark" font="Regular;19" >
<convert type="ClockToText">WithSeconds</convert>
</widget>
- <widget source="Event_Now" render="Label" position="210,68" size="60,22" font="Regular;20" backgroundColor="dark">
+ <widget source="Event_Now" render="Label" position="210,118" size="60,22" font="Regular;20" backgroundColor="dark">
<convert type="EventTime">StartTime</convert>
<convert type="ClockToText">Default</convert>
</widget>
- <widget source="Event_Next" render="Label" position="210,98" size="60,22" font="Regular;20" backgroundColor="dark">
+ <widget source="Event_Next" render="Label" position="210,148" size="60,22" font="Regular;20" backgroundColor="dark">
<convert type="EventTime">StartTime</convert>
<convert type="ClockToText">Default</convert>
</widget>
- <widget source="Event_Now" render="Label" position="273,68" size="282,22" font="Regular;20" backgroundColor="dark">
+ <widget source="Event_Now" render="Label" position="273,118" size="282,22" font="Regular;20" backgroundColor="dark">
<convert type="EventName">Name</convert>
</widget>
- <widget source="Event_Next" render="Label" position="273,98" size="282,22" font="Regular;20" backgroundColor="dark">
+ <widget source="Event_Next" render="Label" position="273,148" size="282,22" font="Regular;20" backgroundColor="dark">
<convert type="EventName">Name</convert>
</widget>
- <widget source="Event_Now" render="Label" position="555,68" size="100,26" font="Regular;22" backgroundColor="dark" halign="right">
+ <widget source="Event_Now" render="Label" position="555,118" size="100,26" font="Regular;22" backgroundColor="dark" halign="right">
<convert type="EventTime">Remaining</convert>
<convert type="RemainingToText">InMinutes</convert>
</widget>
- <widget source="Event_Next" render="Label" position="555,98" size="100,26" font="Regular;22" backgroundColor="dark" halign="right">
+ <widget source="Event_Next" render="Label" position="555,148" size="100,26" font="Regular;22" backgroundColor="dark" halign="right">
<convert type="EventTime">Duration</convert>
<convert type="ClockToText">InMinutes</convert>
</widget>
- <widget source="Event_Now" render="Progress" position="304,60" size="121,8" zPosition="1">
+ <widget source="Event_Now" render="Progress" position="304,110" size="121,8" zPosition="1">
<convert type="EventTime">Progress</convert>
</widget>
<!-- red button: is recording possible? -->
- <widget source="RecordingPossible" render="Pixmap" pixmap="button_red.png" position="210,132" size="27,12" >
+ <widget source="RecordingPossible" render="Pixmap" pixmap="button_red.png" position="210,182" size="27,12" >
<convert type="ConditionalShowHide" />
</widget>
- <widget source="RecordingPossible" render="FixedLabel" text="Record" position="240,130" size="85,22" font="Regular;14" backgroundColor="blue" transparent="1">
+ <widget source="RecordingPossible" render="FixedLabel" text="Record" position="240,180" size="85,22" font="Regular;14" backgroundColor="blue" transparent="1">
<convert type="ConditionalShowHide" />
</widget>
- <widget source="CurrentService" render="Pixmap" pixmap="button_green.png" position="320,132" size="27,12" >
+ <widget source="CurrentService" render="Pixmap" pixmap="button_green.png" position="320,182" size="27,12" >
<convert type="ServiceInfo">SubservicesAvailable</convert>
<convert type="ConditionalShowHide" />
</widget>
- <widget source="CurrentService" render="FixedLabel" text="Subservices" position="350,130" size="85,22" font="Regular;14" backgroundColor="blue" transparent="1" >
+ <widget source="CurrentService" render="FixedLabel" text="Subservices" position="350,180" size="85,22" font="Regular;14" backgroundColor="blue" transparent="1" >
<convert type="ServiceInfo">SubservicesAvailable</convert>
<convert type="ConditionalShowHide" />
</widget>
- <widget source="TimeshiftPossible" render="Pixmap" pixmap="button_yellow.png" position="430,132" size="27,12" >
+ <widget source="TimeshiftPossible" render="Pixmap" pixmap="button_yellow.png" position="430,182" size="27,12" >
<convert type="ConditionalShowHide" />
</widget>
- <widget source="TimeshiftPossible" render="FixedLabel" text="Timeshift" position="460,130" size="85,22" font="Regular;14" backgroundColor="blue" transparent="1" >
+ <widget source="TimeshiftPossible" render="FixedLabel" text="Timeshift" position="460,180" size="85,22" font="Regular;14" backgroundColor="blue" transparent="1" >
<convert type="ConditionalShowHide" />
</widget>
- <widget source="ExtensionsAvailable" render="Pixmap" pixmap="button_blue.png" position="540,132" size="27,12" >
+ <widget source="ExtensionsAvailable" render="Pixmap" pixmap="button_blue.png" position="540,182" size="27,12" >
<convert type="ConditionalShowHide" />
</widget>
- <widget source="ExtensionsAvailable" render="FixedLabel" text="Extensions" position="570,130" size="95,22" font="Regular;14" backgroundColor="blue" transparent="1" >
+ <widget source="ExtensionsAvailable" render="FixedLabel" text="Extensions" position="570,180" size="95,22" font="Regular;14" backgroundColor="blue" transparent="1" >
<convert type="ConditionalShowHide" />
</widget>
</screen>
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 @@
<skin>
+ <fonts>
+ <font filename="lcd.ttf" name="LCD" scale="100" />
+ </fonts>
+
<screen name="Standby" flags="wfNoBorder" position="0,0" size="720,576" title="Standby">
</screen>
<screen name="Menu" position="210,150" size="300,265" title="Main menu">
@@ -222,7 +226,10 @@
<widget name="key_green" position="140,0" size="140,40" backgroundColor="green" font="Regular;21" />
<widget name="key_yellow" position="280,0" size="140,40" backgroundColor="yellow" font="Regular;21" />
<widget name="key_blue" position="420,0" size="140,40" backgroundColor="blue" font="Regular;21" />
- <widget name="list" position="0,45" size="560,252" scrollbarMode="showOnDemand" />
+ <widget name="list" position="0,45" size="560,196" scrollbarMode="showOnDemand" />
+ <widget source="RadioText" render="Label" position="0,241" size="560,66" font="LCD;25" >
+ <convert type="RadioText">Name</convert>
+ </widget>
</screen>
<screen name="RadioInfoBar" position="90,420" size="560,105" zPosition="-1">
<widget source="CurrentService" render="Label" position="0,0" size="390,26" font="Regular;22" backgroundColor="dark" >
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",