Merge commit 'origin/bug_112_enable_extensions_manager' into experimental
[enigma2.git] / lib / python / Components / Converter / ServicePosition.py
index 2bcc54929eb4ca3cbb1d28e1f91033f8b16a0750..3a86e3a44cdb20a2b4a7a816d3cd7ffb9919ca3e 100644 (file)
@@ -3,7 +3,7 @@ from Poll import Poll
 from enigma import iPlayableService
 from Components.Element import cached, ElementError
 
-class ServicePosition(Converter, Poll, object):
+class ServicePosition(Poll, Converter, object):
        TYPE_LENGTH = 0
        TYPE_POSITION = 1
        TYPE_REMAINING = 2
@@ -21,11 +21,6 @@ class ServicePosition(Converter, Poll, object):
                self.showHours = 'ShowHours' in args
                self.showNoSeconds = 'ShowNoSeconds' in args
 
-               if self.detailed:
-                       self.poll_interval = 100
-               else:
-                       self.poll_interval = 500
-
                if type == "Length":
                        self.type = self.TYPE_LENGTH
                elif type == "Position":
@@ -35,9 +30,16 @@ class ServicePosition(Converter, Poll, object):
                elif type == "Gauge":
                        self.type = self.TYPE_GAUGE
                else:
-                       raise ElementError("type must be {Length|Position|Remaining|Gauge} with optional arguments {Negate|Detailed|ShowHours|NoSeconds}")
+                       raise ElementError("type must be {Length|Position|Remaining|Gauge} with optional arguments {Negate|Detailed|ShowHours|ShowNoSeconds} for ServicePosition converter")
+
+               if self.detailed:
+                       self.poll_interval = 100
+               elif self.type == self.TYPE_LENGTH:
+                       self.poll_interval = 2000
+               else:
+                       self.poll_interval = 500
 
-               self.poll_enabled = self.type != self.TYPE_LENGTH
+               self.poll_enabled = True
 
        def getSeek(self):
                s = self.source.service
@@ -128,8 +130,8 @@ class ServicePosition(Converter, Poll, object):
        value = property(getValue)
 
        def changed(self, what):
-               cutlist_refresh = what[0] != self.CHANGED_SPECIFIC or what[1] in [iPlayableService.evCuesheetChanged]
-               time_refresh = what[0] == self.CHANGED_POLL or what[0] == self.CHANGED_SPECIFIC and what[1] in [iPlayableService.evCuesheetChanged]
+               cutlist_refresh = what[0] != self.CHANGED_SPECIFIC or what[1] in (iPlayableService.evCuesheetChanged,)
+               time_refresh = what[0] == self.CHANGED_POLL or what[0] == self.CHANGED_SPECIFIC and what[1] in (iPlayableService.evCuesheetChanged,)
 
                if cutlist_refresh:
                        if self.type == self.TYPE_GAUGE: