- lookup = {
- self.SEEK_STATE_PLAY: self.SEEK_STATE_BACK_8X,
- self.SEEK_STATE_PAUSE: self.SEEK_STATE_PAUSE,
- self.SEEK_STATE_FF_2X: self.SEEK_STATE_PLAY,
- self.SEEK_STATE_FF_4X: self.SEEK_STATE_FF_2X,
- self.SEEK_STATE_FF_8X: self.SEEK_STATE_FF_4X,
- self.SEEK_STATE_FF_16X: self.SEEK_STATE_FF_8X,
- self.SEEK_STATE_FF_32X: self.SEEK_STATE_FF_16X,
- self.SEEK_STATE_FF_48X: self.SEEK_STATE_FF_32X,
- self.SEEK_STATE_FF_64X: self.SEEK_STATE_FF_48X,
- self.SEEK_STATE_FF_128X: self.SEEK_STATE_FF_64X,
- self.SEEK_STATE_BACK_8X: self.SEEK_STATE_BACK_16X,
- self.SEEK_STATE_BACK_16X: self.SEEK_STATE_BACK_32X,
- self.SEEK_STATE_BACK_32X: self.SEEK_STATE_BACK_48X,
- self.SEEK_STATE_BACK_48X: self.SEEK_STATE_BACK_64X,
- self.SEEK_STATE_BACK_64X: self.SEEK_STATE_BACK_128X,
- self.SEEK_STATE_BACK_128X: self.SEEK_STATE_BACK_128X,
- self.SEEK_STATE_SM_HALF: self.SEEK_STATE_SM_QUARTER,
- self.SEEK_STATE_SM_QUARTER: self.SEEK_STATE_SM_EIGHTH,
- self.SEEK_STATE_SM_EIGHTH: self.SEEK_STATE_PAUSE,
- self.SEEK_STATE_EOF: self.SEEK_STATE_BACK_8X,
- }
- self.setSeekState(lookup[self.seekstate])
-
- if self.seekstate == self.SEEK_STATE_PAUSE:
- seekable = self.getSeek()
- if seekable is not None:
- seekable.seekRelative(-1, 3)
-
- def seekFwdDef(self):
- self.seek_flag = False
- seconds = config.usage.self_defined_seek.value
- print "Seek", seconds, "seconds self defined forward"
- seekable = self.getSeek()
- if seekable is not None:
- seekable.seekRelative(1, seconds * 90000)
-
- def seekBackDef(self):
- self.seek_flag = False
- seconds = config.usage.self_defined_seek.value
- print "Seek", seconds, "seconds self defined backward"
- seekable = self.getSeek()
- if seekable is not None:
- seekable.seekRelative(1, 0 - seconds * 90000)
+ if self.seekstate == self.SEEK_STATE_PLAY:
+ self.setSeekState(self.makeStateBackward(int(config.seek.enter_backward.value)))
+ elif self.seekstate == self.SEEK_STATE_EOF:
+ self.setSeekState(self.makeStateBackward(int(config.seek.enter_backward.value)))
+ self.doSeekRelative(-6)
+ elif self.seekstate == self.SEEK_STATE_PAUSE:
+ self.doSeekRelative(-3)
+ elif self.isStateForward(self.seekstate):
+ speed = self.seekstate[1]
+ if self.seekstate[2]:
+ speed /= self.seekstate[2]
+ speed = self.getLower(speed, config.seek.speeds_forward.value)
+ if speed:
+ self.setSeekState(self.makeStateForward(speed))
+ else:
+ self.setSeekState(self.SEEK_STATE_PLAY)
+ elif self.isStateBackward(self.seekstate):
+ speed = -self.seekstate[1]
+ if self.seekstate[2]:
+ speed /= self.seekstate[2]
+ speed = self.getHigher(speed, config.seek.speeds_backward.value) or config.seek.speeds_backward.value[-1]
+ self.setSeekState(self.makeStateBackward(speed))
+ elif self.isStateSlowMotion(self.seekstate):
+ speed = self.getHigher(self.seekstate[2], config.seek.speeds_slowmotion.value)
+ if speed:
+ self.setSeekState(self.makeStateSlowMotion(speed))
+ else:
+ self.setSeekState(self.SEEK_STATE_PAUSE)