Add activity detection between deepstandby and recording start
authorLittlesat <littlesat99@yahoo.com>
Thu, 26 Sep 2013 08:28:32 +0000 (10:28 +0200)
committerLittlesat <littlesat99@yahoo.com>
Thu, 26 Sep 2013 08:28:32 +0000 (10:28 +0200)
Navigation.py
RecordTimer.py

index b7f7741..dd100ba 100644 (file)
@@ -45,7 +45,7 @@ class Navigation:
                if RecordTimer.chechForRecordings():
                        if Screens.Standby.inStandby: #In case some plugin did put the receiver already in standby
                                config.misc.standbyCounter.value = 0
-                       RecordTimer.RecordTimerEntry.wasInDeepStandby = True
+                       RecordTimer.RecordTimerEntry.setWasInDeepStandby()
                        self.keypress() #this ensures to unbind the keypress detection  
 
        def keypress(self, key=None, flag=1):
index 602fb82..4493c6f 100644 (file)
@@ -83,16 +83,23 @@ class RecordTimerEntry(timer.TimerEntry, object):
 
        @staticmethod
        def keypress(key=None, flag=1):
-               if flag and RecordTimerEntry.wasInStandby:
+               if flag and (RecordTimerEntry.wasInStandby or RecordTimerEntry.wasInDeepStandby):
                        RecordTimerEntry.wasInStandby = False
+                       RecordTimerEntry.wasInDeepStandby = False
                        eActionMap.getInstance().unbindAction('', RecordTimerEntry.keypress)
 
        @staticmethod
+       def setWasInDeepStandby():
+               RecordTimerEntry.wasInDeepStandby = True
+               eActionMap.getInstance().bindAction('', -maxint - 1, RecordTimerEntry.keypress)
+
+       @staticmethod
        def setWasInStandby():
                if not RecordTimerEntry.wasInStandby:
-                       RecordTimerEntry.wasInStandby = True
+                       if not RecordTimerEntry.wasInDeepStandby:
+                               eActionMap.getInstance().bindAction('', -maxint - 1, RecordTimerEntry.keypress)
                        RecordTimerEntry.wasInDeepStandby = False
-                       eActionMap.getInstance().bindAction('', -maxint - 1, RecordTimerEntry.keypress)
+                       RecordTimerEntry.wasInStandby = True
 
        @staticmethod
        def shutdown():
@@ -354,7 +361,7 @@ class RecordTimerEntry(timer.TimerEntry, object):
                                self.log(11, "start recording")
 
                                if RecordTimerEntry.wasInDeepStandby:
-                                       RecordTimerEntry.wasInDeepStandby = False
+                                       RecordTimerEntry.keypress()
                                        if not Screens.Standby.inStandby:
                                                Notifications.AddNotification(Screens.Standby.Standby, StandbyCounterIncrease=False)