+ self.updateColors()
+
+ def useServiceTime(self):
+ remaining = None
+ ref = self.session.nav.getCurrentlyPlayingServiceReference()
+ if ref:
+ path = ref.getPath()
+ if path: # Movie
+ service = self.session.nav.getCurrentService()
+ seek = service and service.seek()
+ if seek:
+ length = seek.getLength()
+ position = seek.getPlayPosition()
+ if length and position:
+ remaining = length[1] - position[1]
+ if remaining > 0:
+ remaining = remaining / 90000
+ else: # DVB
+ epg = eEPGCache.getInstance()
+ event = epg.lookupEventTime(ref, -1, 0)
+ if event:
+ now = int(time())
+ start = event.getBeginTime()
+ duration = event.getDuration()
+ end = start + duration
+ remaining = end - now
+ if remaining:
+ config.SleepTimer.defaulttime.value = (remaining / 60) + 2
+ self["input"].setText(str((remaining / 60) + 2))