1 from Renderer import Renderer
2 from enigma import ePositionGauge
4 class PositionGauge(Renderer):
6 Renderer.__init__(self)
8 self.__seek_position = 0
10 self.__seek_enable = 0
13 GUI_WIDGET = ePositionGauge
15 def postWidgetCreate(self, instance):
16 self.changed((self.CHANGED_DEFAULT,))
17 self.cutlist_changed()
18 instance.setInOutList(self.__cutlist)
20 def changed(self, what):
21 if what[0] == self.CHANGED_CLEAR:
22 (self.length, self.position) = 0
24 (self.length, self.position) = (self.source.length or 0, self.source.position or 0)
26 def cutlist_changed(self):
27 self.cutlist = self.source.cutlist or [ ]
29 def getPosition(self):
30 return self.__position
32 def setPosition(self, pos):
34 if self.instance is not None:
35 self.instance.setPosition(pos)
37 position = property(getPosition, setPosition)
42 def setLength(self, len):
44 if self.instance is not None:
45 self.instance.setLength(len)
47 length = property(getLength, setLength)
52 def setCutlist(self, cutlist):
53 self.__cutlist = cutlist
54 if self.instance is not None:
55 self.instance.setInOutList(cutlist)
57 cutlist = property(getCutlist, setCutlist)
59 def getSeekEnable(self):
60 return self.__seek_enable
62 def setSeekEnable(self, val):
63 self.__seek_enable = val
64 if self.instance is not None:
65 self.instance.enableSeekPointer(val)
67 seek_pointer_enabled = property(getSeekEnable, setSeekEnable)
69 def getSeekPosition(self):
70 return self.__seek_position
72 def setSeekPosition(self, pos):
73 self.__seek_position = pos
74 if self.instance is not None:
75 self.instance.setSeekPosition(pos)
77 seek_pointer_position = property(getSeekPosition, setSeekPosition)