iPlayableService.evEOF: self.__evEOF,
iPlayableService.evSOF: self.__evSOF,
})
- self["SeekActions"] = HelpableActionMap(self, "InfobarSeekActions",
+
+ class InfoBarSeekActionMap(HelpableActionMap):
+ def __init__(self, screen, *args, **kwargs):
+ HelpableActionMap.__init__(self, screen, *args, **kwargs)
+ self.screen = screen
+
+ def action(self, contexts, action):
+ if action[:5] == "seek:":
+ time = int(action[5:])
+ self.screen.seekRelative(time * 90000)
+ else:
+ HelpableActionMap.action(self, contexts, action)
+
+ self["SeekActions"] = InfoBarSeekActionMap(self, "InfobarSeekActions",
{
"pauseService": (self.pauseService, "pause"),
"unPauseService": (self.unPauseService, "continue"),
self.SEEK_STATE_SM_EIGHTH: self.SEEK_STATE_PAUSE
}
self.setSeekState(lookup[self.seekstate])
+
+ if self.seekstate == self.SEEK_STATE_PAUSE:
+ seekable = self.getSeek()
+ if seekable is not None:
+ seekable.seekRelative(-1, 2)
def fwdTimerFire(self):
print "Display seek fwd"
def seekRelative(self, diff):
seekable = self.getSeek()
if seekable is not None:
- seekable.seekRelative(0, diff)
+ seekable.seekRelative(1, diff)
from Screens.PVRState import PVRState
nearest = cp
return nearest
- def toggleMark(self, onlyremove=False, onlyadd=False, tolerance=5*90000):
+ def toggleMark(self, onlyremove=False, onlyadd=False, tolerance=5*90000, onlyreturn=False):
current_pos = self.cueGetCurrentPosition()
if current_pos is None:
print "not seekable"
nearest_cutpoint = self.getNearestCutPoint(current_pos)
if nearest_cutpoint is not None and abs(nearest_cutpoint[0] - current_pos) < tolerance:
+ if onlyreturn:
+ return nearest_cutpoint
if not onlyadd:
self.removeMark(nearest_cutpoint)
- elif not onlyremove:
+ elif not onlyremove and not onlyreturn:
self.addMark((current_pos, self.CUT_TYPE_MARK))
+
+ if onlyreturn:
+ return None
def addMark(self, point):
bisect.insort(self.cut_list, point)