git.cweiske.de
/
enigma2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
28ddb2c
)
poll position, length even if not initially available
author
Felix Domke
<tmbinc@elitedvb.net>
Fri, 27 Jan 2006 23:57:46 +0000
(23:57 +0000)
committer
Felix Domke
<tmbinc@elitedvb.net>
Fri, 27 Jan 2006 23:57:46 +0000
(23:57 +0000)
lib/python/Components/ServicePosition.py
patch
|
blob
|
history
diff --git
a/lib/python/Components/ServicePosition.py
b/lib/python/Components/ServicePosition.py
index 4992e8e7f4f8185ad25146f4d28f0088de92ab5c..80e5e3db8bfaf4ef9c07631da88e601d80522753 100644
(file)
--- a/
lib/python/Components/ServicePosition.py
+++ b/
lib/python/Components/ServicePosition.py
@@
-26,21
+26,7
@@
class ServicePosition(PerServiceDisplay):
def setType(self, type):
self.type = type
def setType(self, type):
self.type = type
- seek = iSeekableServicePtr()
- service = self.navcore.getCurrentService()
-
- self.updateTimer.stop()
- self.available = 0
-
- if service != None:
- seek = service.seek()
- if seek != None:
- if self.type != self.TYPE_LENGTH:
- self.updateTimer.start(500)
-
- self.length = self.get(self.TYPE_LENGTH)
- self.available = 1
-
+ self.updateTimer.start(500)
self.update()
def get(self, what):
self.update()
def get(self, what):
@@
-59,16
+45,23
@@
class ServicePosition(PerServiceDisplay):
return -1
def update(self):
return -1
def update(self):
- if self.available:
+ seek = None
+ service = self.navcore.getCurrentService()
+ if service != None:
+ seek = service.seek()
+
+ if seek is not None:
if self.type == self.TYPE_LENGTH:
if self.type == self.TYPE_LENGTH:
- l = self.
length
+ l = self.
get(self.TYPE_LENGTH)
elif self.type == self.TYPE_POSITION:
l = self.get(self.TYPE_POSITION)
elif self.type == self.TYPE_REMAINING:
elif self.type == self.TYPE_POSITION:
l = self.get(self.TYPE_POSITION)
elif self.type == self.TYPE_REMAINING:
- l = self.
length
- self.get(self.TYPE_POSITION)
+ l = self.
get(self.TYPE_LENGTH)
- self.get(self.TYPE_POSITION)
self.setText("%d:%02d" % (l/60, l%60))
self.setText("%d:%02d" % (l/60, l%60))
+ self.updateTimer.start(500)
else:
else:
+ self.updateTimer.start(10000)
self.setText("-:--")
def stopEvent(self):
self.setText("-:--")
def stopEvent(self):