use Source/Render/Converter stuff for:
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Thu, 1 Nov 2007 23:49:36 +0000 (23:49 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Thu, 1 Nov 2007 23:49:36 +0000 (23:49 +0000)
- forground tuner displaying
- tuners in use displaying
- running record pixmap

data/skin.xml
lib/python/Screens/InfoBarGenerics.py
lib/python/Screens/SessionGlobals.py

index 6c9861a..b86160f 100644 (file)
                        <convert type="ClockToText">Default</convert>
                </widget>
                <!-- tuners in use? -->
-               <widget name="NimA_Active" position="129,6" zPosition="1" size="9,9" pixmap="skin_default/nim_a.png" alphatest="on" />
-               <widget name="NimB_Active" position="129,20" zPosition="1" size="9,9" pixmap="skin_default/nim_b.png" alphatest="on" />
-               <widget name="NimA" position="142,6" zPosition="1" size="8,9" pixmap="skin_default/nim_active.png" alphatest="on" />
-               <widget name="NimB" position="142,20" zPosition="1" size="8,9" pixmap="skin_default/nim_active.png" alphatest="on" />           
+               <!-- DEPRECATED widget name="NimA_Active" position="129,6" zPosition="1" size="9,9" pixmap="skin_default/nim_a.png" alphatest="on" /-->
+               <widget source="session.FrontendInfo" render="Pixmap" position="129,6" zPosition="1" size="9,9" pixmap="skin_default/nim_a.png" alphatest="on" >
+                       <convert type="FrontendInfo">NUMBER</convert>
+                       <convert type="ValueRange">0,0</convert>
+                       <convert type="ConditionalShowHide" />
+               </widget>
+               <!-- DEPRECATED widget name="NimB_Active" position="129,20" zPosition="1" size="9,9" pixmap="skin_default/nim_b.png" alphatest="on" /-->
+               <widget source="session.FrontendInfo" render="Pixmap" position="129,6" zPosition="1" size="9,9" pixmap="skin_default/nim_b.png" alphatest="on" >
+                       <convert type="FrontendInfo">NUMBER</convert>
+                       <convert type="ValueRange">1,1</convert>
+                       <convert type="ConditionalShowHide" />
+               </widget>
+               <!-- DEPRECATED widget name="NimA" position="142,6" zPosition="1" size="8,9" pixmap="skin_default/nim_active.png" alphatest="on" /-->
+               <widget source="session.GlobalInfo" render="Pixmap" position="142,6" zPosition="1" size="8,9" pixmap="skin_default/nim_active.png" alphatest="on" >
+                       <convert type="Misc">TunerUseMask</convert>
+                       <convert type="ValueBitTest">1</convert>
+                       <convert type="ConditionalShowHide" />
+               </widget>
+               <!-- DEPRECATED widget name="NimB" position="142,20" zPosition="1" size="8,9" pixmap="skin_default/nim_active.png" alphatest="on" /-->
+               <widget source="session.GlobalInfo" render="Pixmap" position="142,20" zPosition="1" size="8,9" pixmap="skin_default/nim_active.png" alphatest="on" >
+                       <convert type="Misc">TunerUseMask</convert>
+                       <convert type="ValueBitTest">2</convert>
+                       <convert type="ConditionalShowHide" />
+               </widget>
                <!-- Crypt icon (encrypted service?) -->
                <ePixmap position="563,48" zPosition="0" size="107,15" pixmap="skin_default/icons_off.png" alphatest="off"/>
                <widget source="session.CurrentService" render="Pixmap" pixmap="skin_default/icon_crypt.png" position="563,48" zPosition="1" size="12,16" alphatest="on" >
                        <convert type="EventTime">Progress</convert>
                </widget>
                <!-- Blinking pixmap (recording in progress?) -->
-               <widget name="BlinkingPoint" pixmap="skin_default/icon_rec.png" position="561,21" zPosition="2" size="34,21" alphatest="off" />
+               <!-- DEPRECATED widget name="BlinkingPoint" pixmap="skin_default/icon_rec.png" position="561,21" zPosition="2" size="34,21" alphatest="off" /-->
+               <widget source="session.GlobalInfo" render="Pixmap" pixmap="skin_default/icon_rec.png" position="561,21" zPosition="2" size="34,21" alphatest="off">
+                       <convert type="Misc">RecordRunning</convert>
+                       <convert type="ConditionalShowHide">Blink</convert>
+               </widget>
                <!-- Event (now) -->
                <ePixmap pixmap="skin_default/icon_event.png" position="182,78" zPosition="1" size="15,10" alphatest="on" />
                <widget source="session.Event_Now" render="Label" position="205,73" size="60,24" font="Regular;20" backgroundColor="#34406f" shadowColor="#1d354c" shadowOffset="-1,-1" transparent="1" >
index dbfe20c..06892a7 100644 (file)
@@ -1315,9 +1315,10 @@ class InfoBarInstantRecord:
                                "instantRecord": (self.instantRecord, _("Instant Record...")),
                        })
                self.recording = []
