X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/031968bd5d07b0d79bd3320cdd9d08065f053efb..cffee89d7b3567ee92901f6963108c33ea3ac469:/lib/python/Screens/InfoBarGenerics.py diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py index 9b6712e5..754b673a 100644 --- a/lib/python/Screens/InfoBarGenerics.py +++ b/lib/python/Screens/InfoBarGenerics.py @@ -1443,6 +1443,9 @@ class InfoBarCueSheetSupport: CUT_TYPE_IN = 0 CUT_TYPE_OUT = 1 CUT_TYPE_MARK = 2 + CUT_TYPE_LAST = 3 + + ENABLE_RESUME_SUPPORT = False def __init__(self): self["CueSheetActions"] = HelpableActionMap(self, "InfobarCueSheetActions", @@ -1453,14 +1456,34 @@ class InfoBarCueSheetSupport: }, prio=1) self.cut_list = [ ] + self.is_closing = False self.__event_tracker = ServiceEventTracker(screen=self, eventmap= { iPlayableService.evStart: self.__serviceStarted, }) def __serviceStarted(self): + if self.is_closing: + return print "new service started! trying to download cuts!" self.downloadCuesheet() + + if self.ENABLE_RESUME_SUPPORT: + last = None + + for (pts, what) in self.cut_list: + if what == self.CUT_TYPE_LAST: + last = pts + + if last is not None: + self.resume_point = last + Notifications.AddNotificationWithCallback(self.playLastCB, MessageBox, _("Do you want to resume this playback?"), timeout=10) + + def playLastCB(self, answer): + if answer == True: + seekable = self.__getSeekable() + if seekable is not None: + seekable.seekTo(self.resume_point) def __getSeekable(self): service = self.session.nav.getCurrentService()