<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" />
<!-- not used in this skin yet -->
- <widget name="CurrentProvider" position="0,0" size="0,0" />
- <widget name="CurrentDate" position="0,0" size="0,0" />
<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="TextActive" position="0,0" size="0,0" />
+
+<!-- 'teletext available'
+ <widget source="CurrentService" render="Pixmap" pixmap="format.png" position="613,40" size="28,15">
+ <convert type="ServiceInfo">TeletextAvailable</convert>
+ <convert type="ConditionalShowHide" />
+ </widget>
+-->
+
<!-- ............................................................................. -->
- <widget name="snr" text="SNR:" position="195,0" size="40,22" font="Regular;15" transparent="1" />
- <widget name="agc" text="AGC:" position="275,0" size="40,22" font="Regular;15" transparent="1" />
- <widget name="ber" text="BER:" position="355,0" size="40,22" font="Regular;15" transparent="1" />
- <widget name="snr_percent" position="232,0" size="40,22" font="Regular;15" transparent="1" />
- <widget name="agc_percent" position="314,0" size="40,22" font="Regular;15" transparent="1" />
- <widget name="ber_count" position="392,0" size="53,22" font="Regular;15" transparent="1" />
- <widget name="snr_progress" position="447,1" size="88,6" pixmap="rtgbar.png" />
- <widget name="agc_progress" position="447,8" size="88,6" pixmap="rtgbar.png" />
- <widget name="ber_progress" position="447,15" size="88,6" />
+ <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" />
+
+ <widget source="FrontendStatus" render="Label" position="232,0" 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" >
+ <convert type="FrontendInfo">AGC</convert>
+ </widget>
+ <widget source="FrontendStatus" render="Label" position="392,0" 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" >
+ <convert type="FrontendInfo">SNR</convert>
+ </widget>
+ <widget source="FrontendStatus" render="Progress" position="447,8" size="88,6" pixmap="rtgbar.png" >
+ <convert type="FrontendInfo">AGC</convert>
+ </widget>
+ <widget source="FrontendStatus" render="Progress" position="447,15" 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="CryptActive" pixmap="crypt.png" position="570,40" size="12,15" />
- <widget name="DolbyActive" pixmap="dolby.png" position="585,40" size="25,15" />
- <widget name="FormatActive" pixmap="format.png" position="613,40" size="28,15" />
+
+ <!-- show 'is crypted' icon when service is crypted. -->
+ <widget source="CurrentService" render="Pixmap" pixmap="crypt.png" position="570,40" 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">
+ <convert type="ServiceInfo">IsMultichannel</convert>
+ <convert type="ConditionalShowHide" />
+ </widget>
+
+ <widget source="CurrentService" render="Pixmap" pixmap="format.png" position="613,40" size="28,15">
+ <convert type="ServiceInfo">IsWidescreen</convert>
+ <convert type="ConditionalShowHide" />
+ </widget>
- <widget name="ServiceName" position="69,26" size="427,34" font="Regular;22" backgroundColor="#101258" />
- <widget name="CurrentTime" position="575,10" size="90,30" backgroundColor="dark" font="Regular;19" />
- <widget name="Event_Now_StartTime" position="210,68" size="60,22" font="Regular;20" backgroundColor="dark" />
- <widget name="Event_Next_StartTime" position="210,98" size="60,22" font="Regular;20" backgroundColor="dark" />
- <widget name="Event_Now" position="273,68" size="282,22" font="Regular;20" backgroundColor="dark" />
- <widget name="Event_Next" position="273,98" size="282,22" font="Regular;20" backgroundColor="dark" />
- <widget name="Event_Now_Duration" position="555,68" size="100,26" font="Regular;22" backgroundColor="dark" halign="right" />
- <widget name="Event_Next_Duration" position="555,98" size="100,26" font="Regular;22" backgroundColor="dark" halign="right" />
- <widget name="Now_ProgressBar" position="304,60" size="121,8" zPosition="1" />
+ <widget source="CurrentService" render="Label" position="69,26" 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" >
+ <convert type="ClockToText">WithSeconds</convert>
+ </widget>
+
+ <widget source="Event_Now" render="Label" position="210,68" 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">
+ <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">
+ <convert type="EventName">Name</convert>
+ </widget>
+ <widget source="Event_Next" render="Label" position="273,98" 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">
+ <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">
+ <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">
+ <convert type="EventTime">Progress</convert>
+ </widget>
- <widget name="ButtonRed" pixmap="button_red.png" position="210,132" size="27,12" />
- <widget name="ButtonRedText" position="240,130" size="85,22" font="Regular;14" backgroundColor="blue" transparent="1" />
- <widget name="ButtonGreen" pixmap="button_green.png" position="320,132" size="27,12" />
- <widget name="ButtonGreenText" position="350,130" size="85,22" font="Regular;14" backgroundColor="blue" transparent="1" />
- <widget name="ButtonYellow" pixmap="button_yellow.png" position="430,132" size="27,12" />
- <widget name="ButtonYellowText" position="460,130" size="85,22" font="Regular;14" backgroundColor="blue" transparent="1" />
- <widget name="ButtonBlue" pixmap="button_blue.png" position="540,132" size="27,12" />
- <widget name="ButtonBlueText" position="570,130" size="95,22" font="Regular;14" backgroundColor="blue" transparent="1" />
+ <!-- red button: is recording possible? -->
+ <widget source="RecordingPossible" render="Pixmap" pixmap="button_red.png" position="210,132" 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">
+ <convert type="ConditionalShowHide" />
+ </widget>
+
+ <widget source="CurrentService" render="Pixmap" pixmap="button_green.png" position="320,132" 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" >
+ <convert type="ServiceInfo">SubservicesAvailable</convert>
+ <convert type="ConditionalShowHide" />
+ </widget>
+
+ <widget source="TimeshiftPossible" render="Pixmap" pixmap="button_yellow.png" position="430,132" 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" >
+ <convert type="ConditionalShowHide" />
+ </widget>
+ <widget source="ExtensionsAvailable" render="Pixmap" pixmap="button_blue.png" position="540,132" 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" >
+ <convert type="ConditionalShowHide" />
+ </widget>
</screen>
<screen name="MoviePlayer" flags="wfNoBorder" position="0,370" size="720,148" title="InfoBar">
<ePixmap position="0,0" zPosition="-1" size="720,148" pixmap="info-bg.png" />
<ePixmap position="210,83" zPosition="0" size="433,42" pixmap="dvr-buttons.png" />
- <!--<ePixmap position="0,0" zPosition="1" size="720,148" pixmap="movieplayer.png" />
--->
-<!-- <ePixmap position="230,70" zPosition="0" size="40,40" pixmap="rewindbutton.png" />
- <ePixmap position="275,70" zPosition="0" size="40,40" pixmap="playbutton.png" />
- <ePixmap position="320,70" zPosition="0" size="40,40" pixmap="pausebutton.png" />
- <ePixmap position="365,70" zPosition="0" size="40,40" pixmap="forwardbutton.png" />
- <ePixmap position="410,70" zPosition="0" size="40,40" pixmap="stopbutton.png" />
- <ePixmap position="455,70" zPosition="0" size="40,40" pixmap="recordbutton.png" />
--->
-<!-- <widget name="ServiceName" position="250,75" size="427,26" font="Regular;22" backgroundColor="#101258" />
- <widget name="CurrentTime" position="575,85" size="90,30" backgroundColor="dark" font="Regular;19" />
- <eLabel position="70,0" size="300,30" text=".oO Movie Player Oo." font="Regular;20" />
--->
- <widget name="ServiceName" position="69,25" size="427,26" font="Regular;22" backgroundColor="#101258" />
- <widget name="CurrentTime" position="575,10" size="90,25" backgroundColor="dark" font="Regular;19" />
- <!-- fixme -->
- <widget name="ElapsedTime" position="475,60" size="75,20" halign="left" backgroundColor="dark" font="Regular;18" />
- <widget name="PositionGauge" position="247,60" size="225,20" zPosition="2" pointer="position_pointer.png:3,5"/>
+
+ <widget source="CurrentService" render="Label" position="69,25" size="427,26" font="Regular;22" backgroundColor="#101258" >
+ <convert type="ServiceName">Name</convert>
+ </widget>
+
+ <widget source="CurrentService" render="Label" position="575,10" size="90,25" backgroundColor="dark" font="Regular;19" >
+ <convert type="ServicePosition">Position</convert>
+ </widget>
+
+ <widget source="CurrentService" render="Label" position="475,60" size="75,20" halign="left" backgroundColor="dark" font="Regular;18">
+ <convert type="ServicePosition">Remaining</convert>
+ </widget>
+ <widget source="CurrentService" render="PositionGauge" position="247,60" size="225,20" zPosition="2" pointer="position_pointer.png:3,5" >
+ <convert type="ServicePosition">Gauge</convert>
+ </widget>
</screen>
-
</skin>
<screen name="Menu" position="210,150" size="300,265" title="Main menu">
<widget name="title" position="10,10" size="280,35" font="Regular;23" />
<!--<widget name="menu" position="10,55" size="280,150" font="Regular;23" />-->
- <widget name="menu" position="10,55" size="290,205" scrollbarMode="showOnDemand" />
+ <widget source="menu" render="Listbox" position="10,55" size="290,205" scrollbarMode="showOnDemand" >
+ <convert type="StringList" />
+ </widget>
</screen>
<screen name="BouquetSelector" position="210,150" size="300,195" title="Choose bouquet">
<widget name="menu" position="10,10" size="280,175" scrollbarMode="showOnDemand" />
<widget name="list" position="0,45" size="560,252" scrollbarMode="showOnDemand" />
</screen>
<screen name="RadioInfoBar" position="90,420" size="560,105" zPosition="-1">
- <widget name="ServiceName" position="0,0" size="390,26" font="Regular;22" backgroundColor="dark" />
+ <widget source="CurrentService" render="Label" position="0,0" size="390,26" font="Regular;22" backgroundColor="dark" >
+ <convert type="ServiceName">Name</convert>
+ </widget>
<widget name="BlinkingPoint" pixmap="record.png" position="400,0" zPosition="2" size="58,25" />
- <widget name="Clock" position="465,0" size="95,28" font="Regular;22" backgroundColor="dark" />
- <widget name="Now_ProgressBar" position="465,27" size="90,9" zPosition="1" borderWidth="2" />
- <widget name="Event_Now_StartTime" position="0,44" size="60,22" font="Regular;20" backgroundColor="dark" />
- <widget name="Event_Next_StartTime" position="0,74" size="60,22" font="Regular;20" backgroundColor="dark" />
- <widget name="Event_Now" position="80,44" size="380,22" font="Regular;20" backgroundColor="dark" />
- <widget name="Event_Next" position="80,74" size="380,22" font="Regular;20" backgroundColor="dark" />
- <widget name="Event_Now_Duration" position="470,44" size="150,22" font="Regular;20" backgroundColor="dark" />
- <widget name="Event_Next_Duration" position="470,74" size="150,22" font="Regular;20" backgroundColor="dark" />
+ <widget source="CurrentTime" render="Label" position="465,0" size="95,28" font="Regular;22" backgroundColor="dark" >
+ <convert type="ClockToText">WithSeconds</convert>
+ </widget>
+ <widget source="Event_Now" render="Progress" position="465,27" size="90,9" zPosition="1" borderWidth="2" >
+ <convert type="EventTime">Progress</convert>
+ </widget>
+ <widget source="Event_Now" render="Label" position="0,44" 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="0,74" 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="80,44" size="380,22" font="Regular;20" backgroundColor="dark" >
+ <convert type="EventName">Name</convert>
+ </widget>
+ <widget source="Event_Next" render="Label" position="80,74" size="380,22" font="Regular;20" backgroundColor="dark" >
+ <convert type="EventName">Name</convert>
+ </widget>
+
+ <widget source="Event_Now" render="Label" position="470,44" size="150,22" font="Regular;20" backgroundColor="dark" >
+ <convert type="EventTime">Remaining</convert>
+ <convert type="RemainingToText">InMinutes</convert>
+ </widget>
+ <widget source="Event_Next" render="Label" position="470,74" size="150,22" font="Regular;20" backgroundColor="dark" >
+ <convert type="EventTime">Duration</convert>
+ <convert type="ClockToText">InMinutes</convert>
+ </widget>
</screen>
<screen name="SimpleChannelSelection" position="90,98" size="560,417" title="Channel Selection">
<widget name="list" position="00,45" size="560,364" scrollbarMode="showOnDemand" />
<screen name="TimeshiftState" flags="wfNoBorder" position="70,70" size="150,60" backgroundColor="transpBlack" zPosition="2">
<widget name="state" position="0,0" size="150,30" font="Regular;25" halign="center"
backgroundColor="transpBlack" foregroundColor="white" />
- <widget name="timeshift" position="0,30" size="150,30" font="Regular;25" halign="center"
- backgroundColor="transpBlack" foregroundColor="white" />
+ <widget source="CurrentService" render="Label" position="0,30" size="150,30" font="Regular;25" halign="center"
+ backgroundColor="transpBlack" foregroundColor="white" >
+ <convert type="ServicePosition">Remaining</convert>
+ </widget>
</screen>
<screen name="TimeDateInput" position="150,150" size="400,200" title="Time/Date Input">
<widget name="config" position="5,10" size="380,150" />
--- /dev/null
+Skins are now converted to use a "source"/"covert"/"render"-mechanism.
+
+A "source" is a data-source. For example, the infobar has a source called
+"CurrentService", which is the currently displayed service, i.e. the channel
+the user is watching at the moment.
+
+Now, a "current service" has a lot of properties, like
+ - Service Name
+ - service number
+ - flags like "are subservices available?"
+ - playback position, length, ...
+
+Say you want to display the "service name" on screen. Only "renderers" can
+paint on the screen. The most basic renderer is the "Label"-Renderer, which
+can display a text. The "service name" is a text, so we use the
+"Label"-renderer. We also know that "CurrentService" is our source.
+
+But the renderer can only display texts, not "services". It needs something
+to turn a "service" into a "text", i.e. something which extracts the service
+name out of a service.
+
+That's where "converters" come into action. If we want to extract the
+servicename from a service, we need the "ServiceName"-converter. The
+"ServiceName"-converter can not only extract the service *name*, but also
+the provider name (another property of a service), so we have to specify
+what we want.
+
+So our skin data could look like:
+
+<widget source="CurrentService" render="Label" position="69,25"
+ size="427,26" font="Regular;22" backgroundColor="#101258" >
+ <convert type="ServiceName">Name</convert>
+</widget>
+
+The "call chain" consists of
+
+"CurrentService" -> "ServiceName(NAME)" -> "Label"
+
+
+The are the following source types:
+
+Clock - the current time
+EventInfo - the current now&next events
+MenuList - a menu
+CurrentService - the currently playing service
+FrontendStatus - frontend status, like BER, Signal Strength etc.
+Boolean - a usually fixed boolean value, for example "is record possible?"
+
+Actually used sources are defined in a "Screen". That is, a Screen offers
+sources, which you can use inside your skin.
+
+The "Infobar", for example, offers the following sources:
+
+Event_Now
+Event_Next
+CurrentService
+RecordingPossible
+TimeshiftPossible
+ExtensionsAvailable
+Clock
+
+Then there are the following "Converters":
+
+ClockToText - turns a 'Clock' source into a text
+ Parameters:
+ "WithSeconds": "hh:mm:ss"
+ "InMinutes" : "mm min"
+ "Date" : "Wednesday, 07 June, 2006"
+ "Default" : "hh:mm"
+EventName - extracts the event name
+ Parameters:
+ "Description": Extracts the description of the event
+ "ExtendedDescription": Extracts the extended description of the event
+ "Name": extracts the name of the event
+EventTime - extracts the event time
+ Parameters:
+ "EndTime": extracts the end time of the event
+ "Remaining": extracts the remaining time of the event
+ "StartTime": extracts the start time of the event
+ "Duration": extracts the duration of the event
+ "Progress": extracts the progress of the event
+RemainingToText - turns a "remaining"-time into text ("xxx m", or "+xx m")
+ It automatically uses the event length when the remaining time is invalid
+StringList - turns a menulist into a list usable for a "Listbox"-renderer
+FrontendInfo - extracts specific information out of a frontend
+ Parameters:
+ BER
+ SNR
+ AGC
+ LOCK
+
+ You can either use a "Progress" or "Label" renderer, or, with Lock or
+ BER, you can use a ConditionalShowHide to show a "warning symbol" when
+ BER is >0.
+
+ServiceInfo - extracts info out of a service
+ Parameters:
+ HasTeletext
+ IsMultichannel
+ IsCrypted
+ IsWidescreen
+ SubservicesAvailable
+ConditionalShowHide - conditionally show/hide a widgets based on the
+ source's boolean output
+ Optional parameter: "Invert" - inverts the sense, i.e. show when boolean
+ value is false
+ServicePosition - extracts the current service play position out of a
+ service
+ Parameters:
+ "Length"
+ "Position"
+ "Remaining"
+ "Gauge"
+ServiceName
+ Parameters:
+ "Name"
+ "Provider"
+
+Then there are the following renderers:
+Label
+Progress
+Listbox
+Pixmap
+PositionGauge
+FixedLabel
+
+You can also put multiple converters in a row. Each one will pick up the
+output of the last coverter.
+
+Of course you can only connect items which are compatible. Right now you
+have to look at the examples :)
+
+Some more examples:
+
+"SUBSERVICES AVAILABLE DISPLAY"
+===============================
+
+ <widget source="CurrentService" render="Pixmap" pixmap="button_green.png" position="320,132" size="27,12" >
+ <convert type="ServiceInfo">SubservicesAvailable</convert>
+ <convert type="ConditionalShowHide" />
+ </widget>
+
+will display a pixmap whenever the "CurrentService" has
+"SubservicesAvailable".
+
+"CURRENT SERVICE POSITION IN A POSITION GAUGE"
+==============================================
+
+ <widget source="CurrentService" render="PositionGauge" position="247,60" size="225,20" zPosition="2" pointer="position_pointer.png:3,5" >
+ <convert type="ServicePosition">Gauge</convert>
+ </widget>
+
+The "ServicePosition" is extracted from the CurrentService, and the
+PositionGauge picks that information up and displays it on screen.
+
+"START TIME OF CURRENT EVENT"
+=============================
+
+ <widget source="Event_Now" render="Label" position="210,68" size="60,22" font="Regular;20" backgroundColor="dark">
+ <convert type="EventTime">StartTime</convert>
+ <convert type="ClockToText">Default</convert>
+ </widget>
+The StartTime is extracted from the Event_Now (current event), and converted
+into text with the standard (hh:mm) style, then displayed with the
+"Label"-renderer.
from Tools.NumericalTextInput import NumericalTextInput
from Components.NimManager import nimmanager
from Components.ServiceName import ServiceName
-from Components.Clock import Clock
+from Components.Sources.Clock import Clock
from Components.EventInfo import EventInfo
from Components.Input import Input
from Screens.InputBox import InputBox
InfoBarEvent.__init__(self)
InfoBarServiceName.__init__(self)
InfoBarInstantRecord.__init__(self)
- self["Clock"] = Clock()
+ self["CurrentTime"] = Clock()
class ChannelSelectionRadio(ChannelSelectionBase, ChannelSelectionEdit, ChannelSelectionEPG):
def __init__(self, session):
from Screens.Ci import CiHandler
from ServiceReference import ServiceReference
-from Components.Clock import Clock
+from Components.Sources.Clock import Clock
from Components.Date import DateLabel
from Components.ProviderName import ProviderName
from Components.ActionMap import ActionMap, HelpableActionMap
-from Components.ServicePosition import ServicePosition, ServicePositionGauge
from Components.config import currentConfigSelectionElement, config
from Tools.Notifications import AddNotificationWithCallback
self.helpList.append((self["actions"], "InfobarActions", [("showRadio", "Hear Radio...")]))
self["CurrentTime"] = Clock()
- # ServicePosition(self.session.nav, ServicePosition.TYPE_REMAINING)
- self["CurrentDate"] = DateLabel()
- self["CurrentProvider"] = ProviderName(self.session.nav)
def showTv(self):
self.showTvChannelList(True)
InfoBarSummarySupport, InfoBarTeletextPlugin, InfoBarSubtitleSupport:
x.__init__(self)
- self["CurrentTime"] = ServicePosition(self.session.nav, ServicePosition.TYPE_REMAINING)
- self["ElapsedTime"] = ServicePosition(self.session.nav, ServicePosition.TYPE_POSITION)
- self["PositionGauge"] = ServicePositionGauge(self.session.nav)
-
- # TYPE_LENGTH?
-
self.lastservice = self.session.nav.getCurrentlyPlayingServiceReference()
self.session.nav.playService(service)
from Components.ActionMap import NumberActionMap
from Components.BlinkingPixmap import BlinkingPixmapConditional
from Components.Clock import Clock
-from Components.EventInfo import EventInfo, EventInfoProgress
from Components.Harddisk import harddiskmanager
from Components.Input import Input
from Components.Label import *
from Components.PluginComponent import plugins
from Components.ProgressBar import *
from Components.ServiceEventTracker import ServiceEventTracker
-from Components.ServiceName import ServiceName
+from Components.Sources.CurrentService import CurrentService
+from Components.Sources.EventInfo import EventInfo
+from Components.Sources.FrontendStatus import FrontendStatus
+from Components.Sources.Boolean import Boolean
+from Components.TimerList import TimerEntryComponent
from Components.config import config, configElement, ConfigSubsection, configSequence, configElementBoolean, configSelection, configElement_nonSave, getConfigListEntry
from Components.config import configfile, configsequencearg
-from Components.TimerList import TimerEntryComponent
-from Components.TunerInfo import TunerInfo
from EpgSelection import EPGSelection
from Plugins.Plugin import PluginDescriptor
class InfoBarTuner:
"""provides a snr/agc/ber display"""
def __init__(self):
- self["snr"] = Label()
- self["agc"] = Label()
- self["ber"] = Label()
- self["snr_percent"] = TunerInfo(TunerInfo.SNR_PERCENTAGE, servicefkt = self.session.nav.getCurrentService)
- self["agc_percent"] = TunerInfo(TunerInfo.AGC_PERCENTAGE, servicefkt = self.session.nav.getCurrentService)
- self["ber_count"] = TunerInfo(TunerInfo.BER_VALUE, servicefkt = self.session.nav.getCurrentService)
- self["snr_progress"] = TunerInfo(TunerInfo.SNR_BAR, servicefkt = self.session.nav.getCurrentService)
- self["agc_progress"] = TunerInfo(TunerInfo.AGC_BAR, servicefkt = self.session.nav.getCurrentService)
- self["ber_progress"] = TunerInfo(TunerInfo.BER_BAR, servicefkt = self.session.nav.getCurrentService)
- self.timer = eTimer()
- self.timer.timeout.get().append(self.updateTunerInfo)
- self.timer.start(1000)
-
- def updateTunerInfo(self):
- if self.instance.isVisible():
- self["snr_percent"].update()
- self["agc_percent"].update()
- self["ber_count"].update()
- self["snr_progress"].update()
- self["agc_progress"].update()
- self["ber_progress"].update()
+ self["FrontendStatus"] = FrontendStatus(service_source = self.session.nav.getCurrentService)
class InfoBarEvent:
"""provides a current/next event info display"""
def __init__(self):
- self["Event_Now_StartTime"] = EventInfo(self.session.nav, EventInfo.Now_StartTime)
- self["Event_Next_StartTime"] = EventInfo(self.session.nav, EventInfo.Next_StartTime)
-
- self["Event_Now"] = EventInfo(self.session.nav, EventInfo.Now)
- self["Event_Next"] = EventInfo(self.session.nav, EventInfo.Next)
-
- self["Event_Now_Duration"] = EventInfo(self.session.nav, EventInfo.Now_Remaining)
- self["Event_Next_Duration"] = EventInfo(self.session.nav, EventInfo.Next_Duration)
-
- self["Now_ProgressBar"] = EventInfoProgress(self.session.nav, EventInfo.Now)
+ self["Event_Now"] = EventInfo(self.session.nav, EventInfo.NOW)
+ self["Event_Next"] = EventInfo(self.session.nav, EventInfo.NEXT)
class InfoBarServiceName:
def __init__(self):
- self["ServiceName"] = ServiceName(self.session.nav)
+ self["CurrentService"] = CurrentService(self.session.nav)
class InfoBarSeek:
"""handles actions like seeking, pause"""
if not ts.startTimeshift():
import time
self.timeshift_enabled = 1
- self.pvrStateDialog["timeshift"].setRelative(time.time())
+
+ # we remove the "relative time" for now.
+ #self.pvrStateDialog["timeshift"].setRelative(time.time())
# PAUSE.
self.setSeekState(self.SEEK_STATE_PAUSE)
def __init__(self):
self["NimA"] = Pixmap()
self["NimB"] = Pixmap()
- self["TextActive"] = Pixmap()
- self["DolbyActive"] = Pixmap()
- self["CryptActive"] = Pixmap()
- self["FormatActive"] = Pixmap()
self["NimA_Active"] = Pixmap()
self["NimB_Active"] = Pixmap()
- self["ButtonRed"] = PixmapConditional(withTimer = False)
- self["ButtonRed"].setConnect(lambda: harddiskmanager.HDDCount() > 0)
- self.onLayoutFinish.append(self["ButtonRed"].update)
- self["ButtonRedText"] = LabelConditional(text = _("Record"), withTimer = False)
- self["ButtonRedText"].setConnect(lambda: harddiskmanager.HDDCount() > 0)
- self.onLayoutFinish.append(self["ButtonRedText"].update)
-
- self["ButtonGreen"] = Pixmap()
- self["ButtonGreenText"] = Label(_("Subservices"))
-
- self["ButtonYellow"] = PixmapConditional(withTimer = False)
- self["ButtonYellow"].setConnect(lambda: harddiskmanager.HDDCount() > 0)
- self["ButtonYellowText"] = LabelConditional(text = _("Timeshifting"), withTimer = False)
- self["ButtonYellowText"].setConnect(lambda: harddiskmanager.HDDCount() > 0)
- self.onLayoutFinish.append(self["ButtonYellow"].update)
- self.onLayoutFinish.append(self["ButtonYellowText"].update)
-
- self["ButtonBlue"] = PixmapConditional(withTimer = False)
- self["ButtonBlue"].setConnect(lambda: True)
- self["ButtonBlueText"] = LabelConditional(text = _("Extensions"), withTimer = False)
- self["ButtonBlueText"].setConnect(lambda: True)
- self.onLayoutFinish.append(self["ButtonBlue"].update)
- self.onLayoutFinish.append(self["ButtonBlueText"].update)
+ self["RecordingPossible"] = Boolean(fixed=harddiskmanager.HDDCount() > 0)
+ self["TimeshiftPossible"] = self["RecordingPossible"]
+ self["ExtensionsAvailable"] = Boolean(fixed=1)
self.session.nav.event.append(self.gotServiceEvent) # we like to get service events
res_mgr = eDVBResourceManagerPtr()
else:
self["NimB_Active"].hide()
- def hideSubServiceIndication(self):
- self["ButtonGreen"].hide()
- self["ButtonGreenText"].hide()
-
- def showSubServiceIndication(self):
- self["ButtonGreen"].show()
- self["ButtonGreenText"].show()
-
- def checkFormat(self, service):
- info = service.info()
- if info:
- aspect = info.getInfo(iServiceInformation.sAspect)
- if aspect in [ 3, 4, 7, 8, 0xB, 0xC, 0xF, 0x10 ]:
- self["FormatActive"].show()
- return
- self["FormatActive"].hide()
-
- def checkText(self, service):
- info = service.info()
- if info:
- tpid = info.getInfo(iServiceInformation.sTXTPID)
- if tpid != -1:
- self["TextActive"].show()
- return
- self["TextActive"].hide()
-
- def checkSubservices(self, service):
- subservices = service.subServices()
- if subservices and subservices.getNumberOfSubservices() > 0:
- self.showSubServiceIndication()
- else:
- self.hideSubServiceIndication()
-
- def checkDolby(self, service):
- # FIXME
- dolby = False
- audio = service.audioTracks()
- if audio:
- n = audio.getNumberOfTracks()
- for x in range(n):
- i = audio.getTrackInfo(x)
- description = i.getDescription();
- if description.find("AC3") != -1 or description.find("DTS") != -1:
- dolby = True
- break
- if dolby:
- self["DolbyActive"].show()
- else:
- self["DolbyActive"].hide()
-
- def checkCrypted(self, service):
- info = service.info()
- if info and info.getInfo(iServiceInformation.sIsCrypted) > 0:
- self["CryptActive"].show()
- else:
- self["CryptActive"].hide()
-
def checkTunerState(self, service):
info = service.frontendInfo()
feNumber = info and info.getFrontendInfo(iFrontendInformation.frontendNumber)
service = self.session.nav.getCurrentService()
if ev == iPlayableService.evStart:
self.checkTunerState(service)
- elif ev == iPlayableService.evUpdatedEventInfo:
- self.checkSubservices(service)
- self.checkFormat(service)
- elif ev == iPlayableService.evUpdatedInfo:
- self.checkCrypted(service)
- self.checkDolby(service)
- self.checkText(service)
- elif ev == iPlayableService.evEnd:
- self.hideSubServiceIndication()
- self["CryptActive"].hide()
- self["DolbyActive"].hide()
- self["FormatActive"].hide()
- self["TextActive"].hide()
class InfoBarNotifications:
def __init__(self):
def __init__(self, session, parent):
Screen.__init__(self, session)
- self["CurrentService"] = ServiceName(self.session.nav)
+ self["CurrentService"] = CurrentService(self.session.nav)
self["Clock"] = Clock()
class InfoBarSummarySupport:
from Screen import *
-from Components.MenuList import MenuList
+from Components.Sources.MenuList import MenuList
from Components.ActionMap import ActionMap
from Components.Header import Header
from Components.Button import Button
from Screen import Screen
from Components.Label import Label
-from Components.ServicePosition import ServicePosition
+from Components.Sources.CurrentService import CurrentService
from enigma import *
def __init__(self, session):
PVRState.__init__(self, session)
- self["timeshift"] = ServicePosition(self.session.nav, ServicePosition.TYPE_RELATIVE)
+ self["CurrentService"] = CurrentService(self.session.nav)