aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Plugins/Extensions
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python/Plugins/Extensions')
-rw-r--r--lib/python/Plugins/Extensions/CutListEditor/plugin.py2
-rw-r--r--lib/python/Plugins/Extensions/MediaPlayer/plugin.py52
2 files changed, 23 insertions, 31 deletions
diff --git a/lib/python/Plugins/Extensions/CutListEditor/plugin.py b/lib/python/Plugins/Extensions/CutListEditor/plugin.py
index 6f793d7f..76a7bdc8 100644
--- a/lib/python/Plugins/Extensions/CutListEditor/plugin.py
+++ b/lib/python/Plugins/Extensions/CutListEditor/plugin.py
@@ -396,7 +396,7 @@ Then seek to the end, press OK, select 'end cut'. That's it.
# we modify the "play" behaviour a bit:
# if we press pause while being in slowmotion, we will pause (and not play)
def playpauseService(self):
- if self.seekstate not in [self.SEEK_STATE_PLAY, self.SEEK_STATE_SM_HALF, self.SEEK_STATE_SM_QUARTER, self.SEEK_STATE_SM_EIGHTH]:
+ if self.seekstate != self.SEEK_STATE_PLAY and not self.isStateSlowMotion(self.seekstate):
self.unPauseService()
else:
self.pauseService()
diff --git a/lib/python/Plugins/Extensions/MediaPlayer/plugin.py b/lib/python/Plugins/Extensions/MediaPlayer/plugin.py
index 03d76173..fa7f1643 100644
--- a/lib/python/Plugins/Extensions/MediaPlayer/plugin.py
+++ b/lib/python/Plugins/Extensions/MediaPlayer/plugin.py
@@ -110,8 +110,8 @@ class MediaPlayer(Screen, InfoBarSeek, InfoBarAudioSelection, InfoBarCueSheetSup
"play": (self.xplayEntry, _("play entry")),
"pause": (self.pauseEntry, _("pause")),
"stop": (self.stopEntry, _("stop entry")),
- "previous": (self.previousEntry, _("play previous playlist entry")),
- "next": (self.nextEntry, _("play next playlist entry")),
+ "previous": (self.previousMarkOrEntry, _("play from previous mark or playlist entry")),
+ "next": (self.nextMarkOrEntry, _("play from next mark or playlist entry")),
"menu": (self.showMenu, _("menu")),
"skipListbegin": (self.skip_listbegin, _("jump to listbegin")),
"skipListend": (self.skip_listend, _("jump to listend")),
@@ -146,14 +146,6 @@ class MediaPlayer(Screen, InfoBarSeek, InfoBarAudioSelection, InfoBarCueSheetSup
InfoBarSeek.__init__(self, actionmap = "MediaPlayerSeekActions")
- self.__event_tracker = ServiceEventTracker(screen=self, eventmap=
- {
- #iPlayableService.evStart: self.__serviceStarted,
- #iPlayableService.evSeekableStatusChanged: InfoBarSeek.__seekableStatusChanged,
-
- iPlayableService.evEOF: self.__evEOF,
- })
-
self.onClose.append(self.delMPTimer)
self.onClose.append(self.__onClose)
@@ -196,8 +188,11 @@ class MediaPlayer(Screen, InfoBarSeek, InfoBarAudioSelection, InfoBarCueSheetSup
def checkSkipShowHideLock(self):
self.updatedSeekState()
- def __evEOF(self):
- self.nextEntry()
+ def doEofInternal(self, playing):
+ if playing:
+ self.nextEntry()
+ else:
+ self.show()
def __onClose(self):
self.session.nav.playService(self.oldService)
@@ -570,10 +565,19 @@ class MediaPlayer(Screen, InfoBarSeek, InfoBarAudioSelection, InfoBarCueSheetSup
if next < len(self.playlist):
self.changeEntry(next)
- def previousEntry(self):
- next = self.playlist.getCurrentIndex() - 1
- if next >= 0:
- self.changeEntry(next)
+ def nextMarkOrEntry(self):
+ if not self.jumpPreviousNextMark(lambda x: x):
+ next = self.playlist.getCurrentIndex() + 1
+ if next < len(self.playlist):
+ self.changeEntry(next)
+ else:
+ self.doSeek(-1)
+
+ def previousMarkOrEntry(self):
+ if not self.jumpPreviousNextMark(lambda x: -x-5*90000, start=True):
+ next = self.playlist.getCurrentIndex() - 1
+ if next >= 0:
+ self.changeEntry(next)
def deleteEntry(self):
self.playlist.deleteFile(self.playlist.getSelectionIndex())
@@ -675,21 +679,9 @@ class MediaPlayer(Screen, InfoBarSeek, InfoBarAudioSelection, InfoBarCueSheetSup
self.playlist.pauseFile()
elif self.seekstate == self.SEEK_STATE_PLAY:
self.playlist.playFile()
- elif self.seekstate in ( self.SEEK_STATE_FF_2X,
- self.SEEK_STATE_FF_4X,
- self.SEEK_STATE_FF_8X,
- self.SEEK_STATE_FF_16X,
- self.SEEK_STATE_FF_32X,
- self.SEEK_STATE_FF_48X,
- self.SEEK_STATE_FF_64X,
- self.SEEK_STATE_FF_128X):
+ elif self.isStateForward(self.seekstate):
self.playlist.forwardFile()
- elif self.seekstate in ( self.SEEK_STATE_BACK_8X,
- self.SEEK_STATE_BACK_16X,
- self.SEEK_STATE_BACK_32X,
- self.SEEK_STATE_BACK_48X,
- self.SEEK_STATE_BACK_64X,
- self.SEEK_STATE_BACK_128X):
+ elif self.isStateBackward(self.seekstate):
self.playlist.rewindFile()
def pauseEntry(self):