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 if self.__cutlist != cutlist:
54 self.__cutlist = cutlist
55 if self.instance is not None:
56 self.instance.setInOutList(cutlist)
58 cutlist = property(getCutlist, setCutlist)
60 def getSeekEnable(self):
61 return self.__seek_enable
63 def setSeekEnable(self, val):
64 self.__seek_enable = val
65 if self.instance is not None:
66 self.instance.enableSeekPointer(val)
68 seek_pointer_enabled = property(getSeekEnable, setSeekEnable)
70 def getSeekPosition(self):
71 return self.__seek_position
73 def setSeekPosition(self, pos):
74 self.__seek_position = pos
75 if self.instance is not None:
76 self.instance.setSeekPosition(pos)
78 seek_pointer_position = property(getSeekPosition, setSeekPosition)