X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/e48e67ced346bf110740ac1051a9a0e240fdbc56..b52a614903cab3c3b8d1a1eae871d3bdefa926ce:/lib/python/Plugins/Extensions/DVDPlayer/plugin.py diff --git a/lib/python/Plugins/Extensions/DVDPlayer/plugin.py b/lib/python/Plugins/Extensions/DVDPlayer/plugin.py index bab64ce1..a44d042b 100644 --- a/lib/python/Plugins/Extensions/DVDPlayer/plugin.py +++ b/lib/python/Plugins/Extensions/DVDPlayer/plugin.py @@ -10,7 +10,7 @@ from Screens.InfoBarGenerics import InfoBarSeek, InfoBarPVRState, InfoBarCueShee from Components.ActionMap import ActionMap, NumberActionMap, HelpableActionMap from Components.Label import Label from Components.FileList import FileList -from Components.ServiceEventTracker import ServiceEventTracker +from Components.ServiceEventTracker import ServiceEventTracker, InfoBarBase from Components.config import config from Components.ProgressBar import ProgressBar from ServiceReference import ServiceReference @@ -19,6 +19,8 @@ from Tools.Directories import pathExists, fileExists import random import servicedvd # load c++ part of dvd player plugin +lastpath = "" + class FileBrowser(Screen): skin = """ @@ -26,7 +28,11 @@ class FileBrowser(Screen): """ def __init__(self, session): Screen.__init__(self, session) - currDir = "/media/dvd/" + global lastpath + if lastpath is not None: + currDir = lastpath + "/" + else: + currDir = "/media/dvd/" if not pathExists(currDir): currDir = "/" #else: @@ -41,15 +47,18 @@ class FileBrowser(Screen): }) def ok(self): + global lastpath filename = self["filelist"].getFilename() - if filename is not None and filename.upper().endswith("VIDEO_TS/"): - print "dvd structure found, trying to open..." - self.close(filename[0:-9]) - elif self["filelist"].canDescent(): # isDir + if filename is not None: + lastpath = filename[0:filename.rfind("/")] + if filename.upper().endswith("VIDEO_TS/"): + print "dvd structure found, trying to open..." + self.close(filename[0:-9]) + if self["filelist"].canDescent(): # isDir self["filelist"].descent() else: self.close(filename) - + def exit(self): self.close(None) @@ -138,7 +147,7 @@ class ChapterZap(Screen): self.Timer.callback.append(self.keyOK) self.Timer.start(3000, True) -class DVDPlayer(Screen, InfoBarNotifications, InfoBarSeek, InfoBarCueSheetSupport, InfoBarPVRState, InfoBarShowHide, HelpableScreen): +class DVDPlayer(Screen, InfoBarBase, InfoBarNotifications, InfoBarSeek, InfoBarCueSheetSupport, InfoBarPVRState, InfoBarShowHide, HelpableScreen): ALLOW_SUSPEND = True ENABLE_RESUME_SUPPORT = True @@ -211,6 +220,7 @@ class DVDPlayer(Screen, InfoBarNotifications, InfoBarSeek, InfoBarCueSheetSuppor def __init__(self, session, args = None): Screen.__init__(self, session) + InfoBarBase.__init__(self) InfoBarNotifications.__init__(self) InfoBarCueSheetSupport.__init__(self, actionmap = "MediaPlayerCueSheetActions") InfoBarShowHide.__init__(self) @@ -329,10 +339,12 @@ class DVDPlayer(Screen, InfoBarNotifications, InfoBarSeek, InfoBarCueSheetSuppor def __menuOpened(self): self.hide() self.in_menu = True + self["NumberActions"].setEnabled(False) def __menuClosed(self): self.show() self.in_menu = False + self["NumberActions"].setEnabled(True) def setChapterLabel(self): chapterLCD = "Menu" @@ -474,6 +486,8 @@ class DVDPlayer(Screen, InfoBarNotifications, InfoBarSeek, InfoBarCueSheetSuppor def keyOk(self): if self.service: + if not self.in_menu: + self.toggleInfo() self.service.keys().keyPressed(iServiceKeys.keyOk) def keyCancel(self): @@ -517,6 +531,12 @@ class DVDPlayer(Screen, InfoBarNotifications, InfoBarSeek, InfoBarCueSheetSuppor self.restore_infobar_seek_config() self.session.nav.playService(self.oldService) + def playLastCB(self, answer): # overwrite infobar cuesheet function + print "playLastCB", answer, self.resume_point +# if answer == True: +# self.doSeek(self.resume_point) + self.hideAfterResume() + def showAfterCuesheetOperation(self): if not self.in_menu: self.show() @@ -525,6 +545,13 @@ class DVDPlayer(Screen, InfoBarNotifications, InfoBarSeek, InfoBarCueSheetSuppor print "DVDCreateSummary" return DVDSummary +#override some InfoBarSeek functions + def doEof(self): + self.setSeekState(self.SEEK_STATE_PLAY) + + def calcRemainingTime(self): + return 0 + def main(session, **kwargs): session.open(DVDPlayer)