enable transparency (without alphablit) when pixmap has a different size than widget
[enigma2.git] / RecordTimer.py
index 27967629060ff52696f38250be9745f955371827..2961f9509c036cf44c1eb3dede1c377225e1aa9a 100644 (file)
@@ -170,6 +170,7 @@ class RecordTimerEntry(timer.TimerEntry):
                        prep_res=self.record_service.prepare(self.Filename + ".ts", self.begin, self.end, event_id)
                        if prep_res:
                                self.log(2, "'prepare' failed: error %d" % prep_res)
+                               NavigationInstance.instance.stopRecordService(self.record_service)
                                self.record_service = None
                                return False
                                
@@ -190,6 +191,7 @@ class RecordTimerEntry(timer.TimerEntry):
                                f.close()
                        except IOError:
                                self.log(4, "failed to write meta information")
+                               NavigationInstance.instance.stopRecordService(self.record_service)
                                self.record_service = None
                                return False
                        return True
@@ -236,8 +238,15 @@ class RecordTimerEntry(timer.TimerEntry):
                                return True
 
                        if self.justplay:
-                               self.log(11, "zapping")
-                               NavigationInstance.instance.playService(self.service_ref.ref)
+                               if Screens.Standby.inStandby:
+                                       self.log(11, "wakeup and zap")
+                                       #set service to zap after standby
+                                       Screens.Standby.inStandby.prev_running_service = self.service_ref.ref
+                                       #wakeup standby
+                                       Screens.Standby.inStandby.Power()
+                               else:
+                                       self.log(11, "zapping")
+                                       NavigationInstance.instance.playService(self.service_ref.ref)
                                return True
                        else:
                                self.log(11, "start recording")
@@ -257,7 +266,7 @@ class RecordTimerEntry(timer.TimerEntry):
                                NavigationInstance.instance.stopRecordService(self.record_service)
                                self.record_service = None
                        if self.afterEvent == AFTEREVENT.STANDBY:
-                               if not Screen.Standby.inStandby: # not already in standby
+                               if not Screens.Standby.inStandby: # not already in standby
                                        Notifications.AddNotificationWithCallback(self.sendStandbyNotification, MessageBox, _("A finished record timer wants to set your\nDreambox to standby. Do that now?"), timeout = 20)
                        if self.afterEvent == AFTEREVENT.DEEPSTANDBY:
                                if not Screens.Standby.inTryQuitMainloop: # not a shutdown messagebox is open
@@ -437,6 +446,30 @@ class RecordTimer(timer.Timer):
                        file.write(x)
                file.close()
 
+       def getNextZapTime(self):
+               llen = len(self.timer_list)
+               idx = 0
+               now = time.time()
+               while idx < llen:
+                       timer = self.timer_list[idx]
+                       if not timer.justplay or timer.begin < now:
+                               idx += 1
+                       else:
+                               return timer.begin
+               return -1
+
+       def getNextRecordingTime(self):
+               llen = len(self.timer_list)
+               idx = 0
+               now = time.time()
+               while idx < llen:
+                       timer = self.timer_list[idx]
+                       if timer.justplay or timer.begin < now:
+                               idx += 1
+                       else:
+                               return timer.begin
+               return -1
+
        def record(self, entry):
                entry.timeChanged()
                print "[Timer] Record " + str(entry)