def gotRecordEvent(self, record, event):
# TODO: this is not working (never true), please fix. (comparing two swig wrapped ePtrs)
if self.__record_service.__deref__() != record.__deref__():
return
# self.log(16, "record event %d" % event)
if event == iRecordableService.evRecordWriteError:
print "WRITE ERROR on recording, disk full?"
# show notification. the 'id' will make sure that it will be
# displayed only once, even if more timers are failing at the
# same time. (which is very likely in case of disk fullness)
Notifications.AddPopup(text = _("Write error while recording. Disk full?\n"), type = MessageBox.TYPE_ERROR, timeout = 0, id = "DiskFullMessage")
# ok, the recording has been stopped. we need to properly note
# that in our state, with also keeping the possibility to re-try.
# TODO: this has to be done.
elif event == iRecordableService.evStart:
RecordingsState(1)
text = _("A recording has been started:\n%s") % self.name
notify = config.usage.show_message_when_recording_starts.value and \
not Screens.Standby.inStandby and \
Screens.InfoBar.InfoBar.instance and \
Screens.InfoBar.InfoBar.instance.execing
if self.dirnameHadToFallback:
text = '\n'.join((text, _("Please note that the previously selected media could not be accessed and therefore the default directory is being used instead.")))
notify = True
if notify:
from Screens.MessageBox import MessageBox
Notifications.AddPopup(text = text, type = MessageBox.TYPE_INFO, timeout = 3)
elif event == iRecordableService.evRecordAborted:
NavigationInstance.instance.RecordTimer.removeEntry(self)
elif event == iRecordableService.evGstRecordEnded:
if self.repeated:
self.processRepeated(findRunningEvent = False)
NavigationInstance.instance.RecordTimer.doActivate(self)
# we have record_service as property to automatically subscribe to record service events
评论列表
文章目录