- if service != None:
- info = iServiceInformationPtr()
- if not service.info(info):
- ev = eServiceEventPtr()
- if info.getEvent(ev, 0) == 0:
- epg = ev
- # fix me, description.
- self.recording = self.session.nav.recordWithTimer(time.time(), time.time() + 30, serviceref, epg, "instant record")
+ info = service.info()
+ ev = info.getEvent(0)
+ epg = ev
+ except:
+ pass
+
+ # fix me, description.
+ self.recording = self.session.nav.recordWithTimer(time.time(), time.time() + 30, serviceref, epg, "instant record")
+
+ def recordQuestionCallback(self, answer):
+ if answer == False:
+ return
+
+ if self.recording != None:
+ self.stopCurrentRecording()
+ else:
+ self.startInstantRecording()
+
+ def instantRecord(self):
+ if self.recording != None:
+ self.session.openWithCallback(self.recordQuestionCallback, MessageBox, "Do you want to stop the current\n(instant) recording?")
+ else:
+ self.session.openWithCallback(self.recordQuestionCallback, MessageBox, "Start recording?")