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
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
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")
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
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)