+#### DEPRECATED CODE ####
                self["BlinkingPoint"] = BlinkingPixmapConditional()
-               self["BlinkingPoint"].hide()
                self["BlinkingPoint"].setConnect(self.session.nav.RecordTimer.isRecording)
+#########################
 
        def stopCurrentRecording(self, entry = -1):
                if entry is not None and entry != -1:
@@ -1363,7 +1364,9 @@ class InfoBarInstantRecord:
                recording.dontSave = True
                self.recording.append(recording)
 
-               #self["BlinkingPoint"].setConnect(lambda: self.recording.isRunning())
+#### DEPRECATED CODE ####
+               self["BlinkingPoint"].setConnect(lambda: self.recording.isRunning())
+#########################
 
        def isInstantRecordRunning(self):
                print "self.recording:", self.recording
@@ -1653,20 +1656,23 @@ class InfoBarSubserviceSelection:
 
 class InfoBarAdditionalInfo:
        def __init__(self):
-               self["NimA"] = Pixmap()
-               self["NimB"] = Pixmap()
-               self["NimA_Active"] = Pixmap()
-               self["NimB_Active"] = Pixmap()
 
                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
+######### DEPRECATED CODE ##########
+               self["NimA"] = Pixmap()
+               self["NimB"] = Pixmap()
+               self["NimA_Active"] = Pixmap()
+               self["NimB_Active"] = Pixmap()
+
                res_mgr = eDVBResourceManager.getInstance()
                if res_mgr:
                        res_mgr.frontendUseMaskChanged.get().append(self.tunerUseMaskChanged)
 
+               self.session.nav.event.append(self.gotServiceEvent) # we like to get service events
+
        def tunerUseMaskChanged(self, mask):
                if mask&1:
                        self["NimA_Active"].show()
@@ -1694,6 +1700,7 @@ class InfoBarAdditionalInfo:
                service = self.session.nav.getCurrentService()
                if ev == iPlayableService.evUpdatedInfo or ev == iPlayableService.evEnd:
                        self.checkTunerState(service)
+####################################
 
 class InfoBarNotifications:
        def __init__(self):
index d90c208..df884ba 100644 (file)
@@ -1,14 +1,30 @@
+from enigma import iPlayableService
 from Screens.Screen import Screen
 from Components.Sources.CurrentService import CurrentService
 from Components.Sources.EventInfo import EventInfo
 from Components.Sources.FrontendStatus import FrontendStatus
+from Components.Sources.FrontendInfo import FrontendInfo
 from Components.Sources.Source import Source
+from Components.Sources.Misc import Misc
 
 class SessionGlobals(Screen):
        def __init__(self, session):
                Screen.__init__(self, session)
-               self["CurrentService"] = CurrentService(self.session.nav)
-               self["Event_Now"] = EventInfo(self.session.nav, EventInfo.NOW)
-               self["Event_Next"] = EventInfo(self.session.nav, EventInfo.NEXT)
-               self["FrontendStatus"] = FrontendStatus(service_source = self.session.nav.getCurrentService)
+               self["CurrentService"] = CurrentService(session.nav)
+               self["Event_Now"] = EventInfo(session.nav, EventInfo.NOW)
+               self["Event_Next"] = EventInfo(session.nav, EventInfo.NEXT)
+               self["FrontendStatus"] = FrontendStatus(service_source = session.nav.getCurrentService)
+               self["FrontendInfo"] = FrontendInfo(service_source = session.nav.getCurrentService)
                self["VideoPicture"] = Source()
+               self["GlobalInfo"] = Misc(session)
+               session.nav.event.append(self.serviceEvent)
+               self.service_state = 0
+
+       def serviceEvent(self, evt):
+               if evt == iPlayableService.evStart:
+                       self.service_state = 1
+               elif evt == iPlayableService.evEnd:
+                       self.service_state = 0
+               elif evt == iPlayableService.evUpdatedInfo and self.service_state == 1:
+                       self.service_state = 2
+                       self["FrontendInfo"].updateFrontendData()