From bb2800462a81afbcfce36fa15d90808d13eae55b Mon Sep 17 00:00:00 2001 From: Fraxinas Date: Tue, 4 Aug 2009 13:26:48 +0200 Subject: [PATCH 1/1] allow two different behaviours when going into resume: SUSPEND_STOPS (default as usual) and new SUSPEND_PAUSES (introduced for dvd player) --- .../Plugins/Extensions/DVDPlayer/plugin.py | 2 +- lib/python/Screens/Screen.py | 1 + lib/python/Screens/Standby.py | 17 +++++++++++++---- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/lib/python/Plugins/Extensions/DVDPlayer/plugin.py b/lib/python/Plugins/Extensions/DVDPlayer/plugin.py index e7a4601e..ce5fa9d2 100644 --- a/lib/python/Plugins/Extensions/DVDPlayer/plugin.py +++ b/lib/python/Plugins/Extensions/DVDPlayer/plugin.py @@ -166,7 +166,7 @@ class ChapterZap(Screen): self.Timer.start(3000, True) class DVDPlayer(Screen, InfoBarBase, InfoBarNotifications, InfoBarSeek, InfoBarPVRState, InfoBarShowHide, HelpableScreen, InfoBarCueSheetSupport): -# ALLOW_SUSPEND = True + ALLOW_SUSPEND = Screen.SUSPEND_PAUSES ENABLE_RESUME_SUPPORT = True skin = """ diff --git a/lib/python/Screens/Screen.py b/lib/python/Screens/Screen.py index 2ba7342f..7ac7841c 100644 --- a/lib/python/Screens/Screen.py +++ b/lib/python/Screens/Screen.py @@ -9,6 +9,7 @@ from Components.GUIComponent import GUIComponent class Screen(dict, GUISkin): + False, SUSPEND_STOPS, SUSPEND_PAUSES = range(3) ALLOW_SUSPEND = False global_screen = None diff --git a/lib/python/Screens/Standby.py b/lib/python/Screens/Standby.py index d3767f33..4a9dca40 100644 --- a/lib/python/Screens/Standby.py +++ b/lib/python/Screens/Standby.py @@ -45,10 +45,17 @@ class Standby(Screen): #mute adc self.setMute() - #get currently playing service reference - self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceReference() - #stop actual played dvb-service - self.session.nav.stopService() + + if self.session.current_dialog.ALLOW_SUSPEND == Screen.SUSPEND_STOPS: + #get currently playing service reference + self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceReference() + #stop actual played dvb-service + self.session.nav.stopService() + self.paused_service = None + elif self.session.current_dialog.ALLOW_SUSPEND == Screen.SUSPEND_PAUSES: + self.paused_service = self.session.current_dialog + self.paused_service.pauseService() + self.prev_running_service = None #set input to vcr scart if SystemInfo["ScartSwitch"]: self.avswitch.setInput("SCART") @@ -63,6 +70,8 @@ class Standby(Screen): def __onClose(self): if self.prev_running_service: self.session.nav.playService(self.prev_running_service) + elif self.paused_service: + self.paused_service.unPauseService() def createSummary(self): return StandbySummary -- 2.30.2