store and re-use previous pip position and size
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Fri, 21 Jul 2006 00:14:15 +0000 (00:14 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Fri, 21 Jul 2006 00:14:15 +0000 (00:14 +0000)
lib/python/Components/config.py
lib/python/Screens/PictureInPicture.py

index 4217202102561c4f3cfceacfea816a9047420884..fda44795ec1e84cb01e9e648b92b58e7a0cc993f 100644 (file)
@@ -188,6 +188,8 @@ class configSequenceArg:
                if (type == "IP"):
                        return (("."), [(0,255),(0,255),(0,255),(0,255)], "")
                # configsequencearg.get ("MAC")
                if (type == "IP"):
                        return (("."), [(0,255),(0,255),(0,255),(0,255)], "")
                # configsequencearg.get ("MAC")
+               if (type == "POSITION"):
+                       return ((","), [(0,args[0]),(0,args[1]),(0,args[2]),(0,args[3])], "")
                if (type == "MAC"):
                        return ((":"), [(1,255),(1,255),(1,255),(1,255),(1,255),(1,255)], "")
                # configsequencearg.get ("CLOCK")
                if (type == "MAC"):
                        return ((":"), [(1,255),(1,255),(1,255),(1,255),(1,255),(1,255)], "")
                # configsequencearg.get ("CLOCK")
index 20cdb23648d4f5a1fd00fee4f0cf9aab940ed73d..fdb0418546185bf9b37e1d36a40760d7ed595972 100644 (file)
@@ -1,21 +1,36 @@
 from Screens.Screen import Screen
 from enigma import ePoint, eSize, eServiceCenter
 from Screens.Screen import Screen
 from enigma import ePoint, eSize, eServiceCenter
-
 from Components.VideoWindow import VideoWindow
 from Components.VideoWindow import VideoWindow
+from Components.config import config, configElement, configSequence, configsequencearg
 
 class PictureInPicture(Screen):
        def __init__(self, session):
                Screen.__init__(self, session)
 
 class PictureInPicture(Screen):
        def __init__(self, session):
                Screen.__init__(self, session)
-               
                self["video"] = VideoWindow()
                self.currentService = None
                self["video"] = VideoWindow()
                self.currentService = None
+               config.av.pip = configElement("config.av.pip", configSequence, [-1, -1, -1, -1], configsequencearg.get("POSITION", (719, 567, 720, 568)))
+               self.onLayoutFinish.append(self.LayoutFinished)
+
+       def LayoutFinished(self):
+               self.onLayoutFinish.remove(self.LayoutFinished)
+               x = config.av.pip.value[0]
+               y = config.av.pip.value[1]
+               w = config.av.pip.value[2]
+               h = config.av.pip.value[3]
+               if x != -1 and y != -1 and w != -1 and h != -1:
+                       self.move(x, y)
+                       self.resize(w, h)
 
        def move(self, x, y):
 
        def move(self, x, y):
-               print "moving pip to", str(x) + ":" + str(y)
+               config.av.pip.value[0] = x
+               config.av.pip.value[1] = y
+               config.av.pip.save()
                self.instance.move(ePoint(x, y))
                
        def resize(self, w, h):
                self.instance.move(ePoint(x, y))
                
        def resize(self, w, h):
-               print "resizing pip to", str(w) + "x" + str(h)
+               config.av.pip.value[2] = w
+               config.av.pip.value[3] = h
+               config.av.pip.save()
                self.instance.resize(eSize(*(w, h)))
                self["video"].instance.resize(eSize(*(w, h)))
                
                self.instance.resize(eSize(*(w, h)))
                self["video"].instance.resize(eSize(*(w, h)))