load cutlist on initial create
[enigma2.git] / lib / python / Components / Renderer / PositionGauge.py
1 from Renderer import Renderer
2 from enigma import ePositionGauge
3
4 class PositionGauge(Renderer):
5         def __init__(self):
6                 Renderer.__init__(self)
7                 self.__position = 0
8                 self.__length = 0
9                 self.__cutlist = [ ]
10         
11         GUI_WIDGET = ePositionGauge
12         
13         def postWidgetCreate(self, instance):
14                 self.changed()
15                 self.cutlist_changed()
16                 instance.setInOutList(self.__cutlist)
17
18         def changed(self):
19                 (self.length, self.position) = (self.source.length or 0, self.source.position or 0)
20
21         def cutlist_changed(self):
22                 self.cutlist = self.source.cutlist or [ ]
23
24         def getPosition(self):
25                 return self.__position
26         
27         def setPosition(self, pos):
28                 self.__position = pos
29                 if self.instance is not None:
30                         self.instance.setPosition(pos)
31         
32         position = property(getPosition, setPosition)
33
34         def getLength(self):
35                 return self.__length
36         
37         def setLength(self, len):
38                 self.__length = len
39                 if self.instance is not None:
40                         self.instance.setLength(len)
41
42         length = property(getLength, setLength)
43
44         def getCutlist(self):
45                 return self.__cutlist
46         
47         def setCutlist(self, cutlist):
48                 self.__cutlist = cutlist
49                 if self.instance is not None:
50                         self.instance.setInOutList(cutlist)
51
52         cutlist = property(getCutlist, setCutlist)