aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2007-09-24 01:43:46 +0000
committerFelix Domke <tmbinc@elitedvb.net>2007-09-24 01:43:46 +0000
commit7fb6346d5db27b8bb0671d18af2c69355dacfce0 (patch)
tree9d57d8c01a5031efbde6d8e6b9d642df0af724ee /lib/python
parentd5dd75f923d0f47f409d8406f131bcb7a4afe0ec (diff)
downloadenigma2-7fb6346d5db27b8bb0671d18af2c69355dacfce0.tar.gz
enigma2-7fb6346d5db27b8bb0671d18af2c69355dacfce0.zip
allow ServicePosition to be used with Progress renderer
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Components/Converter/ServicePosition.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/python/Components/Converter/ServicePosition.py b/lib/python/Components/Converter/ServicePosition.py
index 089ca6c1..e3110179 100644
--- a/lib/python/Components/Converter/ServicePosition.py
+++ b/lib/python/Components/Converter/ServicePosition.py
@@ -27,6 +27,8 @@ class ServicePosition(Converter, Poll, object):
self.type = self.TYPE_REMAINING
elif type == "Gauge":
self.type = self.TYPE_GAUGE
+ else:
+ raise "type must be {Length|Position|PositionDetaileed|Remaining|Gauge}"
self.poll_enabled = self.type != self.TYPE_LENGTH
@@ -87,10 +89,22 @@ class ServicePosition(Converter, Poll, object):
else:
return sign + "%d:%02d:%03d" % ((l/60/90000), (l/90000)%60, (l%90000)/90)
+ # range/value are for the Progress renderer
+ range = 10000
+
+ @cached
+ def getValue(self):
+ pos = self.position
+ len = self.length
+ if pos is None or len is None or len <= 0:
+ return None
+ return pos * 10000 / len
+
position = property(getPosition)
length = property(getLength)
cutlist = property(getCutlist)
text = property(getText)
+ value = property(getValue)
def changed(self, what):
cutlist_refresh = what[0] != self.CHANGED_SPECIFIC or what[1] in [iPlayableService.evCuesheetChanged]