+ def __evSOF(self):
+ self.setSeekState(self.SEEK_STATE_PLAY)
+ self.doSeek(0)
+
+ def seekRelative(self, diff):
+ seekable = self.getSeek()
+ if seekable is not None:
+ seekable.seekRelative(0, diff)
+
+from Screens.PVRState import PVRState
+
+class InfoBarPVRState:
+ def __init__(self):
+ self.onPlayStateChanged.append(self.__playStateChanged)
+ self.pvrStateDialog = self.session.instantiateDialog(PVRState)
+ self.onShow.append(self.__mayShow)
+ self.onHide.append(self.pvrStateDialog.hide)
+
+ def __mayShow(self):
+ if self.seekstate != self.SEEK_STATE_PLAY:
+ self.pvrStateDialog.show()
+
+ def __playStateChanged(self, state):
+ playstateString = state[3]
+ self.pvrStateDialog["state"].setText(playstateString)
+ self.__mayShow()
+
+class InfoBarShowMovies:
+
+ # i don't really like this class.
+ # it calls a not further specified "movie list" on up/down/movieList,
+ # so this is not more than an action map
+ def __init__(self):
+ self["MovieListActions"] = HelpableActionMap(self, "InfobarMovieListActions",
+ {
+ "movieList": (self.showMovies, "movie list"),
+ "up": (self.showMovies, "movie list"),
+ "down": (self.showMovies, "movie list")
+ })
+
+# InfoBarTimeshift requires InfoBarSeek, instantiated BEFORE!
+
+# Hrmf.
+#
+# Timeshift works the following way:
+# demux0 demux1 "TimeshiftActions" "TimeshiftActivateActions" "SeekActions"
+# - normal playback TUNER unused PLAY enable disable disable
+# - user presses "yellow" button. TUNER record PAUSE enable disable enable
+# - user presess pause again FILE record PLAY enable disable enable
+# - user fast forwards FILE record FF enable disable enable
+# - end of timeshift buffer reached TUNER record PLAY enable enable disable
+# - user backwards FILE record BACK # !! enable disable enable
+#
+
+# in other words:
+# - when a service is playing, pressing the "timeshiftStart" button ("yellow") enables recording ("enables timeshift"),
+# freezes the picture (to indicate timeshift), sets timeshiftMode ("activates timeshift")
+# now, the service becomes seekable, so "SeekActions" are enabled, "TimeshiftEnableActions" are disabled.
+# - the user can now PVR around
+# - if it hits the end, the service goes into live mode ("deactivates timeshift", it's of course still "enabled")
+# the service looses it's "seekable" state. It can still be paused, but just to activate timeshift right
+# after!
+# the seek actions will be disabled, but the timeshiftActivateActions will be enabled
+# - if the user rewinds, or press pause, timeshift will be activated again
+
+# note that a timeshift can be enabled ("recording") and
+# activated (currently time-shifting).
+
+class InfoBarTimeshift:
+ def __init__(self):
+ self["TimeshiftActions"] = HelpableActionMap(self, "InfobarTimeshiftActions",
+ {
+ "timeshiftStart": (self.startTimeshift, "start timeshift"), # the "yellow key"
+ "timeshiftStop": (self.stopTimeshift, "stop timeshift") # currently undefined :), probably 'TV'
+ }, prio=1)
+ self["TimeshiftActivateActions"] = ActionMap(["InfobarTimeshiftActivateActions"],
+ {
+ "timeshiftActivateEnd": self.activateTimeshiftEnd, # something like "pause key"
+ "timeshiftActivateEndAndPause": self.activateTimeshiftEndAndPause # something like "backward key"
+ }, prio=-1) # priority over record
+
+ self.timeshift_enabled = 0
+ self.timeshift_state = 0
+ self.ts_pause_timer = eTimer()
+ self.ts_pause_timer.timeout.get().append(self.pauseService)
+
+ self.__event_tracker = ServiceEventTracker(screen=self, eventmap=
+ {
+ iPlayableService.evSeekableStatusChanged: self.__seekableStatusChanged
+ })
+
+ def getTimeshift(self):