aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Components
diff options
context:
space:
mode:
authorghost <andreas.monzner@multimedia-labs.de>2009-04-24 12:03:28 +0200
committerghost <andreas.monzner@multimedia-labs.de>2009-04-24 12:03:28 +0200
commit019ba406ed5ba46782951d501ed2d4c0a96e6096 (patch)
tree58c85bf4801a62c27a30d4366d9e45e81ba5bd98 /lib/python/Components
parent8188ccaebf3b9c51ef2916cb7e69ef954291392f (diff)
parent056af5306995176e457ddd471aa2b5c3a5223c4f (diff)
downloadenigma2-019ba406ed5ba46782951d501ed2d4c0a96e6096.tar.gz
enigma2-019ba406ed5ba46782951d501ed2d4c0a96e6096.zip
Merge branch 'master' of git.opendreambox.org:/git/enigma2
Diffstat (limited to 'lib/python/Components')
-rw-r--r--lib/python/Components/Converter/ClockToText.py6
-rw-r--r--lib/python/Components/Converter/RemainingToText.py8
-rw-r--r--lib/python/Components/Converter/ServiceInfo.py35
-rw-r--r--lib/python/Components/Sources/FrontendStatus.py2
4 files changed, 49 insertions, 2 deletions
diff --git a/lib/python/Components/Converter/ClockToText.py b/lib/python/Components/Converter/ClockToText.py
index 109f9125..8ef98742 100644
--- a/lib/python/Components/Converter/ClockToText.py
+++ b/lib/python/Components/Converter/ClockToText.py
@@ -9,6 +9,7 @@ class ClockToText(Converter, object):
DATE = 3
FORMAT = 4
AS_LENGTH = 5
+ TIMESTAMP = 6
# add: date, date as string, weekday, ...
# (whatever you need!)
@@ -23,6 +24,8 @@ class ClockToText(Converter, object):
self.type = self.DATE
elif type == "AsLength":
self.type = self.AS_LENGTH
+ elif type == "Timestamp":
+ self.type = self.TIMESTAMP
elif str(type).find("Format") != -1:
self.type = self.FORMAT
self.fmt_string = type[7:]
@@ -40,6 +43,8 @@ class ClockToText(Converter, object):
return "%d min" % (time / 60)
elif self.type == self.AS_LENGTH:
return "%d:%02d" % (time / 60, time % 60)
+ elif self.type == self.TIMESTAMP:
+ return str(time)
t = localtime(time)
@@ -57,6 +62,7 @@ class ClockToText(Converter, object):
return str(s1+s2)
else:
return strftime(self.fmt_string, t)
+
else:
return "???"
diff --git a/lib/python/Components/Converter/RemainingToText.py b/lib/python/Components/Converter/RemainingToText.py
index 4249e30a..66897579 100644
--- a/lib/python/Components/Converter/RemainingToText.py
+++ b/lib/python/Components/Converter/RemainingToText.py
@@ -5,6 +5,7 @@ class RemainingToText(Converter, object):
DEFAULT = 0
WITH_SECONDS = 1
NO_SECONDS = 2
+ IN_SECONDS = 3
def __init__(self, type):
Converter.__init__(self, type)
@@ -12,6 +13,8 @@ class RemainingToText(Converter, object):
self.type = self.WITH_SECONDS
elif type == "NoSeconds":
self.type = self.NO_SECONDS
+ elif type == "InSeconds":
+ self.type = self.IN_SECONDS
else:
self.type = self.DEFAULT
@@ -33,6 +36,11 @@ class RemainingToText(Converter, object):
return "+%d:%02d" % (remaining / 3600, (remaining / 60) - ((remaining / 3600) * 60))
else:
return "%02d:%02d" % (duration / 3600, (duration / 60) - ((duration / 3600) * 60))
+ elif self.type == self.IN_SECONDS:
+ if remaining is not None:
+ return str(remaining)
+ else:
+ return str(duration)
elif self.type == self.DEFAULT:
if remaining is not None:
return "+%d min" % (remaining / 60)
diff --git a/lib/python/Components/Converter/ServiceInfo.py b/lib/python/Components/Converter/ServiceInfo.py
index d4054f0c..f0773bf1 100644
--- a/lib/python/Components/Converter/ServiceInfo.py
+++ b/lib/python/Components/Converter/ServiceInfo.py
@@ -10,6 +10,15 @@ class ServiceInfo(Converter, object):
SUBSERVICES_AVAILABLE = 4
XRES = 5
YRES = 6
+ APID = 7
+ VPID = 8
+ PCRPID = 9
+ PMTPID = 10
+ TXTPID = 11
+ TSID = 12
+ ONID = 13
+ SID = 14
+
def __init__(self, type):
Converter.__init__(self, type)
@@ -21,6 +30,14 @@ class ServiceInfo(Converter, object):
"SubservicesAvailable": (self.SUBSERVICES_AVAILABLE, (iPlayableService.evUpdatedEventInfo,)),
"VideoWidth": (self.XRES, (iPlayableService.evVideoSizeChanged,)),
"VideoHeight": (self.YRES, (iPlayableService.evVideoSizeChanged,)),
+ "AudioPid": (self.APID, (iPlayableService.evUpdatedInfo,)),
+ "VideoPid": (self.VPID, (iPlayableService.evUpdatedInfo,)),
+ "PcrPid": (self.PCRPID, (iPlayableService.evUpdatedInfo,)),
+ "PmtPid": (self.PMTPID, (iPlayableService.evUpdatedInfo,)),
+ "TxtPid": (self.TXTPID, (iPlayableService.evUpdatedInfo,)),
+ "TsId": (self.TSID, (iPlayableService.evUpdatedInfo,)),
+ "OnId": (self.ONID, (iPlayableService.evUpdatedInfo,)),
+ "Sid": (self.SID, (iPlayableService.evUpdatedInfo,)),
}[type]
def getServiceInfoString(self, info, what):
@@ -73,8 +90,24 @@ class ServiceInfo(Converter, object):
if self.type == self.XRES:
return self.getServiceInfoString(info, iServiceInformation.sVideoWidth)
- if self.type == self.YRES:
+ elif self.type == self.YRES:
return self.getServiceInfoString(info, iServiceInformation.sVideoHeight)
+ elif self.type == self.APID:
+ return self.getServiceInfoString(info, iServiceInformation.sAudioPID)
+ elif self.type == self.VPID:
+ return self.getServiceInfoString(info, iServiceInformation.sVideoPID)
+ elif self.type == self.PCRPID:
+ return self.getServiceInfoString(info, iServiceInformation.sPCRPID)
+ elif self.type == self.PMTPID:
+ return self.getServiceInfoString(info, iServiceInformation.sPMTPID)
+ elif self.type == self.TXTPID:
+ return self.getServiceInfoString(info, iServiceInformation.sTXTPID)
+ elif self.type == self.TSID:
+ return self.getServiceInfoString(info, iServiceInformation.sTSID)
+ elif self.type == self.ONID:
+ return self.getServiceInfoString(info, iServiceInformation.sONID)
+ elif self.type == self.SID:
+ return self.getServiceInfoString(info, iServiceInformation.sSID)
return ""
text = property(getText)
diff --git a/lib/python/Components/Sources/FrontendStatus.py b/lib/python/Components/Sources/FrontendStatus.py
index 5eb3445f..8f1b36dc 100644
--- a/lib/python/Components/Sources/FrontendStatus.py
+++ b/lib/python/Components/Sources/FrontendStatus.py
@@ -46,7 +46,7 @@ class FrontendStatus(Source):
if suspended:
self.poll_timer.stop()
else:
- self.poll_timer.start(self.update_interval)
+ self.updateFrontendStatus()
def destroy(self):
self.poll_timer.callback.remove(self.updateFrontendStatus)