Exemple #1
0
class Scart(Screen):
	def __init__(self, session, start_visible=True):
		Screen.__init__(self, session)

		self.avswitch = AVSwitch()

		if start_visible:
			self.onExecBegin.append(self.showMessageBox)
			self.msgVisible = None
		else:
			self.msgVisible = False

	def showMessageBox(self):
		if self.msgVisible is None:
			self.onExecBegin.remove(self.showMessageBox)
			self.msgVisible = False

		if not self.msgVisible:
			self.msgVisible = True
			self.avswitch.setInput("SCART")
			self.msgBox = self.session.openWithCallback(self.MsgBoxClosed, MessageBox, _("If you see this, something is wrong with\nyour scart connection. Press OK to return."), MessageBox.TYPE_ERROR)

	def MsgBoxClosed(self, *val):
		self.msgBox = None
		self.switchToTV()

	def switchToTV(self, *val):
		if self.msgVisible:
			if self.msgBox:
				self.msgBox.close() # ... MsgBoxClosed -> switchToTV again..
				return
			self.avswitch.setInput("ENCODER")
			self.msgVisible = False
Exemple #2
0
	def draw(self):
		self.drawList = []
		self.listindex = 0
		self.videomodes_enabled = []
		if config.sifteam.switch_4_3_letterbox.value == True:
			self.videomodes_enabled.append("4_3_letterbox")
		if config.sifteam.switch_4_3_panscan.value == True:
			self.videomodes_enabled.append("4_3_panscan")
		if config.sifteam.switch_16_9.value == True:
			self.videomodes_enabled.append("16_9")
		if config.sifteam.switch_16_9_always.value == True:
			self.videomodes_enabled.append("16_9_always")
		if config.sifteam.switch_16_10_letterbox.value == True:
			self.videomodes_enabled.append("16_10_letterbox")
		if config.sifteam.switch_16_10_panscan.value == True:
			self.videomodes_enabled.append("16_10_panscan")
		if config.sifteam.switch_16_9_letterbox.value == True:
			self.videomodes_enabled.append("16_9_letterbox")
		
		try:
			iAVSwitch = AVSwitch()
			current_videomode = self.videomodes[iAVSwitch.getAspectRatioSetting()]
			self.listindex = self.videomodes_enabled.index(current_videomode)
		except Exception:
			pass
		
		for videomode in self.videomodes_enabled:
			index = self.videomodes.index(videomode)
			self.drawList.append((_(self.videodescs[index]),))
			
		self["menu"].setList(self.drawList)
		self["menu"].setIndex(self.listindex)
Exemple #3
0
	def ok(self):
		index = self['menu'].getIndex()
		videomode = self.videomodes_enabled[index]
		
		iAVSwitch = AVSwitch()
		iAVSwitch.setAspectRatio(self.videomodes.index(videomode))
		config.av.aspectratio.setValue(videomode)
		self.close()
	def changeVideoMode(self):
		iAVSwitch = AVSwitch()
		aspectnum = iAVSwitch.getAspectRatioSetting()
		aspectnum += 1
		if aspectnum >= len(self.videomodes):
			aspectnum = 0
		iAVSwitch.setAspectRatio(aspectnum)
		config.av.aspectratio.setValue(self.videomodes[aspectnum])
Exemple #5
0
	def switchAspectRatio(self, direction=1):
		if len(self.enabledaspects) < 2:
			return
		iAVSwitch = AVSwitch()
		aspectnum = iAVSwitch.getAspectRatioSetting()
		try:
			localaspectnum = self.enabledaspects.index(aspectnum)
		except ValueError:
			localaspectnum = 0
		newaspectnum = self.enabledaspects[(localaspectnum + direction) % len(self.enabledaspects)]
		iAVSwitch.setAspectRatio(newaspectnum)
		config.av.aspectratio.setValue(ASPECT[newaspectnum])
		if config.plugins.GBAspectRatioSwitch.showmsg.value:
			Notifications.AddPopup(text=ASPECTMSG[ASPECT[newaspectnum]], type=MessageBox.TYPE_INFO, timeout=2, id='GBAspectRatioSwitch')
 def changeMode(self):
     self.videomodes_enabled = []
     
     if config.sifteam.switch_4_3_letterbox.value == True:
         self.videomodes_enabled.append("4_3_letterbox")
     if config.sifteam.switch_4_3_panscan.value == True:
         self.videomodes_enabled.append("4_3_panscan")
     if config.sifteam.switch_16_9.value == True:
         self.videomodes_enabled.append("16_9")
     if config.sifteam.switch_16_9_always.value == True:
         self.videomodes_enabled.append("16_9_always")
     if config.sifteam.switch_16_10_letterbox.value == True:
         self.videomodes_enabled.append("16_10_letterbox")
     if config.sifteam.switch_16_10_panscan.value == True:
         self.videomodes_enabled.append("16_10_panscan")
     if config.sifteam.switch_16_9_letterbox.value == True:
         self.videomodes_enabled.append("16_9_letterbox")
     
     if len(self.videomodes_enabled) < 2:
         return
     
     iAVSwitch = AVSwitch()
     aspectnum = iAVSwitch.getAspectRatioSetting()
     if aspectnum >= len(self.videomodes):
         aspectnum = 0
         
     currentmode = self.videomodes[aspectnum]
     
     aspectnum = 0
     for i in range(0, len(self.videomodes_enabled)):
         if self.videomodes_enabled[i] == currentmode:
             aspectnum = i
             break
             
     aspectnum += 1
     if aspectnum >= len(self.videomodes_enabled):
         aspectnum = 0
         
     newmode = self.videomodes_enabled[aspectnum]
     
     aspectnum = 0
     for i in range(0, len(self.videomodes)):
         if self.videomodes[i] == newmode:
             aspectnum = i
             break
             
     iAVSwitch.setAspectRatio(aspectnum)
     config.av.aspectratio.setValue(self.videomodes[aspectnum])
     self.session.open(VideoSelectionNotify, self.videodescs[aspectnum])
Exemple #7
0
	def switchAspectRatio(self, direction=1):
		if len(self.enabledaspects) < 2:
			return
		iAVSwitch = AVSwitch()
		aspectnum = iAVSwitch.getAspectRatioSetting()
		try:
			localaspectnum = self.enabledaspects.index(aspectnum)
		except ValueError:
			localaspectnum = 0
		newaspectnum = self.enabledaspects[(localaspectnum + direction) % len(self.enabledaspects)]
		iAVSwitch.setAspectRatio(newaspectnum)
		config.av.aspectratio.setValue(ASPECT[newaspectnum])
		if config.plugins.AspectRatioSwitch.showmsg.value:
			Notifications.AddPopup(text=_("Aspect ratio switched from:\n   %s\nto:\n   %s") % (ASPECTMSG[ASPECT[aspectnum]], ASPECTMSG[ASPECT[newaspectnum]]), type=MessageBox.TYPE_INFO, timeout=5, id='AspectRatioSwitch')
			print pluginPrintname, "Aspect ratio switched from %d - %s to %d - %s" % (aspectnum, ASPECT[aspectnum], newaspectnum, ASPECT[newaspectnum])
Exemple #8
0
def autostart(reason, **kwargs):
	#STANDARD beim Systemstart	
	global aspect_ratio_switch
	if reason == 0: # startup
		keymappath = "/usr/share/enigma2/keymap.xml"
		if os.path.exists(keymappath):
			keymapfile = open(keymappath, "r")
			keymaptext = keymapfile.read()
			keymapfile.close()
			changed = False
			if '<key id="KEY_CHANNELUP" mapto="openServiceList" flags="m" />' in keymaptext:
				keymaptext = keymaptext.replace('<key id="KEY_CHANNELUP" mapto="openServiceList" flags="m" />', '<key id="KEY_CHANNELUP" mapto="openServiceList" flags="b" />')
				changed = True
			if '<key id="KEY_CHANNELDOWN" mapto="openServiceList" flags="m" />' in keymaptext:
				keymaptext = keymaptext.replace('<key id="KEY_CHANNELDOWN" mapto="openServiceList" flags="m" />', '<key id="KEY_CHANNELDOWN" mapto="openServiceList" flags="b" />')
				changed = True
			if '<key id="KEY_VIDEO" mapto="showMovies" flags="m" />' in keymaptext:
				keymaptext = keymaptext.replace('<key id="KEY_VIDEO" mapto="showMovies" flags="m" />', '<key id="KEY_VIDEO" mapto="showMovies" flags="b" />')
				changed = True
			if '<key id="KEY_RADIO" mapto="showRadio" flags="m" />' in keymaptext:
				keymaptext = keymaptext.replace('key id="KEY_RADIO" mapto="showRadio" flags="m" />', 'key id="KEY_RADIO" mapto="showRadio" flags="b" />')
				changed = True
			if '<key id="KEY_HELP" mapto="displayHelp" flags="m" />' in keymaptext:
				keymaptext = keymaptext.replace('<key id="KEY_HELP" mapto="displayHelp" flags="m" />', '<key id="KEY_HELP" mapto="displayHelp" flags="b" />')
				changed = True
			if changed:
				print pluginPrintname, "Preparing keymap.xml..."
				keymapfile = open(keymappath, "w")
				keymapfile.write(keymaptext)
				keymapfile.close()
				keymapparser.removeKeymap(keymappath)
				keymapparser.readKeymap(keymappath)
		iAVSwitch = AVSwitch()
		if config.plugins.AspectRatioSwitch.autostart_ratio_enabled.value:
			iAVSwitch.setAspectRatio(int(config.plugins.AspectRatioSwitch.autostart_ratio.value))
			config.av.aspectratio.setValue(ASPECT[int(config.plugins.AspectRatioSwitch.autostart_ratio.value)])
			print pluginPrintname, "startup, keymap =", config.plugins.AspectRatioSwitch.keymap
			print pluginPrintname, "Initially set to:", ASPECT[int(config.plugins.AspectRatioSwitch.autostart_ratio.value)]	
		else:
			print pluginPrintname, "Initiation disabled"

		if config.plugins.AspectRatioSwitch.enabled.value and aspect_ratio_switch is None:
			aspect_ratio_switch = AspectRatioSwitch()
			aspect_ratio_switch.enable()
	elif reason == 1:
		print pluginPrintname, "shutdown"
		if aspect_ratio_switch is not None:
			aspect_ratio_switch.disable()
Exemple #9
0
	def __init__(self, session, StandbyCounterIncrease=True):
		Screen.__init__(self, session)
		self.avswitch = AVSwitch()

		print "enter standby"

		self["actions"] = ActionMap( [ "StandbyActions" ],
		{
			"power": self.Power,
			"discrete_on": self.Power
		}, -1)

		globalActionMap.setEnabled(False)

		from Screens.InfoBar import InfoBar
		self.infoBarInstance = InfoBar.instance
		self.StandbyCounterIncrease = StandbyCounterIncrease
		self.standbyTimeoutTimer = eTimer()
		self.standbyTimeoutTimer.callback.append(self.standbyTimeout)
		self.standbyStopServiceTimer = eTimer()
		self.standbyStopServiceTimer.callback.append(self.stopService)
		self.timeHandler = None

		#mute adc
		self.setMute()

		self.paused_service = None

		self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup()
		service = self.prev_running_service and self.prev_running_service.toString()
		if service:
			if service.rsplit(":", 1)[1].startswith("/"):
				self.paused_service = True
				self.infoBarInstance.pauseService()
		if not self.paused_service:
			self.timeHandler =  eDVBLocalTimeHandler.getInstance()
			if self.timeHandler.ready():
				if self.session.nav.getCurrentlyPlayingServiceOrGroup():
					self.stopService()
				else:
					self.standbyStopServiceTimer.startLongTimer(5)
				self.timeHandler = None
			else:
				self.timeHandler.m_timeUpdated.get().append(self.stopService)

		if self.session.pipshown:
			self.infoBarInstance and hasattr(self.infoBarInstance, "showPiP") and self.infoBarInstance.showPiP()

		#set input to vcr scart
		if SystemInfo["ScartSwitch"]:
			self.avswitch.setInput("SCART")
		else:
			self.avswitch.setInput("AUX")

		gotoShutdownTime = int(config.usage.standby_to_shutdown_timer.value)
		if gotoShutdownTime:
			self.standbyTimeoutTimer.startLongTimer(gotoShutdownTime)

		self.onFirstExecBegin.append(self.__onFirstExecBegin)
		self.onClose.append(self.__onClose)
Exemple #10
0
 def __init__(self, session):
     Screen.__init__(self, session)
     self.skinName = 'Standby'
     self.avswitch = AVSwitch()
     print 'enter standby'
     if getMachineProcModel() in 'ini-7012':
         if path.exists('/proc/stb/lcd/symbol_scrambled'):
             open('/proc/stb/lcd/symbol_scrambled', 'w').write('0')
         if path.exists('/proc/stb/lcd/symbol_1080p'):
             open('/proc/stb/lcd/symbol_1080p', 'w').write('0')
         if path.exists('/proc/stb/lcd/symbol_1080i'):
             open('/proc/stb/lcd/symbol_1080i', 'w').write('0')
         if path.exists('/proc/stb/lcd/symbol_720p'):
             open('/proc/stb/lcd/symbol_720p', 'w').write('0')
         if path.exists('/proc/stb/lcd/symbol_576i'):
             open('/proc/stb/lcd/symbol_576i', 'w').write('0')
         if path.exists('/proc/stb/lcd/symbol_576p'):
             open('/proc/stb/lcd/symbol_576p', 'w').write('0')
         if path.exists('/proc/stb/lcd/symbol_hd'):
             open('/proc/stb/lcd/symbol_hd', 'w').write('0')
         if path.exists('/proc/stb/lcd/symbol_dolby_audio'):
             open('/proc/stb/lcd/symbol_dolby_audio', 'w').write('0')
         if path.exists('/proc/stb/lcd/symbol_mp3'):
             open('/proc/stb/lcd/symbol_mp3', 'w').write('0')
     self['actions'] = ActionMap(['StandbyActions'], {'power': self.Power,
      'discrete_on': self.Power}, -1)
     globalActionMap.setEnabled(False)
     from Screens.InfoBar import InfoBar
     self.infoBarInstance = InfoBar.instance
     self.standbyStopServiceTimer = eTimer()
     self.standbyStopServiceTimer.callback.append(self.stopService)
     self.timeHandler = None
     self.setMute()
     if SystemInfo['Display'] and SystemInfo['LCDMiniTV']:
         setLCDModeMinitTV('0')
     self.paused_service = None
     self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup()
     service = self.prev_running_service and self.prev_running_service.toString()
     if service:
         if service.rsplit(':', 1)[1].startswith('/'):
             self.paused_service = True
             self.infoBarInstance.pauseService()
         else:
             self.timeHandler = eDVBLocalTimeHandler.getInstance()
             if self.timeHandler.ready():
                 if self.session.nav.getCurrentlyPlayingServiceOrGroup():
                     self.stopService()
                 else:
                     self.standbyStopServiceTimer.startLongTimer(5)
                 self.timeHandler = None
             else:
                 self.timeHandler.m_timeUpdated.get().append(self.stopService)
     if self.session.pipshown:
         self.infoBarInstance and hasattr(self.infoBarInstance, 'showPiP') and self.infoBarInstance.showPiP()
     if SystemInfo['ScartSwitch']:
         self.avswitch.setInput('SCART')
     else:
         self.avswitch.setInput('AUX')
     self.onFirstExecBegin.append(self.__onFirstExecBegin)
     self.onClose.append(self.__onClose)
Exemple #11
0
	def __init__(self, session):
		Screen.__init__(self, session)
		self.avswitch = AVSwitch()

		print "enter standby"

		self["actions"] = ActionMap( [ "StandbyActions" ],
		{
			"power": self.Power
		}, -1)

		#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()
		#set input to vcr scart
		if SystemInfo["ScartSwitch"]:
			self.avswitch.setInput("SCART")
		else:
			self.avswitch.setInput("AUX")
		#set lcd brightness to standby value
		config.lcd.standby.apply()
		self.onShow.append(self.__onShow)
		self.onHide.append(self.__onHide)
		self.onClose.append(self.__onClose)
Exemple #12
0
	def __init__(self, session):
		Screen.__init__(self, session)
		self.avswitch = AVSwitch()

		print "enter standby"

		self["actions"] = ActionMap( [ "StandbyActions" ],
		{
			"power": self.Power
		}, -1)

		globalActionMap.setEnabled(False)

		#mute adc
		self.setMute()

		self.paused_service = None
		self.prev_running_service = None
		if self.session.current_dialog:
			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()
			elif self.session.current_dialog.ALLOW_SUSPEND == Screen.SUSPEND_PAUSES:
				self.paused_service = self.session.current_dialog
				self.paused_service.pauseService()

		#set input to vcr scart
		if SystemInfo["ScartSwitch"]:
			self.avswitch.setInput("SCART")
		else:
			self.avswitch.setInput("AUX")
		self.onFirstExecBegin.append(self.__onFirstExecBegin)
		self.onClose.append(self.__onClose)
Exemple #13
0
	def __init__(self, session):
		Screen.__init__(self, session)
		self.skinName = "Standby"
		self.avswitch = AVSwitch()

		print "[Standby] enter standby"

		self["actions"] = ActionMap( [ "StandbyActions" ],
		{
			"power": self.Power,
			"discrete_on": self.Power
		}, -1)

		globalActionMap.setEnabled(False)

		self.standbyTimeUnknownTimer = eTimer()

		#mute adc
		self.setMute()
	
		if SystemInfo["Display"] and SystemInfo["LCDMiniTV"]:
			# set LCDminiTV off
			setLCDModeMinitTV("0")

		self.paused_service = None
		self.prev_running_service = None

		if self.session.current_dialog:
			if self.session.current_dialog.ALLOW_SUSPEND == Screen.SUSPEND_STOPS:
				if localtime(time()).tm_year > 1970 and self.session.nav.getCurrentlyPlayingServiceOrGroup():
					if config.servicelist.startupservice_standby.value:
						self.prev_running_service = eServiceReference(config.servicelist.startupservice_standby.value)
					else:
						self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup()
					self.session.nav.stopService()
				else:
					self.standbyTimeUnknownTimer.callback.append(self.stopService)
					self.standbyTimeUnknownTimer.startLongTimer(60)
			elif self.session.current_dialog.ALLOW_SUSPEND == Screen.SUSPEND_PAUSES:
				self.paused_service = self.session.current_dialog
				self.paused_service.pauseService()
		if self.session.pipshown:
			from Screens.InfoBar import InfoBar
			InfoBar.instance and hasattr(InfoBar.instance, "showPiP") and InfoBar.instance.showPiP()

		#set input to vcr scart
		if SystemInfo["ScartSwitch"]:
			self.avswitch.setInput("SCART")
		else:
			self.avswitch.setInput("AUX")
		if (getBrandOEM() in ('fulan')):
			open("/proc/stb/hdmi/output", "w").write("off")

		if int(config.usage.hdd_standby_in_standby.value) != -1: # HDD standby timer value (box in standby) / -1 = same as when box is active
			for hdd in harddiskmanager.HDDList():
				hdd[1].setIdleTime(int(config.usage.hdd_standby_in_standby.value))

		self.onFirstExecBegin.append(self.__onFirstExecBegin)
		self.onClose.append(self.__onClose)
Exemple #14
0
	def __init__(self, session):
		Screen.__init__(self, session)
		self.skinName = "Standby"
		self.avswitch = AVSwitch()

		print "enter standby"

		self["actions"] = ActionMap( [ "StandbyActions" ],
		{
			"power": self.Power,
			"discrete_on": self.Power
		}, -1)

		globalActionMap.setEnabled(False)

		self.standbyStopServiceTimer = eTimer()
		self.standbyStopServiceTimer.callback.append(self.stopService)
		self.timeHandler = None

		#mute adc
		self.setMute()
	
		if SystemInfo["Display"] and SystemInfo["LCDMiniTV"]:
			# set LCDminiTV off
			setLCDModeMinitTV("0")

		self.paused_service = None
		self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup()
		service = self.prev_running_service and self.prev_running_service.toString()
		if service:
			if service.startswith("1:") and service.rsplit(":", 1)[1].startswith("/"):
				self.paused_service = self.session.current_dialog
				self.paused_service.pauseService()
		if not self.paused_service:
			self.timeHandler =  eDVBLocalTimeHandler.getInstance()
			if self.timeHandler.ready():
				if self.session.nav.getCurrentlyPlayingServiceOrGroup():
					self.stopService()
				else:
					self.standbyStopServiceTimer.startLongTimer(5)
				self.timeHandler = None
			else:
				self.timeHandler.m_timeUpdated.get().append(self.stopService)
		if self.session.pipshown:
			from Screens.InfoBar import InfoBar
			InfoBar.instance and hasattr(InfoBar.instance, "showPiP") and InfoBar.instance.showPiP()

		#set input to vcr scart
		if SystemInfo["ScartSwitch"]:
			self.avswitch.setInput("SCART")
		else:
			self.avswitch.setInput("AUX")

		if int(config.usage.hdd_standby_in_standby.value) != -1: # HDD standby timer value (box in standby) / -1 = same as when box is active
			for hdd in harddiskmanager.HDDList():
				hdd[1].setIdleTime(int(config.usage.hdd_standby_in_standby.value))

		self.onFirstExecBegin.append(self.__onFirstExecBegin)
		self.onClose.append(self.__onClose)
Exemple #15
0
	def __init__(self, session, StandbyCounterIncrease=True):
		Screen.__init__(self, session)
		self.avswitch = AVSwitch()

		print "enter standby"

		self["actions"] = ActionMap( [ "StandbyActions" ],
		{
			"power": self.Power,
			"discrete_on": self.Power
		}, -1)

		globalActionMap.setEnabled(False)

		self.StandbyCounterIncrease = StandbyCounterIncrease

		self.standbyTimeoutTimer = eTimer()
		self.standbyTimeoutTimer.callback.append(self.standbyTimeout)
		self.standbyStopServiceTimer = eTimer()
		self.standbyStopServiceTimer.callback.append(self.stopService)
		self.timeHandler = None

		#mute adc
		self.setMute()

		self.paused_service = None
		self.prev_running_service = None

		if self.session.current_dialog:
			if self.session.current_dialog.ALLOW_SUSPEND == Screen.SUSPEND_STOPS:
				self.timeHandler =  eDVBLocalTimeHandler.getInstance()
				if self.timeHandler.ready():
					if self.session.nav.getCurrentlyPlayingServiceOrGroup():
						self.stopService()
					else:
						self.standbyStopServiceTimer.startLongTimer(5)
					self.timeHandler = None
				else:
					self.timeHandler.m_timeUpdated.get().append(self.stopService)
			elif self.session.current_dialog.ALLOW_SUSPEND == Screen.SUSPEND_PAUSES:
				self.paused_service = self.session.current_dialog
				self.paused_service.pauseService()
		if self.session.pipshown:
			from Screens.InfoBar import InfoBar
			InfoBar.instance and hasattr(InfoBar.instance, "showPiP") and InfoBar.instance.showPiP()

		#set input to vcr scart
		if SystemInfo["ScartSwitch"]:
			self.avswitch.setInput("SCART")
		else:
			self.avswitch.setInput("AUX")
		open("/proc/stb/hdmi/output", "w").write("off")
		gotoShutdownTime = int(config.usage.standby_to_shutdown_timer.value)
		if gotoShutdownTime:
			self.standbyTimeoutTimer.startLongTimer(gotoShutdownTime)

		self.onFirstExecBegin.append(self.__onFirstExecBegin)
		self.onClose.append(self.__onClose)
Exemple #16
0
	def __init__(self, session, start_visible=True):
		Screen.__init__(self, session)

		self.avswitch = AVSwitch()

		if start_visible:
			self.onExecBegin.append(self.showMessageBox)
			self.msgVisible = None
		else:
			self.msgVisible = False
	def __init__(self, session):
		Screen.__init__(self, session)
		self.skinName = "Standby"
		self.avswitch = AVSwitch()

		print "enter standby"

		self["actions"] = ActionMap( [ "StandbyActions" ],
		{
			"power": self.Power,
			"discrete_on": self.Power
		}, -1)

		globalActionMap.setEnabled(False)

		from Screens.InfoBar import InfoBar
		self.infoBarInstance = InfoBar.instance
		self.standbyStopServiceTimer = eTimer()
		self.standbyStopServiceTimer.callback.append(self.stopService)
		self.timeHandler = None

		#mute adc
		self.setMute()

		self.paused_service = None

		self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup()
		service = self.prev_running_service and self.prev_running_service.toString()
		if service:
			if service.rsplit(":", 1)[1].startswith("/"):
				self.paused_service = True
				self.infoBarInstance.pauseService()
			else:
				self.timeHandler =  eDVBLocalTimeHandler.getInstance()
				if self.timeHandler.ready():
					if self.session.nav.getCurrentlyPlayingServiceOrGroup():
						self.stopService()
					else:
						self.standbyStopServiceTimer.startLongTimer(5)
					self.timeHandler = None
				else:
					self.timeHandler.m_timeUpdated.get().append(self.stopService)

		if self.session.pipshown:
			self.infoBarInstance and hasattr(self.infoBarInstance, "showPiP") and self.infoBarInstance.showPiP()

		#set input to vcr scart
		if SystemInfo["ScartSwitch"]:
			self.avswitch.setInput("SCART")
		else:
			self.avswitch.setInput("AUX")
		if (getBrandOEM() in ('fulan')):
			open("/proc/stb/hdmi/output", "w").write("off")
		self.onFirstExecBegin.append(self.__onFirstExecBegin)
		self.onClose.append(self.__onClose)
Exemple #18
0
	def __init__(self, session):
		Screen.__init__(self, session)
		self.skinName = "Standby"
		self.avswitch = AVSwitch()

		print "enter standby"

		self["actions"] = ActionMap( [ "StandbyActions" ],
		{
			"power": self.Power,
			"discrete_on": self.Power
		}, -1)

		globalActionMap.setEnabled(False)

		self.standbyTimeUnknownTimer = eTimer()

		#mute adc
		self.setMute()
	
		if SystemInfo["Display"] and SystemInfo["LCDMiniTV"]:
			# set LCDminiTV off
			setLCDModeMinitTV("0")

		self.paused_service = None
		self.prev_running_service = None

		if self.session.current_dialog:
			if self.session.current_dialog.ALLOW_SUSPEND == Screen.SUSPEND_STOPS:
				if localtime(time()).tm_year > 1970 and self.session.nav.getCurrentlyPlayingServiceOrGroup():
					if config.servicelist.startupservice_standby.value:
						self.prev_running_service = eServiceReference(config.servicelist.startupservice_standby.value)
					else:
						self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup()
					self.session.nav.stopService()
				else:
					self.standbyTimeUnknownTimer.callback.append(self.stopService)
					self.standbyTimeUnknownTimer.startLongTimer(60)
			elif self.session.current_dialog.ALLOW_SUSPEND == Screen.SUSPEND_PAUSES:
				self.paused_service = self.session.current_dialog
				self.paused_service.pauseService()
		if self.session.pipshown:
			from Screens.InfoBar import InfoBar
			InfoBar.instance and hasattr(InfoBar.instance, "showPiP") and InfoBar.instance.showPiP()

		#set input to vcr scart
		if SystemInfo["ScartSwitch"]:
			self.avswitch.setInput("SCART")
		else:
			self.avswitch.setInput("AUX")
		self.onFirstExecBegin.append(self.__onFirstExecBegin)
		self.onClose.append(self.__onClose)
Exemple #19
0
	def __init__(self, session):
		Screen.__init__(self, session)
		self.avswitch = AVSwitch()

		if boxtype == 'gb800se' or boxtype == 'gb800solo' or boxtype == 'gb800ue':	
			self.forled = readled() 
			if self.forled[0] == 'True':
				self.ledenable = 1
			else:
				self.ledenable = 0					 
		
		print "enter standby"

		self["actions"] = ActionMap( [ "StandbyActions" ],
		{
			"power": self.Power,
			"discrete_on": self.Power
		}, -1)

		globalActionMap.setEnabled(False)

		#mute adc
		self.setMute()

		self.paused_service = None
		self.prev_running_service = None
		if self.session.current_dialog:
			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()
			elif self.session.current_dialog.ALLOW_SUSPEND == Screen.SUSPEND_PAUSES:
				self.paused_service = self.session.current_dialog
				self.paused_service.pauseService()

		#set input to vcr scart
		if SystemInfo["ScartSwitch"]:
			self.avswitch.setInput("SCART")
		else:
			self.avswitch.setInput("AUX")
#+++>
		open("/proc/stb/hdmi/output", "w").write("off")
#+++<
		self.onFirstExecBegin.append(self.__onFirstExecBegin)
		self.onClose.append(self.__onClose)
		
		if boxtype == 'gb800se' or boxtype == 'gb800solo' or boxtype == 'gb800ue':
			self.sign = 0
			self.zaPrik = eTimer()
			self.zaPrik.timeout.get().append(self.vrime)
			self.zaPrik.start(1, 1)	
Exemple #20
0
    def __init__(self, session, StandbyCounterIncrease=True):
        Screen.__init__(self, session)
        self.skinName = "Standby"
        self.avswitch = AVSwitch()

        print "enter standby"

        self["actions"] = ActionMap(["StandbyActions"], {"power": self.Power, "discrete_on": self.Power}, -1)

        globalActionMap.setEnabled(False)

        self.StandbyCounterIncrease = StandbyCounterIncrease

        self.standbyTimeUnknownTimer = eTimer()
        self.standbyTimeoutTimer = eTimer()

        # mute adc
        self.setMute()

        # set LCDminiTV off
        if SystemInfo["Display"] and SystemInfo["LCDMiniTV"]:
            setLCDModeMinitTV("0")

        self.paused_service = None
        self.prev_running_service = None

        if self.session.current_dialog:
            if self.session.current_dialog.ALLOW_SUSPEND == Screen.SUSPEND_STOPS:
                if localtime(time()).tm_year > 1970 and self.session.nav.getCurrentlyPlayingServiceOrGroup():
                    self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup()
                    self.session.nav.stopService()
                else:
                    self.standbyTimeUnknownTimer.callback.append(self.stopService)
                    self.standbyTimeUnknownTimer.startLongTimer(60)
            elif self.session.current_dialog.ALLOW_SUSPEND == Screen.SUSPEND_PAUSES:
                self.paused_service = self.session.current_dialog
                self.paused_service.pauseService()

                # set input to vcr scart
        if SystemInfo["ScartSwitch"]:
            self.avswitch.setInput("SCART")
        else:
            self.avswitch.setInput("AUX")

        gotoShutdownTime = int(config.usage.standby_to_shutdown_timer.value)
        if gotoShutdownTime:
            self.standbyTimeoutTimer.callback.append(self.standbyTimeout)
            self.standbyTimeoutTimer.startLongTimer(gotoShutdownTime)

        self.onFirstExecBegin.append(self.__onFirstExecBegin)
        self.onClose.append(self.__onClose)
Exemple #21
0
    def __init__(self, session):
        Screen.__init__(self, session)
        self.skinName = 'Standby'
        self.avswitch = AVSwitch()
        print '[Standby] enter standby'
        self['actions'] = ActionMap(['StandbyActions'], {'power': self.Power,
         'discrete_on': self.Power}, -1)
        globalActionMap.setEnabled(False)
        self.standbyStopServiceTimer = eTimer()
        self.standbyStopServiceTimer.callback.append(self.stopService)
        self.timeHandler = None
        self.setMute()
        if SystemInfo['Display'] and SystemInfo['LCDMiniTV']:
            setLCDModeMinitTV('0')
        self.paused_service = None
        self.prev_running_service = None
        self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup()
        service = self.prev_running_service and self.prev_running_service.toString()
        if service:
            if service.startswith('1:') and service.rsplit(':', 1)[1].startswith('/'):
                self.paused_service = self.session.current_dialog
                self.paused_service.pauseService()
            else:
                self.timeHandler = eDVBLocalTimeHandler.getInstance()
                if self.timeHandler.ready():
                    if self.session.nav.getCurrentlyPlayingServiceOrGroup():
                        self.stopService()
                    else:
                        self.standbyStopServiceTimer.startLongTimer(5)
                    self.timeHandler = None
                else:
                    self.timeHandler.m_timeUpdated.get().append(self.stopService)
        if self.session.pipshown:
            from Screens.InfoBar import InfoBar
            InfoBar.instance and hasattr(InfoBar.instance, 'showPiP') and InfoBar.instance.showPiP()
        if SystemInfo['ScartSwitch']:
            self.avswitch.setInput('SCART')
        else:
            self.avswitch.setInput('AUX')
        if getBrandOEM() in 'fulan':
            open('/proc/stb/hdmi/output', 'w').write('off')
        if int(config.usage.hdd_standby_in_standby.value) != -1:
            for hdd in harddiskmanager.HDDList():
                hdd[1].setIdleTime(int(config.usage.hdd_standby_in_standby.value))

        self.onFirstExecBegin.append(self.__onFirstExecBegin)
        self.onClose.append(self.__onClose)
        return
Exemple #22
0
	def __init__(self, session):
		Screen.__init__(self, session)
		self.avswitch = AVSwitch()

		print "enter standby"

		self["actions"] = ActionMap( [ "StandbyActions" ],
		{
			"power": self.Power
		}, -1)

		globalActionMap.setEnabled(False)

		#mute adc
		self.setMute()

		self.paused_service = None
		self.prev_running_service = None
		self.connected_time_handler = False

		if self.session.current_dialog:
			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()
			elif self.session.current_dialog.ALLOW_SUSPEND == Screen.SUSPEND_PAUSES:
				self.paused_service = self.session.current_dialog
				self.paused_service.pauseService()

		#set input to vcr scart
		if SystemInfo["ScartSwitch"]:
			self.avswitch.setInput("SCART")
		else:
			self.avswitch.setInput("AUX")
		self.onFirstExecBegin.append(self.__onFirstExecBegin)
		self.onClose.append(self.__onClose)

		if config.misc.standbyCounter.value == 0 and config.misc.useTransponderTime.value:
			th = eDVBLocalTimeHandler.getInstance()
			if not th.ready():
				refstr = config.servicelist.lastmode.value == 'tv' and config.tv.lastservice.value or config.radio.lastservice.value
				ref = eServiceReference(refstr)
				if ref.valid():
					th.m_timeUpdated.get().append(self.timeReady)
					self.connected_time_handler = True
					self.session.nav.playService(ref)
Exemple #23
0
    def __init__(self, session):
        Screen.__init__(self, session)
        self.skinName = "Standby"
        self.avswitch = AVSwitch()

        print "enter standby"

        self["actions"] = ActionMap(["StandbyActions"], {
            "power": self.Power,
            "discrete_on": self.Power
        }, -1)

        globalActionMap.setEnabled(False)

        self.standbyTimeUnknownTimer = eTimer()

        #mute adc
        self.setMute()

        self.paused_service = None
        self.prev_running_service = None

        if self.session.current_dialog:
            if self.session.current_dialog.ALLOW_SUSPEND == Screen.SUSPEND_STOPS:
                if localtime(
                        time()
                ).tm_year > 1970 and self.session.nav.getCurrentlyPlayingServiceOrGroup(
                ):
                    self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup(
                    )
                    self.session.nav.stopService()
                else:
                    self.standbyTimeUnknownTimer.callback.append(
                        self.stopService)
                    self.standbyTimeUnknownTimer.startLongTimer(60)
            elif self.session.current_dialog.ALLOW_SUSPEND == Screen.SUSPEND_PAUSES:
                self.paused_service = self.session.current_dialog
                self.paused_service.pauseService()

        #set input to vcr scart
        if SystemInfo["ScartSwitch"]:
            self.avswitch.setInput("SCART")
        else:
            self.avswitch.setInput("AUX")
        self.onFirstExecBegin.append(self.__onFirstExecBegin)
        self.onClose.append(self.__onClose)
Exemple #24
0
	def __init__(self, session, StandbyCounterIncrease=True):
		Screen.__init__(self, session)
		self.avswitch = AVSwitch()

		print "enter standby"

		self["actions"] = ActionMap( [ "StandbyActions" ],
		{
			"power": self.Power
		}, -1)

		globalActionMap.setEnabled(False)

		self.StandbyCounterIncrease = StandbyCounterIncrease

		#mute adc
		self.setMute()

		self.paused_service = None
		self.prev_running_service = None
		if self.session.current_dialog:
			if self.session.current_dialog.ALLOW_SUSPEND == Screen.SUSPEND_STOPS:
				#get currently playing service reference
				self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup()
				#stop actual played dvb-service
				self.session.nav.stopService()
			elif self.session.current_dialog.ALLOW_SUSPEND == Screen.SUSPEND_PAUSES:
				self.paused_service = self.session.current_dialog
				self.paused_service.pauseService()

		#set input to vcr scart
		if SystemInfo["ScartSwitch"]:
			self.avswitch.setInput("SCART")
		else:
			self.avswitch.setInput("AUX")

		gotoShutdownTime = int(config.usage.standby_to_shutdown_timer.value)
		if gotoShutdownTime:
			self.standbyTimeoutTimer = eTimer()
			self.standbyTimeoutTimer.callback.append(self.standbyTimeout)
			self.standbyTimeoutTimer.startLongTimer(gotoShutdownTime)

		self.onFirstExecBegin.append(self.__onFirstExecBegin)
		self.onClose.append(self.__onClose)
Exemple #25
0
class Scart(Screen):

    def __init__(self, session, start_visible = True):
        Screen.__init__(self, session)
        self.msgBox = None
        self.notificationVisible = None
        self.avswitch = AVSwitch()
        if start_visible:
            self.onExecBegin.append(self.showMessageBox)
            self.msgVisible = None
        else:
            self.msgVisible = False
        return

    def showMessageBox(self):
        if self.msgVisible is None:
            self.onExecBegin.remove(self.showMessageBox)
            self.msgVisible = False
        if not self.msgVisible:
            self.msgVisible = True
            self.avswitch.setInput('SCART')
            if not self.session.in_exec:
                self.notificationVisible = True
                Notifications.AddNotificationWithCallback(self.MsgBoxClosed, MessageBox, _('If you see this, something is wrong with\nyour scart connection. Press OK to return.'), MessageBox.TYPE_ERROR, msgBoxID='scart_msgbox')
            else:
                self.msgBox = self.session.openWithCallback(self.MsgBoxClosed, MessageBox, _('If you see this, something is wrong with\nyour scart connection. Press OK to return.'), MessageBox.TYPE_ERROR)
        return

    def MsgBoxClosed(self, *val):
        self.msgBox = None
        self.switchToTV()
        return

    def switchToTV(self, *val):
        if self.msgVisible:
            if self.msgBox:
                self.msgBox.close()
                return
            self.avswitch.setInput('ENCODER')
            self.msgVisible = False
        if self.notificationVisible:
            self.avswitch.setInput('ENCODER')
            self.notificationVisible = False
            for notification in Notifications.current_notifications:
                try:
                    if notification[1].msgBoxID == 'scart_msgbox':
                        notification[1].close()
                except:
                    print 'other notification is open. try another one.'
Exemple #26
0
    def __init__(self, session, args=None, picPath=None):
        self.skin_lines = []
        Screen.__init__(self, session)
        self.session = session
        self.datei = "/usr/share/enigma2/MetrixHD_MOD/skin.xml"
        self.dateiTMP = "/usr/share/enigma2/MetrixHD_MOD/skin.xml.tmp"
        self.daten = "/usr/lib/enigma2/python/Plugins/Extensions/MyMetrixMOD/data/"
        self.komponente = "/usr/lib/enigma2/python/Plugins/Extensions/MyMetrixMOD/comp/"
        self.picPath = picPath
        self.Scale = AVSwitch().getFramebufferScale()
        self.PicLoad = ePicLoad()
        self["helperimage"] = Pixmap()
        list = []
        list.append(
            getConfigListEntry(_("MetrixImage"),
                               config.plugins.MyMetrixMOD.Image))
        list.append(
            getConfigListEntry(_("MetrixColor"),
                               config.plugins.MyMetrixMOD.SkinColor))
        list.append(
            getConfigListEntry(
                _("----------------------------- MetrixWeather  --------------------------------"
                  ), ))
        list.append(
            getConfigListEntry(_("MetrixWeather ID"),
                               config.plugins.MetrixWeather.woeid))
        list.append(
            getConfigListEntry(_("Unit"),
                               config.plugins.MetrixWeather.tempUnit))
        list.append(
            getConfigListEntry(_("Refresh Interval (min)"),
                               config.plugins.MetrixWeather.refreshInterval))
        list.append(
            getConfigListEntry(
                _("-------------------------------- InfoBar ------------------------------------"
                  ), ))
        list.append(
            getConfigListEntry(
                _("Weather Widget"),
                config.plugins.MyMetrixMOD.InfobarWeatherWidget))
        list.append(
            getConfigListEntry(
                _("Channel name"),
                config.plugins.MyMetrixMOD.InfobarShowChannelname))
        list.append(
            getConfigListEntry(
                _("Show resolution info"),
                config.plugins.MyMetrixMOD.InfobarResolutionInfo))
        list.append(
            getConfigListEntry(_("Show crypt info"),
                               config.plugins.MyMetrixMOD.InfobarCryptInfo))
        list.append(
            getConfigListEntry(_("Show ECM info"),
                               config.plugins.MyMetrixMOD.InfobarECMInfo))
        list.append(
            getConfigListEntry(_("Show Sat Position"),
                               config.plugins.MyMetrixMOD.InfobarSatPosition))
        list.append(
            getConfigListEntry(_("Show SNR"),
                               config.plugins.MyMetrixMOD.InfobarSNR))
        list.append(
            getConfigListEntry(_("Show tuner info"),
                               config.plugins.MyMetrixMOD.InfobarTunerInfo))
        list.append(
            getConfigListEntry(
                _("---------------------------- ChannelSelection -------------------------------"
                  ), ))
        list.append(
            getConfigListEntry(
                _("Extended Description Fontsize"),
                config.plugins.MyMetrixMOD.ChannelSelectionFontSize))
        list.append(
            getConfigListEntry(
                _("---------------------------- EPGSelection -------------------------------"
                  ), ))
        list.append(
            getConfigListEntry(_("EPGSelection Style"),
                               config.plugins.MyMetrixMOD.EPGSelectionStyle))

        ConfigListScreen.__init__(self, list)
        self["actions"] = ActionMap(
            [
                "OkCancelActions", "DirectionActions", "InputActions",
                "ColorActions"
            ], {
                "left": self.keyLeft,
                "down": self.keyDown,
                "up": self.keyUp,
                "right": self.keyRight,
                "red": self.exit,
                "yellow": self.reboot,
                "blue": self.showInfo,
                "green": self.save,
                "cancel": self.exit
            }, -1)
        self.onLayoutFinish.append(self.UpdatePicture)
    def __init__(self, session, args = None):
        Screen.__init__(self, session)
        self.session = session
        self.Scale = AVSwitch().getFramebufferScale()
        self.PicLoad = ePicLoad()

        self["HelpWindow"] = Pixmap()
        self["HelpWindow"].hide()

        self["helperimage"] = Pixmap()
        self["helpertext"] = Label()

        self["titleText"] = StaticText("")
        self["titleText"].setText(_("Backup & Restore my settings"))

        self["cancelBtn"] = StaticText("")
        self["cancelBtn"].setText(_("Cancel"))

        self["saveBtn"] = StaticText("")
        self["saveBtn"].setText(_("Backup"))

        self["loadBtn"] = StaticText("")
        self["loadBtn"].setText(_("Restore"))

        self["deleteBtn"] = StaticText("")
        self["deleteBtn"].setText(_("Delete"))

        initColorsConfig()
        initWeatherConfig()
        initOtherConfig()
        initFontsConfig()

        self.myset = ConfigSelectionNumber(1, 99, 1, default = 1, wraparound = True)
        self.myname = ConfigText(default = _("My Backup No. %s") % str(self.myset.value), visible_width = 50, fixed_size = False)
        self.mydate = ""
        self.mylastBackup = ""
        self.mylastRestore = ""
        self.file = []

        ConfigListScreen.__init__(
            self,
            self.getMenuItemList(),
            session = session,
            on_change = self.__changedEntry
        )

        self["actions"] = ActionMap(
        [
            "OkCancelActions",
            "DirectionActions",
            "InputActions",
            "ColorActions"
        ],
        {
            "left": self.keyLeft,
            "down": self.keyDown,
            "up": self.keyUp,
            "right": self.keyRight,
            "red": self.exit,
            "green": self.restoreQ,
            "yellow": self.backupQ,
            "blue": self.deleteQ,
            "cancel": self.exit,
            "ok": self.renameName
        }, -1)

        self.__changedEntry(True)
        self.onLayoutFinish.append(self.UpdatePicture)
Exemple #28
0
    def __init__(self, session):
        Screen.__init__(self, session)
        self.skinName = "Standby"
        self.avswitch = AVSwitch()

        print "[Standby] enter standby"

        if os.path.exists("/usr/scripts/standby_enter.sh"):
            Console().ePopen("/usr/scripts/standby_enter.sh")

        self["actions"] = ActionMap(["StandbyActions"], {
            "power": self.Power,
            "discrete_on": self.Power
        }, -1)

        globalActionMap.setEnabled(False)

        from Screens.InfoBar import InfoBar
        self.infoBarInstance = InfoBar.instance
        self.standbyStopServiceTimer = eTimer()
        self.standbyStopServiceTimer.callback.append(self.stopService)
        self.timeHandler = None

        self.setMute()

        if SystemInfo["Display"] and SystemInfo["LCDMiniTV"]:
            # set LCDminiTV off
            setLCDMiniTVMode("0")

        self.paused_service = self.paused_action = False

        self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup(
        )
        if Components.ParentalControl.parentalControl.isProtected(
                self.prev_running_service):
            self.prev_running_service = eServiceReference(
                config.tv.lastservice.value)
        service = self.prev_running_service and self.prev_running_service.toString(
        )
        if service:
            if service.rsplit(":", 1)[1].startswith("/"):
                self.paused_service = hasattr(
                    self.session.current_dialog, "pauseService") and hasattr(
                        self.session.current_dialog, "unPauseService"
                    ) and self.session.current_dialog or self.infoBarInstance
                self.paused_action = hasattr(
                    self.paused_service, "seekstate"
                ) and hasattr(
                    self.paused_service, "SEEK_STATE_PLAY"
                ) and self.paused_service.seekstate == self.paused_service.SEEK_STATE_PLAY
                self.paused_action and self.paused_service.pauseService()
        if not self.paused_service:
            self.timeHandler = eDVBLocalTimeHandler.getInstance()
            if self.timeHandler.ready():
                if self.session.nav.getCurrentlyPlayingServiceOrGroup():
                    self.stopService()
                else:
                    self.standbyStopServiceTimer.startLongTimer(5)
                self.timeHandler = None
            else:
                self.timeHandler.m_timeUpdated.get().append(self.stopService)

        if self.session.pipshown:
            self.infoBarInstance and hasattr(
                self.infoBarInstance,
                "showPiP") and self.infoBarInstance.showPiP()

        if SystemInfo["ScartSwitch"]:
            self.avswitch.setInput("SCART")
        else:
            self.avswitch.setInput("AUX")
        self.onFirstExecBegin.append(self.__onFirstExecBegin)
        self.onClose.append(self.__onClose)
Exemple #29
0
class Standby2(Screen):
    def Power(self):
        print "leave standby"
        if (getBrandOEM() in ('fulan')):
            open("/proc/stb/hdmi/output", "w").write("on")
        #set input to encoder
        self.avswitch.setInput("ENCODER")
        #restart last played service
        #unmute adc
        self.leaveMute()
        # set LCDminiTV
        if SystemInfo["Display"] and SystemInfo["LCDMiniTV"]:
            setLCDModeMinitTV(config.lcd.modeminitv.value)
        #remove wakup files and reset wakup state
        PowerTimer.resetTimerWakeup()
        RecordTimer.resetTimerWakeup()
        #kill me
        self.close(True)

    def setMute(self):
        if eDVBVolumecontrol.getInstance().isMuted():
            self.wasMuted = 1
            print "mute already active"
        else:
            self.wasMuted = 0
            eDVBVolumecontrol.getInstance().volumeToggleMute()

    def leaveMute(self):
        if self.wasMuted == 0:
            eDVBVolumecontrol.getInstance().volumeToggleMute()

    def __init__(self, session):
        Screen.__init__(self, session)
        self.skinName = "Standby"
        self.avswitch = AVSwitch()

        print "enter standby"

        self["actions"] = ActionMap(["StandbyActions"], {
            "power": self.Power,
            "discrete_on": self.Power
        }, -1)

        globalActionMap.setEnabled(False)

        self.standbyTimeUnknownTimer = eTimer()

        #mute adc
        self.setMute()

        if SystemInfo["Display"] and SystemInfo["LCDMiniTV"]:
            # set LCDminiTV off
            setLCDModeMinitTV("0")

        self.paused_service = None
        self.prev_running_service = None

        if self.session.current_dialog:
            if self.session.current_dialog.ALLOW_SUSPEND == Screen.SUSPEND_STOPS:
                if localtime(
                        time()
                ).tm_year > 1970 and self.session.nav.getCurrentlyPlayingServiceOrGroup(
                ):
                    if config.servicelist.startupservice_standby.value:
                        self.prev_running_service = eServiceReference(
                            config.servicelist.startupservice_standby.value)
                    else:
                        self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup(
                        )
                    self.session.nav.stopService()
                else:
                    self.standbyTimeUnknownTimer.callback.append(
                        self.stopService)
                    self.standbyTimeUnknownTimer.startLongTimer(60)
            elif self.session.current_dialog.ALLOW_SUSPEND == Screen.SUSPEND_PAUSES:
                self.paused_service = self.session.current_dialog
                self.paused_service.pauseService()
        if self.session.pipshown:
            from Screens.InfoBar import InfoBar
            InfoBar.instance and hasattr(
                InfoBar.instance, "showPiP") and InfoBar.instance.showPiP()

        #set input to vcr scart
        if SystemInfo["ScartSwitch"]:
            self.avswitch.setInput("SCART")
        else:
            self.avswitch.setInput("AUX")
        if (getBrandOEM() in ('fulan')):
            open("/proc/stb/hdmi/output", "w").write("off")
        self.onFirstExecBegin.append(self.__onFirstExecBegin)
        self.onClose.append(self.__onClose)

    def __onClose(self):
        global inStandby
        inStandby = None
        self.standbyTimeUnknownTimer.stop()
        if self.prev_running_service:
            self.session.nav.playService(self.prev_running_service)
        elif self.paused_service:
            self.paused_service.unPauseService()
        self.session.screen["Standby"].boolean = False
        globalActionMap.setEnabled(True)

    def __onFirstExecBegin(self):
        global inStandby
        inStandby = self
        self.session.screen["Standby"].boolean = True
        config.misc.standbyCounter.value += 1

    def createSummary(self):
        return StandbySummary

    def stopService(self):
        if config.servicelist.startupservice_standby.value:
            self.prev_running_service = eServiceReference(
                config.servicelist.startupservice_standby.value)
        else:
            self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup(
            )
        self.session.nav.stopService()
Exemple #30
0
    def __init__(self, session):
        Screen.__init__(self, session)
        self.skinName = "Standby"
        self.avswitch = AVSwitch()

        print "[Standby] enter standby"
        SystemInfo["StandbyState"] = True

        if os.path.exists("/usr/script/StandbyEnter.sh"):
            Console().ePopen("/usr/script/StandbyEnter.sh &")

        self["actions"] = ActionMap(
            ["StandbyActions"], {
                "power": self.Power,
                "power_make": self.Power_make,
                "power_break": self.Power_break,
                "power_long": self.Power_long,
                "power_repeat": self.Power_repeat,
                "discrete_on": self.Power
            }, -1)

        globalActionMap.setEnabled(False)

        self.ignoreKeyBreakTimer = eTimer()
        self.standbyStopServiceTimer = eTimer()
        self.standbyStopServiceTimer.callback.append(self.stopService)
        self.timeHandler = None

        #mute adc
        self.setMute()

        if SystemInfo["Display"] and SystemInfo["LCDMiniTV"]:
            # set LCDminiTV off
            setLCDModeMinitTV("0")

        self.paused_service = None
        self.prev_running_service = None

        self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup(
        )
        service = self.prev_running_service and self.prev_running_service.toString(
        )
        if service:
            if service.startswith("1:") and service.rsplit(
                    ":", 1)[1].startswith("/"):
                self.paused_service = self.session.current_dialog
                self.paused_service.pauseService()
        if not self.paused_service:
            self.timeHandler = eDVBLocalTimeHandler.getInstance()
            if self.timeHandler.ready():
                if self.session.nav.getCurrentlyPlayingServiceOrGroup():
                    self.stopService()
                else:
                    self.standbyStopServiceTimer.startLongTimer(5)
                self.timeHandler = None
            else:
                if config.misc.SyncTimeUsing.value == 0:
                    self.timeHandler.m_timeUpdated.get().append(
                        self.stopService)
                else:
                    self.standbyStopServiceTimer.startLongTimer(5)
                    self.timeHandler = None

        if self.session.pipshown:
            from Screens.InfoBar import InfoBar
            InfoBar.instance and hasattr(
                InfoBar.instance, "showPiP") and InfoBar.instance.showPiP()

        #set input to vcr scart
        if SystemInfo["ScartSwitch"]:
            self.avswitch.setInput("SCART")
        else:
            self.avswitch.setInput("AUX")
        if (getBrandOEM() in ('fulan', 'clap', 'dinobot') or getMachineBuild()
                in ('gbmv200', 'sf8008', 'sf8008m', 'ustym4kpro', 'beyonwizv2',
                    'viper4k')):
            try:
                open("/proc/stb/hdmi/output", "w").write("off")
            except:
                pass

        if int(
                config.usage.hdd_standby_in_standby.value
        ) != -1:  # HDD standby timer value (box in standby) / -1 = same as when box is active
            for hdd in harddiskmanager.HDDList():
                hdd[1].setIdleTime(
                    int(config.usage.hdd_standby_in_standby.value))

        self.onFirstExecBegin.append(self.__onFirstExecBegin)
        self.onClose.append(self.__onClose)
Exemple #31
0
class Standby2(Screen):
    def Power(self):
        print "[Standby] leave standby"
        if (getBrandOEM() in ('fulan')):
            open("/proc/stb/hdmi/output", "w").write("on")
        #set input to encoder
        self.avswitch.setInput("ENCODER")
        #restart last played service
        #unmute adc
        self.leaveMute()
        # set LCDminiTV
        if SystemInfo["Display"] and SystemInfo["LCDMiniTV"]:
            setLCDModeMinitTV(config.lcd.modeminitv.value)
        #kill me
        self.close(True)

    def setMute(self):
        if eDVBVolumecontrol.getInstance().isMuted():
            self.wasMuted = 1
            print "[Standby] mute already active"
        else:
            self.wasMuted = 0
            eDVBVolumecontrol.getInstance().volumeToggleMute()

    def leaveMute(self):
        if self.wasMuted == 0:
            eDVBVolumecontrol.getInstance().volumeToggleMute()

    def __init__(self, session):
        Screen.__init__(self, session)
        self.skinName = "Standby"
        self.avswitch = AVSwitch()

        print "[Standby] enter standby"

        self["actions"] = ActionMap(["StandbyActions"], {
            "power": self.Power,
            "discrete_on": self.Power
        }, -1)

        globalActionMap.setEnabled(False)

        self.standbyStopServiceTimer = eTimer()
        self.standbyStopServiceTimer.callback.append(self.stopService)
        self.timeHandler = None

        #mute adc
        self.setMute()

        if SystemInfo["Display"] and SystemInfo["LCDMiniTV"]:
            # set LCDminiTV off
            setLCDModeMinitTV("0")

        self.paused_service = None
        self.prev_running_service = None

        self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup(
        )
        service = self.prev_running_service and self.prev_running_service.toString(
        )
        if service:
            if service.startswith("1:") and service.rsplit(
                    ":", 1)[1].startswith("/"):
                self.paused_service = self.session.current_dialog
                self.paused_service.pauseService()
        if not self.paused_service:
            self.timeHandler = eDVBLocalTimeHandler.getInstance()
            if self.timeHandler.ready():
                if self.session.nav.getCurrentlyPlayingServiceOrGroup():
                    self.stopService()
                else:
                    self.standbyStopServiceTimer.startLongTimer(5)
                self.timeHandler = None
            else:
                self.timeHandler.m_timeUpdated.get().append(self.stopService)

        if self.session.pipshown:
            from Screens.InfoBar import InfoBar
            InfoBar.instance and hasattr(
                InfoBar.instance, "showPiP") and InfoBar.instance.showPiP()

        #set input to vcr scart
        if SystemInfo["ScartSwitch"]:
            self.avswitch.setInput("SCART")
        else:
            self.avswitch.setInput("AUX")
        if (getBrandOEM() in ('fulan')):
            open("/proc/stb/hdmi/output", "w").write("off")

        if int(
                config.usage.hdd_standby_in_standby.value
        ) != -1:  # HDD standby timer value (box in standby) / -1 = same as when box is active
            for hdd in harddiskmanager.HDDList():
                hdd[1].setIdleTime(
                    int(config.usage.hdd_standby_in_standby.value))

        self.onFirstExecBegin.append(self.__onFirstExecBegin)
        self.onClose.append(self.__onClose)

    def __onClose(self):
        global inStandby
        inStandby = None
        self.standbyStopServiceTimer.stop()
        self.timeHandler and self.timeHandler.m_timeUpdated.get().remove(
            self.stopService)
        if self.paused_service:
            self.paused_service.unPauseService()
        elif self.prev_running_service:
            service = self.prev_running_service.toString()
            if config.servicelist.startupservice_onstandby.value:
                self.session.nav.playService(
                    eServiceReference(config.servicelist.startupservice.value))
                from Screens.InfoBar import InfoBar
                InfoBar.instance and InfoBar.instance.servicelist.correctChannelNumber(
                )
            else:
                self.session.nav.playService(self.prev_running_service)
        self.session.screen["Standby"].boolean = False
        globalActionMap.setEnabled(True)
        for hdd in harddiskmanager.HDDList():
            hdd[1].setIdleTime(int(config.usage.hdd_standby.value)
                               )  # HDD standby timer value (box active)

    def __onFirstExecBegin(self):
        global inStandby
        inStandby = self
        self.session.screen["Standby"].boolean = True
        config.misc.standbyCounter.value += 1

    def createSummary(self):
        return StandbySummary

    def stopService(self):
        self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup(
        )
        self.session.nav.stopService()
class Standby2(Screen):
    def Power(self):
        print "leave standby"
        if (getBrandOEM() in ('fulan', 'clap', 'dinobot')
                or getBoxType() in ('sf8008', 'ustym4kpro')):
            try:
                open("/proc/stb/hdmi/output", "w").write("on")
            except:
                pass
        #set input to encoder
        self.avswitch.setInput("ENCODER")
        #restart last played service
        #unmute adc
        self.leaveMute()
        self.session.nav.playService(self.oldService)
        # set LCDminiTV

        if SystemInfo["Display"] and SystemInfo["LCDMiniTV"]:
            setLCDModeMinitTV(config.lcd.modeminitv.value)
        elif SystemInfo["Display"] and SystemInfo["LCDMiniTV4k"]:
            setLCDModeMinitTV4k(config.lcd.modeminitv4k.value)
        #kill me
        self.close(True)

    def setMute(self):
        if eDVBVolumecontrol.getInstance().isMuted():
            self.wasMuted = 1
            print "mute already active"
        else:
            self.wasMuted = 0
            eDVBVolumecontrol.getInstance().volumeToggleMute()

    def leaveMute(self):
        if self.wasMuted == 0:
            eDVBVolumecontrol.getInstance().volumeToggleMute()

    def __init__(self, session):
        Screen.__init__(self, session)
        self.skinName = "Standby"
        self.avswitch = AVSwitch()

        print "enter standby"

        if getMachineProcModel() in ('ini-7012'):
            if path.exists("/proc/stb/lcd/symbol_scrambled"):
                open("/proc/stb/lcd/symbol_scrambled", "w").write("0")

            if path.exists("/proc/stb/lcd/symbol_1080p"):
                open("/proc/stb/lcd/symbol_1080p", "w").write("0")

            if path.exists("/proc/stb/lcd/symbol_1080i"):
                open("/proc/stb/lcd/symbol_1080i", "w").write("0")

            if path.exists("/proc/stb/lcd/symbol_720p"):
                open("/proc/stb/lcd/symbol_720p", "w").write("0")

            if path.exists("/proc/stb/lcd/symbol_576i"):
                open("/proc/stb/lcd/symbol_576i", "w").write("0")

            if path.exists("/proc/stb/lcd/symbol_576p"):
                open("/proc/stb/lcd/symbol_576p", "w").write("0")

            if path.exists("/proc/stb/lcd/symbol_hd"):
                open("/proc/stb/lcd/symbol_hd", "w").write("0")

            if path.exists("/proc/stb/lcd/symbol_dolby_audio"):
                open("/proc/stb/lcd/symbol_dolby_audio", "w").write("0")

            if path.exists("/proc/stb/lcd/symbol_mp3"):
                open("/proc/stb/lcd/symbol_mp3", "w").write("0")

        self["actions"] = ActionMap(["StandbyActions"], {
            "power": self.Power,
            "discrete_on": self.Power
        }, -1)

        globalActionMap.setEnabled(False)

        #mute adc
        self.setMute()
        self.stopService()
        if SystemInfo["Display"] and SystemInfo["LCDMiniTV"]:
            # set LCDminiTV off
            setLCDModeMinitTV("0")
        elif SystemInfo["Display"] and SystemInfo["LCDMiniTV4k"]:
            # set LCDminiTV off
            setLCDModeMinitTV4k("disable")

        self.paused_service = None
        self.prev_running_service = None
        if self.session.current_dialog:
            if self.session.current_dialog.ALLOW_SUSPEND == Screen.SUSPEND_STOPS:
                #get currently playing service reference
                self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup(
                )
                #stop actual played dvb-service
                self.session.nav.stopService()
            elif self.session.current_dialog.ALLOW_SUSPEND == Screen.SUSPEND_PAUSES:
                self.paused_service = self.session.current_dialog
                self.paused_service.pauseService()

        #set input to vcr scart
        if SystemInfo["ScartSwitch"]:
            self.avswitch.setInput("SCART")
        else:
            self.avswitch.setInput("AUX")

        gotoShutdownTime = int(config.usage.standby_to_shutdown_timer.value)
        print "goto deep2"
        if gotoShutdownTime:
            print "goto deep3"
            self.standbyTimeoutTimer = eTimer()
            self.standbyTimeoutTimer.callback.append(self.standbyTimeout)
            self.standbyTimeoutTimer.startLongTimer(gotoShutdownTime)

        if (getBrandOEM() in ('fulan', 'clap', 'dinobot')
                or getBoxType() in ('sf8008', 'ustym4kpro')):
            try:
                open("/proc/stb/hdmi/output", "w").write("off")
            except:
                pass
        self.onFirstExecBegin.append(self.__onFirstExecBegin)
        self.onClose.append(self.__onClose)

    def __onClose(self):
        global inStandby
        inStandby = None
        if self.prev_running_service:
            self.session.nav.playService(self.prev_running_service)
        elif self.paused_service:
            self.paused_service.unPauseService()
        self.session.screen["Standby"].boolean = False
        globalActionMap.setEnabled(True)
        print "goto deep1"
        Notifications.RemovePopup(id="RecordTimerQuitMainloop")

    def __onFirstExecBegin(self):
        global inStandby
        inStandby = self
        self.session.screen["Standby"].boolean = True
        config.misc.standbyCounter.value += 1

    def createSummary(self):
        return StandbySummary

    def standbyTimeout(self):
        print "goto deep3"
        from RecordTimer import RecordTimerEntry
        RecordTimerEntry.TryQuitMainloop()

    def stopService(self):
        if config.servicelist.startupservice_standby.value:
            self.oldService = eServiceReference(
                config.servicelist.startupservice_standby.value)
        else:
            self.oldService = self.session.nav.getCurrentlyPlayingServiceReference(
            )
        self.session.nav.stopService()
Exemple #33
0
    def __init__(self, session):
        Screen.__init__(self, session)
        self.skinName = "Standby"
        self.avswitch = AVSwitch()

        print "[Standby] enter standby"

        self["actions"] = ActionMap(["StandbyActions"], {
            "power": self.Power,
            "discrete_on": self.Power
        }, -1)

        globalActionMap.setEnabled(False)

        self.standbyStopServiceTimer = eTimer()
        self.standbyStopServiceTimer.callback.append(self.stopService)
        self.timeHandler = None

        #mute adc
        self.setMute()

        if SystemInfo["Display"] and SystemInfo["LCDMiniTV"]:
            # set LCDminiTV off
            setLCDModeMinitTV("0")

        self.paused_service = None
        self.prev_running_service = None

        self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup(
        )
        service = self.prev_running_service and self.prev_running_service.toString(
        )
        if service:
            if service.startswith("1:") and service.rsplit(
                    ":", 1)[1].startswith("/"):
                self.paused_service = self.session.current_dialog
                self.paused_service.pauseService()
        if not self.paused_service:
            self.timeHandler = eDVBLocalTimeHandler.getInstance()
            if self.timeHandler.ready():
                if self.session.nav.getCurrentlyPlayingServiceOrGroup():
                    self.stopService()
                else:
                    self.standbyStopServiceTimer.startLongTimer(5)
                self.timeHandler = None
            else:
                self.timeHandler.m_timeUpdated.get().append(self.stopService)

        if self.session.pipshown:
            from Screens.InfoBar import InfoBar
            InfoBar.instance and hasattr(
                InfoBar.instance, "showPiP") and InfoBar.instance.showPiP()

        #set input to vcr scart
        if SystemInfo["ScartSwitch"]:
            self.avswitch.setInput("SCART")
        else:
            self.avswitch.setInput("AUX")
        if (getBrandOEM() in ('fulan')):
            open("/proc/stb/hdmi/output", "w").write("off")

        if int(
                config.usage.hdd_standby_in_standby.value
        ) != -1:  # HDD standby timer value (box in standby) / -1 = same as when box is active
            for hdd in harddiskmanager.HDDList():
                hdd[1].setIdleTime(
                    int(config.usage.hdd_standby_in_standby.value))

        self.onFirstExecBegin.append(self.__onFirstExecBegin)
        self.onClose.append(self.__onClose)
	def __init__(self, width, height, sc=None):
		self.picload = ePicLoad()
		if not sc:
			sc = AVSwitch().getFramebufferScale()
		# max width, max height, aspect x, aspect y, cache, quality (0 = simple, 1 = better, 2 = fast), backgroundcolor
		self.picload.setPara((width, height, sc[0], sc[1], False, 1, "#ff000000"))
Exemple #35
0
class Standby2(Screen):
    def Power(self):
        print "[Standby] leave standby"
        self.close(True)

    def setMute(self):
        self.wasMuted = eDVBVolumecontrol.getInstance().isMuted()
        if not self.wasMuted:
            eDVBVolumecontrol.getInstance().volumeMute()

    def leaveMute(self):
        if not self.wasMuted:
            eDVBVolumecontrol.getInstance().volumeUnMute()

    def __init__(self, session):
        Screen.__init__(self, session)
        self.skinName = "Standby"
        self.avswitch = AVSwitch()

        print "[Standby] enter standby"

        if os.path.exists("/usr/scripts/standby_enter.sh"):
            Console().ePopen("/usr/scripts/standby_enter.sh")

        self["actions"] = ActionMap(["StandbyActions"], {
            "power": self.Power,
            "discrete_on": self.Power
        }, -1)

        globalActionMap.setEnabled(False)

        from Screens.InfoBar import InfoBar
        self.infoBarInstance = InfoBar.instance
        self.standbyStopServiceTimer = eTimer()
        self.standbyStopServiceTimer.callback.append(self.stopService)
        self.timeHandler = None

        self.setMute()

        if SystemInfo["Display"] and SystemInfo["LCDMiniTV"]:
            # set LCDminiTV off
            setLCDMiniTVMode("0")

        self.paused_service = self.paused_action = False

        self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup(
        )
        if Components.ParentalControl.parentalControl.isProtected(
                self.prev_running_service):
            self.prev_running_service = eServiceReference(
                config.tv.lastservice.value)
        service = self.prev_running_service and self.prev_running_service.toString(
        )
        if service:
            if service.rsplit(":", 1)[1].startswith("/"):
                self.paused_service = hasattr(
                    self.session.current_dialog, "pauseService") and hasattr(
                        self.session.current_dialog, "unPauseService"
                    ) and self.session.current_dialog or self.infoBarInstance
                self.paused_action = hasattr(
                    self.paused_service, "seekstate"
                ) and hasattr(
                    self.paused_service, "SEEK_STATE_PLAY"
                ) and self.paused_service.seekstate == self.paused_service.SEEK_STATE_PLAY
                self.paused_action and self.paused_service.pauseService()
        if not self.paused_service:
            self.timeHandler = eDVBLocalTimeHandler.getInstance()
            if self.timeHandler.ready():
                if self.session.nav.getCurrentlyPlayingServiceOrGroup():
                    self.stopService()
                else:
                    self.standbyStopServiceTimer.startLongTimer(5)
                self.timeHandler = None
            else:
                self.timeHandler.m_timeUpdated.get().append(self.stopService)

        if self.session.pipshown:
            self.infoBarInstance and hasattr(
                self.infoBarInstance,
                "showPiP") and self.infoBarInstance.showPiP()

        if SystemInfo["ScartSwitch"]:
            self.avswitch.setInput("SCART")
        else:
            self.avswitch.setInput("AUX")
        self.onFirstExecBegin.append(self.__onFirstExecBegin)
        self.onClose.append(self.__onClose)

    def __onClose(self):
        global inStandby
        inStandby = None
        self.standbyStopServiceTimer.stop()
        self.timeHandler and self.timeHandler.m_timeUpdated.get().remove(
            self.stopService)
        if self.paused_service:
            self.paused_action and self.paused_service.unPauseService()
        elif self.prev_running_service:
            service = self.prev_running_service.toString()
            if config.servicelist.startupservice_onstandby.value:
                self.session.nav.playService(
                    eServiceReference(config.servicelist.startupservice.value))
                from Screens.InfoBar import InfoBar
                InfoBar.instance and InfoBar.instance.servicelist.correctChannelNumber(
                )
            else:
                self.session.nav.playService(self.prev_running_service)
        self.session.screen["Standby"].boolean = False
        globalActionMap.setEnabled(True)
        self.avswitch.setInput("ENCODER")
        self.leaveMute()
        if os.path.exists("/usr/scripts/standby_leave.sh"):
            Console().ePopen("/usr/scripts/standby_leave.sh")

    def __onFirstExecBegin(self):
        global inStandby
        inStandby = self
        self.session.screen["Standby"].boolean = True
        config.misc.standbyCounter.value += 1

    def createSummary(self):
        return StandbySummary

    def stopService(self):
        self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup(
        )
        if Components.ParentalControl.parentalControl.isProtected(
                self.prev_running_service):
            self.prev_running_service = eServiceReference(
                config.tv.lastservice.value)
        self.session.nav.stopService()
def getAspect():
    val = AVSwitch().getAspectRatioSetting()
    return val / 2
Exemple #37
0
 def __init__(self, width, height, sc=None):
     self.picload = ePicLoad()
     if (not sc):
         sc = AVSwitch().getFramebufferScale()
     self.picload.setPara(
         (width, height, sc[0], sc[1], False, 1, "#ff000000"))
Exemple #38
0
class Standby2(Screen):
	def Power(self):
		print "leave standby"
		#set input to encoder
		self.avswitch.setInput("ENCODER")
		#restart last played service
		#unmute adc
		self.leaveMute()
		# set LCDminiTV 
		if SystemInfo["Display"] and SystemInfo["LCDMiniTV"]:
			setLCDModeMinitTV(config.lcd.modeminitv.getValue())
		#kill me
		self.close(True)

	def setMute(self):
		if eDVBVolumecontrol.getInstance().isMuted():
			self.wasMuted = 1
			print "mute already active"
		else:
			self.wasMuted = 0
			eDVBVolumecontrol.getInstance().volumeToggleMute()

	def leaveMute(self):
		if self.wasMuted == 0:
			eDVBVolumecontrol.getInstance().volumeToggleMute()

	def __init__(self, session):
		Screen.__init__(self, session)
		self.skinName = "Standby"
		self.avswitch = AVSwitch()

		print "enter standby"
		if getMachineProcModel() in ('ini-7012'):
			if path.exists("/proc/stb/lcd/symbol_scrambled"):
				open("/proc/stb/lcd/symbol_scrambled", "w").write("0")
		
			if path.exists("/proc/stb/lcd/symbol_1080p"):
				open("/proc/stb/lcd/symbol_1080p", "w").write("0")
				
			if path.exists("/proc/stb/lcd/symbol_1080i"):
				open("/proc/stb/lcd/symbol_1080i", "w").write("0")
			  
			if path.exists("/proc/stb/lcd/symbol_720p"):
				open("/proc/stb/lcd/symbol_720p", "w").write("0")
			  
			if path.exists("/proc/stb/lcd/symbol_576i"):
				open("/proc/stb/lcd/symbol_576i", "w").write("0")
			  
			if path.exists("/proc/stb/lcd/symbol_576p"): 
				open("/proc/stb/lcd/symbol_576p", "w").write("0")
			
			if path.exists("/proc/stb/lcd/symbol_hd"): 
				open("/proc/stb/lcd/symbol_hd", "w").write("0")  

			if path.exists("/proc/stb/lcd/symbol_dolby_audio"): 
				open("/proc/stb/lcd/symbol_dolby_audio", "w").write("0") 

			if path.exists("/proc/stb/lcd/symbol_mp3"): 
				open("/proc/stb/lcd/symbol_mp3", "w").write("0") 
				
		self["actions"] = ActionMap( [ "StandbyActions" ],
		{
			"power": self.Power,
			"discrete_on": self.Power
		}, -1)

		globalActionMap.setEnabled(False)

		#mute adc
		self.setMute()
		
		if SystemInfo["Display"] and SystemInfo["LCDMiniTV"]:
			# set LCDminiTV off
			setLCDModeMinitTV("0")

		self.paused_service = None
		self.prev_running_service = None
		if self.session.current_dialog:
			if self.session.current_dialog.ALLOW_SUSPEND == Screen.SUSPEND_STOPS:
				#get currently playing service reference
				self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup()
				#stop actual played dvb-service
				self.session.nav.stopService()
			elif self.session.current_dialog.ALLOW_SUSPEND == Screen.SUSPEND_PAUSES:
				self.paused_service = self.session.current_dialog
				self.paused_service.pauseService()

		#set input to vcr scart
		if SystemInfo["ScartSwitch"]:
			self.avswitch.setInput("SCART")
		else:
			self.avswitch.setInput("AUX")
		self.onFirstExecBegin.append(self.__onFirstExecBegin)
		self.onClose.append(self.__onClose)

	def __onClose(self):
		global inStandby
		inStandby = None
		if self.prev_running_service:
			self.session.nav.playService(self.prev_running_service)
		elif self.paused_service:
			self.paused_service.unPauseService()
		self.session.screen["Standby"].boolean = False
		globalActionMap.setEnabled(True)

	def __onFirstExecBegin(self):
		global inStandby
		inStandby = self
		self.session.screen["Standby"].boolean = True
		config.misc.standbyCounter.value += 1

	def createSummary(self):
		return StandbySummary
Exemple #39
0
	def __init__(self, session):
		Screen.__init__(self, session)
		self.skinName = "Standby"
		self.avswitch = AVSwitch()

		print "enter standby"
		if getMachineProcModel() in ('ini-7012'):
			if path.exists("/proc/stb/lcd/symbol_scrambled"):
				open("/proc/stb/lcd/symbol_scrambled", "w").write("0")
		
			if path.exists("/proc/stb/lcd/symbol_1080p"):
				open("/proc/stb/lcd/symbol_1080p", "w").write("0")
				
			if path.exists("/proc/stb/lcd/symbol_1080i"):
				open("/proc/stb/lcd/symbol_1080i", "w").write("0")
			  
			if path.exists("/proc/stb/lcd/symbol_720p"):
				open("/proc/stb/lcd/symbol_720p", "w").write("0")
			  
			if path.exists("/proc/stb/lcd/symbol_576i"):
				open("/proc/stb/lcd/symbol_576i", "w").write("0")
			  
			if path.exists("/proc/stb/lcd/symbol_576p"): 
				open("/proc/stb/lcd/symbol_576p", "w").write("0")
			
			if path.exists("/proc/stb/lcd/symbol_hd"): 
				open("/proc/stb/lcd/symbol_hd", "w").write("0")  

			if path.exists("/proc/stb/lcd/symbol_dolby_audio"): 
				open("/proc/stb/lcd/symbol_dolby_audio", "w").write("0") 

			if path.exists("/proc/stb/lcd/symbol_mp3"): 
				open("/proc/stb/lcd/symbol_mp3", "w").write("0") 
				
		self["actions"] = ActionMap( [ "StandbyActions" ],
		{
			"power": self.Power,
			"discrete_on": self.Power
		}, -1)

		globalActionMap.setEnabled(False)

		#mute adc
		self.setMute()
		
		if SystemInfo["Display"] and SystemInfo["LCDMiniTV"]:
			# set LCDminiTV off
			setLCDModeMinitTV("0")

		self.paused_service = None
		self.prev_running_service = None
		if self.session.current_dialog:
			if self.session.current_dialog.ALLOW_SUSPEND == Screen.SUSPEND_STOPS:
				#get currently playing service reference
				self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup()
				#stop actual played dvb-service
				self.session.nav.stopService()
			elif self.session.current_dialog.ALLOW_SUSPEND == Screen.SUSPEND_PAUSES:
				self.paused_service = self.session.current_dialog
				self.paused_service.pauseService()

		#set input to vcr scart
		if SystemInfo["ScartSwitch"]:
			self.avswitch.setInput("SCART")
		else:
			self.avswitch.setInput("AUX")
		self.onFirstExecBegin.append(self.__onFirstExecBegin)
		self.onClose.append(self.__onClose)
Exemple #40
0
	def onShow(self):
		Pixmap.onShow(self)
		sc = AVSwitch().getFramebufferScale()
		#0=Width 1=Height 2=Aspect 3=use_cache 4=resize_type 5=Background(#AARRGGBB)
		self.picload.setPara((self.instance.size().width(), self.instance.size().height(), sc[0], sc[1], False, 1, "#00000000"))
Exemple #41
0
    def __init__(self, session):
        Screen.__init__(self, session)
        self.skinName = "Standby"
        self.avswitch = AVSwitch()

        print "[Standby] enter standby"
        if getBoxType() in ('ini-7012', 'ini-7012au'):
            if path.exists("/proc/stb/lcd/symbol_scrambled"):
                open("/proc/stb/lcd/symbol_scrambled", "w").write("0")

            if path.exists("/proc/stb/lcd/symbol_1080p"):
                open("/proc/stb/lcd/symbol_1080p", "w").write("0")

            if path.exists("/proc/stb/lcd/symbol_1080i"):
                open("/proc/stb/lcd/symbol_1080i", "w").write("0")

            if path.exists("/proc/stb/lcd/symbol_720p"):
                open("/proc/stb/lcd/symbol_720p", "w").write("0")

            if path.exists("/proc/stb/lcd/symbol_576i"):
                open("/proc/stb/lcd/symbol_576i", "w").write("0")

            if path.exists("/proc/stb/lcd/symbol_576p"):
                open("/proc/stb/lcd/symbol_576p", "w").write("0")

            if path.exists("/proc/stb/lcd/symbol_hd"):
                open("/proc/stb/lcd/symbol_hd", "w").write("0")

            if path.exists("/proc/stb/lcd/symbol_dolby_audio"):
                open("/proc/stb/lcd/symbol_dolby_audio", "w").write("0")

            if path.exists("/proc/stb/lcd/symbol_mp3"):
                open("/proc/stb/lcd/symbol_mp3", "w").write("0")

        self["actions"] = ActionMap(
            ["StandbyActions"], {
                "power": self.Power,
                "discrete_on": self.Power,
                "deepstandby": self.deepStandby,
            }, -1)

        globalActionMap.setEnabled(False)

        from Screens.InfoBar import InfoBar
        self.infoBarInstance = InfoBar.instance
        self.standbyStopServiceTimer = eTimer()
        self.standbyStopServiceTimer.callback.append(self.stopService)
        self.timeHandler = None

        # mute adc
        self.setMute()

        self.paused_service = None

        self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup(
        )
        service = self.prev_running_service and self.prev_running_service.toString(
        )
        if service:
            if service.rsplit(":", 1)[1].startswith("/"):
                self.paused_service = True
                self.infoBarInstance.pauseService()
        if not self.paused_service:
            self.timeHandler = eDVBLocalTimeHandler.getInstance()
            if self.timeHandler.ready():
                if self.session.nav.getCurrentlyPlayingServiceOrGroup():
                    self.stopService()
                else:
                    self.standbyStopServiceTimer.startLongTimer(5)
                self.timeHandler = None
            else:
                self.timeHandler.m_timeUpdated.get().append(self.stopService)

        if self.session.pipshown:
            self.infoBarInstance and hasattr(
                self.infoBarInstance,
                "showPiP") and self.infoBarInstance.showPiP()

        self.videoOff()
        self.onFirstExecBegin.append(self.__onFirstExecBegin)
        self.onClose.append(self.__onClose)
Exemple #42
0
	def downloadThumbnailCallback(self, txt=""):
		sc = AVSwitch().getFramebufferScale()
		self.picload = ePicLoad()
		self.picload.PictureData.get().append(self.buildEntry)
		self.picload.setPara((94, 60, sc[0], sc[1], False, 1, "#00000000"))
		self.picload.startDecode(self.thumb)
Exemple #43
0
	def loadThumb(self):
		thumbfile = self.project.titles[self.title_idx].inputfile.rsplit('.', 1)[0] + ".png"
		sc = AVSwitch().getFramebufferScale()
		self.picload.setPara((self["thumbnail"].instance.size().width(), self["thumbnail"].instance.size().height(), sc[0], sc[1], False, 1, "#00000000"))
		self.picload.startDecode(thumbfile)
Exemple #44
0
class Standby2(Screen):
    def Power(self):
        print "[Standby] leave standby"
        SystemInfo["StandbyState"] = False
        if (getBrandOEM() in ('fulan', 'clap', 'dinobot') or getBoxType()
                in ('sf8008', 'sf8008s', 'sf8008t', 'ustym4kpro')):
            try:
                open("/proc/stb/hdmi/output", "w").write("on")
            except:
                pass
        #set input to encoder
        self.avswitch.setInput("ENCODER")
        #restart last played service
        #unmute adc
        self.leaveMute()
        # set LCDminiTV
        if SystemInfo["Display"] and SystemInfo["LCDMiniTV"]:
            setLCDModeMinitTV(config.lcd.modeminitv.value)
        #kill me
        if os.path.exists("/usr/scripts/standby.sh") is True:
            os.system("chmod 755 /usr/scripts/standby.sh")
            os.system("/usr/scripts/standby.sh")
        else:
            print "/usr/scripts/standby.sh not found"
        self.close(True)

    # normally handle only key's 'make' event
    def Power_make(self):
        if (config.usage.on_short_powerpress.value != "standby_noTVshutdown"):
            self.Power()

    # with the option "standby_noTVshutdown", use 'break' event / allow turning off the TV by a 'long' key press in standby
    # avoid waking from standby by ignoring the key's 'break' event after the 'long' and subsequent 'repeat' events.
    def Power_long(self):
        if (config.usage.on_short_powerpress.value == "standby_noTVshutdown"):
            self.TVoff()
            self.ignoreKeyBreakTimer.start(250, 1)

    def Power_repeat(self):
        if (config.usage.on_short_powerpress.value == "standby_noTVshutdown"
            ) and self.ignoreKeyBreakTimer.isActive():
            self.ignoreKeyBreakTimer.start(250, 1)

    def Power_break(self):
        if (config.usage.on_short_powerpress.value == "standby_noTVshutdown"
            ) and not self.ignoreKeyBreakTimer.isActive():
            self.Power()

    def TVoff(self):
        print "[Standby] TVoff"
        TVinStandby.skipHdmiCecNow(False)
        TVinStandby.setTVstate('standby')

    def setMute(self):
        if eDVBVolumecontrol.getInstance().isMuted():
            self.wasMuted = 1
            print "[Standby] mute already active"
        else:
            self.wasMuted = 0
            eDVBVolumecontrol.getInstance().volumeToggleMute()

    def leaveMute(self):
        if self.wasMuted == 0:
            eDVBVolumecontrol.getInstance().volumeToggleMute()

    def __init__(self, session):
        Screen.__init__(self, session)
        self.skinName = "Standby"
        self.avswitch = AVSwitch()

        print "[Standby] enter standby"
        SystemInfo["StandbyState"] = True

        self["actions"] = ActionMap(
            ["StandbyActions"], {
                "power": self.Power,
                "power_make": self.Power_make,
                "power_break": self.Power_break,
                "power_long": self.Power_long,
                "power_repeat": self.Power_repeat,
                "discrete_on": self.Power
            }, -1)

        globalActionMap.setEnabled(False)

        self.ignoreKeyBreakTimer = eTimer()
        self.standbyStopServiceTimer = eTimer()
        self.standbyStopServiceTimer.callback.append(self.stopService)
        self.timeHandler = None

        #mute adc
        self.setMute()

        if SystemInfo["Display"] and SystemInfo["LCDMiniTV"]:
            # set LCDminiTV off
            setLCDModeMinitTV("0")

        self.paused_service = None
        self.prev_running_service = None
        self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup(
        )
        service = self.prev_running_service and self.prev_running_service.toString(
        )
        if service:
            if service.startswith("1:") and service.rsplit(
                    ":", 1)[1].startswith("/"):
                self.paused_service = self.session.current_dialog
                self.paused_service.pauseService()
        if not self.paused_service:
            self.timeHandler = eDVBLocalTimeHandler.getInstance()
            if self.timeHandler.ready():
                if self.session.nav.getCurrentlyPlayingServiceOrGroup():
                    self.stopService()
                else:
                    self.standbyStopServiceTimer.startLongTimer(5)
                self.timeHandler = None
            else:
                self.timeHandler.m_timeUpdated.get().append(self.stopService)
        if self.session.pipshown:
            from Screens.InfoBar import InfoBar
            InfoBar.instance and hasattr(
                InfoBar.instance, "showPiP") and InfoBar.instance.showPiP()

        #set input to vcr scart
        if SystemInfo["ScartSwitch"]:
            self.avswitch.setInput("SCART")
        else:
            self.avswitch.setInput("AUX")

        if (getBrandOEM() in ('fulan', 'clap', 'dinobot') or getBoxType()
                in ('sf8008', 'sf8008s', 'sf8008t', 'ustym4kpro')):
            try:
                open("/proc/stb/hdmi/output", "w").write("off")
            except:
                pass

        if int(
                config.usage.hdd_standby_in_standby.value
        ) != -1:  # HDD standby timer value (box in standby) / -1 = same as when box is active
            for hdd in harddiskmanager.HDDList():
                hdd[1].setIdleTime(
                    int(config.usage.hdd_standby_in_standby.value))

        self.onFirstExecBegin.append(self.__onFirstExecBegin)
        self.onClose.append(self.__onClose)

    def __onClose(self):
        global inStandby
        inStandby = None
        self.standbyStopServiceTimer.stop()
        self.timeHandler and self.timeHandler.m_timeUpdated.get().remove(
            self.stopService)
        if self.paused_service:
            self.paused_service.unPauseService()
        elif self.prev_running_service:
            service = self.prev_running_service.toString()
            self.session.nav.playService(self.prev_running_service)
        self.session.screen["Standby"].boolean = False
        globalActionMap.setEnabled(True)
        for hdd in harddiskmanager.HDDList():
            hdd[1].setIdleTime(int(config.usage.hdd_standby.value)
                               )  # HDD standby timer value (box active)

    def __onFirstExecBegin(self):
        global inStandby
        inStandby = self
        self.session.screen["Standby"].boolean = True
        config.misc.standbyCounter.value += 1

    def createSummary(self):
        return StandbySummary

    def stopService(self):
        if config.servicelist.startupservice_standby.value:
            self.prev_running_service = eServiceReference(
                config.servicelist.startupservice_standby.value)
        else:
            self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup(
            )
        self.session.nav.stopService()
    def __init__(self, session):
        Screen.__init__(self, session)
        self.skinName = "Standby"
        self.avswitch = AVSwitch()

        print "enter standby"

        if getMachineProcModel() in ('ini-7012'):
            if path.exists("/proc/stb/lcd/symbol_scrambled"):
                open("/proc/stb/lcd/symbol_scrambled", "w").write("0")

            if path.exists("/proc/stb/lcd/symbol_1080p"):
                open("/proc/stb/lcd/symbol_1080p", "w").write("0")

            if path.exists("/proc/stb/lcd/symbol_1080i"):
                open("/proc/stb/lcd/symbol_1080i", "w").write("0")

            if path.exists("/proc/stb/lcd/symbol_720p"):
                open("/proc/stb/lcd/symbol_720p", "w").write("0")

            if path.exists("/proc/stb/lcd/symbol_576i"):
                open("/proc/stb/lcd/symbol_576i", "w").write("0")

            if path.exists("/proc/stb/lcd/symbol_576p"):
                open("/proc/stb/lcd/symbol_576p", "w").write("0")

            if path.exists("/proc/stb/lcd/symbol_hd"):
                open("/proc/stb/lcd/symbol_hd", "w").write("0")

            if path.exists("/proc/stb/lcd/symbol_dolby_audio"):
                open("/proc/stb/lcd/symbol_dolby_audio", "w").write("0")

            if path.exists("/proc/stb/lcd/symbol_mp3"):
                open("/proc/stb/lcd/symbol_mp3", "w").write("0")

        self["actions"] = ActionMap(["StandbyActions"], {
            "power": self.Power,
            "discrete_on": self.Power
        }, -1)

        globalActionMap.setEnabled(False)

        #mute adc
        self.setMute()
        self.stopService()
        if SystemInfo["Display"] and SystemInfo["LCDMiniTV"]:
            # set LCDminiTV off
            setLCDModeMinitTV("0")
        elif SystemInfo["Display"] and SystemInfo["LCDMiniTV4k"]:
            # set LCDminiTV off
            setLCDModeMinitTV4k("disable")

        self.paused_service = None
        self.prev_running_service = None
        if self.session.current_dialog:
            if self.session.current_dialog.ALLOW_SUSPEND == Screen.SUSPEND_STOPS:
                #get currently playing service reference
                self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup(
                )
                #stop actual played dvb-service
                self.session.nav.stopService()
            elif self.session.current_dialog.ALLOW_SUSPEND == Screen.SUSPEND_PAUSES:
                self.paused_service = self.session.current_dialog
                self.paused_service.pauseService()

        #set input to vcr scart
        if SystemInfo["ScartSwitch"]:
            self.avswitch.setInput("SCART")
        else:
            self.avswitch.setInput("AUX")

        gotoShutdownTime = int(config.usage.standby_to_shutdown_timer.value)
        print "goto deep2"
        if gotoShutdownTime:
            print "goto deep3"
            self.standbyTimeoutTimer = eTimer()
            self.standbyTimeoutTimer.callback.append(self.standbyTimeout)
            self.standbyTimeoutTimer.startLongTimer(gotoShutdownTime)

        if (getBrandOEM() in ('fulan', 'clap', 'dinobot')
                or getBoxType() in ('sf8008', 'ustym4kpro')):
            try:
                open("/proc/stb/hdmi/output", "w").write("off")
            except:
                pass
        self.onFirstExecBegin.append(self.__onFirstExecBegin)
        self.onClose.append(self.__onClose)
class Standby(Screen):
	def Power(self):
		print "[Standby] leave standby"
		self.leaveMute()
		self.close(True)

	def setMute(self):
		if (eDVBVolumecontrol.getInstance().isMuted()):
			self.wasMuted = 1
			print "[Standby] mute already active"
		else:
			self.wasMuted = 0
			eDVBVolumecontrol.getInstance().volumeToggleMute()

	def leaveMute(self):
		if self.wasMuted == 0:
			eDVBVolumecontrol.getInstance().openMixerOnMute() # fix for vuplus
			eDVBVolumecontrol.getInstance().volumeToggleMute()

	def __init__(self, session, StandbyCounterIncrease=True):
		Screen.__init__(self, session)
		self.avswitch = AVSwitch()

		print "[Standby] enter standby"

		if os.path.exists("/usr/script/standby_enter.sh"):
			Console().ePopen("/usr/script/standby_enter.sh")

		self["actions"] = ActionMap( [ "StandbyActions" ],
		{
			"power": self.Power,
			"discrete_on": self.Power
		}, -1)

		globalActionMap.setEnabled(False)

		from Screens.InfoBar import InfoBar
		from Screens.SleepTimerEdit import isNextWakeupTime
		self.infoBarInstance = InfoBar.instance
		self.StandbyCounterIncrease = StandbyCounterIncrease
		self.standbyTimeoutTimer = eTimer()
		self.standbyTimeoutTimer.callback.append(self.standbyTimeout)
		self.standbyStopServiceTimer = eTimer()
		self.standbyStopServiceTimer.callback.append(self.stopService)
		self.standbyWakeupTimer = eTimer()
		self.standbyWakeupTimer.callback.append(self.standbyWakeup)
		self.timeHandler = None

		self.setMute()

		self.paused_service = self.paused_action = False

		self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup()
		if Components.ParentalControl.parentalControl.isProtected(self.prev_running_service):
			self.prev_running_service = eServiceReference(config.tv.lastservice.value)
		service = self.prev_running_service and self.prev_running_service.toString()
		if service:
			if service.rsplit(":", 1)[1].startswith("/"):
				self.paused_service = hasattr(self.session.current_dialog, "pauseService") and hasattr(self.session.current_dialog, "unPauseService") and self.session.current_dialog or self.infoBarInstance
				self.paused_action = hasattr(self.paused_service, "seekstate") and hasattr(self.paused_service, "SEEK_STATE_PLAY") and self.paused_service.seekstate == self.paused_service.SEEK_STATE_PLAY
				self.paused_action and self.paused_service.pauseService()
		if not self.paused_service:
			self.timeHandler =  eDVBLocalTimeHandler.getInstance()
			if self.timeHandler.ready():
				if self.session.nav.getCurrentlyPlayingServiceOrGroup():
					self.stopService()
				else:
					self.standbyStopServiceTimer.startLongTimer(5)
				self.timeHandler = None
			else:
				self.timeHandler.m_timeUpdated.get().append(self.stopService)

		if self.session.pipshown:
			self.infoBarInstance and hasattr(self.infoBarInstance, "showPiP") and self.infoBarInstance.showPiP()

		if SystemInfo["ScartSwitch"]:
			self.avswitch.setInput("SCART")
		else:
			self.avswitch.setInput("AUX")

		gotoShutdownTime = int(config.usage.standby_to_shutdown_timer.value)
		if gotoShutdownTime:
			self.standbyTimeoutTimer.startLongTimer(gotoShutdownTime)

		gotoWakeupTime = isNextWakeupTime(True)
		if gotoWakeupTime != -1:
			curtime = localtime(time())
			if curtime.tm_year > 1970:
				wakeup_time = int(gotoWakeupTime - time())
				if wakeup_time > 0:
					self.standbyWakeupTimer.startLongTimer(wakeup_time)

		self.onFirstExecBegin.append(self.__onFirstExecBegin)
		self.onClose.append(self.__onClose)

	def __onClose(self):
		global inStandby
		inStandby = None
		self.standbyTimeoutTimer.stop()
		self.standbyStopServiceTimer.stop()
		self.standbyWakeupTimer.stop()
		self.timeHandler and self.timeHandler.m_timeUpdated.get().remove(self.stopService)
		if self.paused_service:
			self.paused_action and self.paused_service.unPauseService()
		elif self.prev_running_service:
			service = self.prev_running_service.toString()
			if config.servicelist.startupservice_onstandby.value:
				self.session.nav.playService(eServiceReference(config.servicelist.startupservice.value))
				from Screens.InfoBar import InfoBar
				InfoBar.instance and InfoBar.instance.servicelist.correctChannelNumber()
			else:
				self.session.nav.playService(self.prev_running_service)
		self.session.screen["Standby"].boolean = False
		globalActionMap.setEnabled(True)
		if RecordTimer.RecordTimerEntry.receiveRecordEvents:
			RecordTimer.RecordTimerEntry.stopTryQuitMainloop()
		self.avswitch.setInput("ENCODER")
		if os.path.exists("/usr/script/standby_leave.sh"):
			Console().ePopen("/usr/script/standby_leave.sh")

	def __onFirstExecBegin(self):
		global inStandby
		inStandby = self
		self.session.screen["Standby"].boolean = True
		if self.StandbyCounterIncrease:
			config.misc.standbyCounter.value += 1

	def stopService(self):
		self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup()
		if Components.ParentalControl.parentalControl.isProtected(self.prev_running_service):
			self.prev_running_service = eServiceReference(config.tv.lastservice.value)
		self.session.nav.stopService()

	def createSummary(self):
		return StandbySummary

	def standbyTimeout(self):
		if config.usage.standby_to_shutdown_timer_blocktime.value:
			curtime = localtime(time())
			if curtime.tm_year > 1970: #check if the current time is valid
				curtime = (curtime.tm_hour, curtime.tm_min, curtime.tm_sec)
				begintime = tuple(config.usage.standby_to_shutdown_timer_blocktime_begin.value)
				endtime = tuple(config.usage.standby_to_shutdown_timer_blocktime_end.value)
				if begintime <= endtime and (curtime >= begintime and curtime < endtime) or begintime > endtime and (curtime >= begintime or curtime < endtime):
					duration = (endtime[0]*3600 + endtime[1]*60) - (curtime[0]*3600 + curtime[1]*60 + curtime[2])
					if duration:
						if duration < 0:
							duration += 24*3600
						self.standbyTimeoutTimer.startLongTimer(duration)
						return
		if self.session.screen["TunerInfo"].tuner_use_mask or internalHDDNotSleeping():
			self.standbyTimeoutTimer.startLongTimer(600)
		else:
			from RecordTimer import RecordTimerEntry
			RecordTimerEntry.TryQuitMainloop()

	def standbyWakeup(self):
		self.Power()
Exemple #47
0
    def __init__(self, session, StandbyCounterIncrease=True):
        Screen.__init__(self, session)
        self.avswitch = AVSwitch()

        print "enter standby"

        self["actions"] = ActionMap(["StandbyActions"], {
            "power": self.Power,
            "discrete_on": self.Power
        }, -1)

        globalActionMap.setEnabled(False)

        from Screens.InfoBar import InfoBar
        self.infoBarInstance = InfoBar.instance
        self.StandbyCounterIncrease = StandbyCounterIncrease
        self.standbyTimeoutTimer = eTimer()
        self.standbyTimeoutTimer.callback.append(self.standbyTimeout)
        self.standbyStopServiceTimer = eTimer()
        self.standbyStopServiceTimer.callback.append(self.stopService)
        self.timeHandler = None

        #mute adc
        self.setMute()

        self.paused_service = None

        self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup(
        )
        service = self.prev_running_service and self.prev_running_service.toString(
        )
        if service:
            if service.rsplit(":", 1)[1].startswith("/"):
                self.paused_service = True
                self.infoBarInstance.pauseService()
            else:
                self.timeHandler = eDVBLocalTimeHandler.getInstance()
                if self.timeHandler.ready():
                    if self.session.nav.getCurrentlyPlayingServiceOrGroup():
                        self.stopService()
                    else:
                        self.standbyStopServiceTimer.startLongTimer(5)
                    self.timeHandler = None
                else:
                    self.timeHandler.m_timeUpdated.get().append(
                        self.stopService)

        if self.session.pipshown:
            self.infoBarInstance and hasattr(
                self.infoBarInstance,
                "showPiP") and self.infoBarInstance.showPiP()

        #set input to vcr scart
        if SystemInfo["ScartSwitch"]:
            self.avswitch.setInput("SCART")
        else:
            self.avswitch.setInput("AUX")

        gotoShutdownTime = int(config.usage.standby_to_shutdown_timer.value)
        if gotoShutdownTime:
            self.standbyTimeoutTimer.startLongTimer(gotoShutdownTime)

        self.onFirstExecBegin.append(self.__onFirstExecBegin)
        self.onClose.append(self.__onClose)
Exemple #48
0
class Standby(Screen):
	def Power(self):
		print "leave standby"
#+++>
		call("/bin/vdstandby -d &", shell="true")
#+++<
		#set input to encoder
		self.avswitch.setInput("ENCODER")
		#restart last played service
		#unmute adc
		self.leaveMute()
		#kill me
		self.close(True)

	def setMute(self):
		if (eDVBVolumecontrol.getInstance().isMuted()):
			self.wasMuted = 1
			print "mute already active"
		else:
			self.wasMuted = 0
			eDVBVolumecontrol.getInstance().volumeToggleMute()

	def leaveMute(self):
		if self.wasMuted == 0:
			eDVBVolumecontrol.getInstance().volumeToggleMute()

	def __init__(self, session, StandbyCounterIncrease=True):
		Screen.__init__(self, session)
		self.avswitch = AVSwitch()

		print "enter standby"

		self["actions"] = ActionMap( [ "StandbyActions" ],
		{
			"power": self.Power,
			"discrete_on": self.Power
		}, -1)

		globalActionMap.setEnabled(False)

		from Screens.InfoBar import InfoBar
		self.infoBarInstance = InfoBar.instance
		self.StandbyCounterIncrease = StandbyCounterIncrease
		self.standbyTimeoutTimer = eTimer()
		self.standbyTimeoutTimer.callback.append(self.standbyTimeout)
		self.standbyStopServiceTimer = eTimer()
		self.standbyStopServiceTimer.callback.append(self.stopService)
		self.timeHandler = None

		#mute adc
		self.setMute()

		self.paused_service = None

		self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup()
		service = self.prev_running_service and self.prev_running_service.toString()
		if service:
			if service.rsplit(":", 1)[1][:1] == "/":
				self.paused_service = True
				self.infoBarInstance.pauseService()
		if not self.paused_service:
			self.timeHandler =  eDVBLocalTimeHandler.getInstance()
			if self.timeHandler.ready():
				if self.session.nav.getCurrentlyPlayingServiceOrGroup():
					self.stopService()
				else:
					self.standbyStopServiceTimer.startLongTimer(5)
				self.timeHandler = None
			else:
				self.timeHandler.m_timeUpdated.get().append(self.stopService)

		if self.session.pipshown:
			self.infoBarInstance and hasattr(self.infoBarInstance, "showPiP") and self.infoBarInstance.showPiP()

		#set input to vcr scart
		if SystemInfo["ScartSwitch"]:
			self.avswitch.setInput("SCART")
		else:
			self.avswitch.setInput("AUX")
#+++>
		call("/bin/vdstandby -a &", shell="true")
#+++<

		gotoShutdownTime = int(config.usage.standby_to_shutdown_timer.value)
		if gotoShutdownTime:
			self.standbyTimeoutTimer.startLongTimer(gotoShutdownTime)

		self.onFirstExecBegin.append(self.__onFirstExecBegin)
		self.onClose.append(self.__onClose)

	def __onClose(self):
		global inStandby
		inStandby = None
		self.standbyTimeoutTimer.stop()
		self.standbyStopServiceTimer.stop()
		self.timeHandler and self.timeHandler.m_timeUpdated.get().remove(self.stopService)
		if self.paused_service:
			self.infoBarInstance.unPauseService()
		elif self.prev_running_service:
			service = self.prev_running_service.toString()
			if config.servicelist.startupservice_onstandby.value:
				self.session.nav.playService(eServiceReference(config.servicelist.startupservice.value))
				from Screens.InfoBar import InfoBar
				InfoBar.instance and InfoBar.instance.servicelist.correctChannelNumber()
			else:
				self.session.nav.playService(self.prev_running_service)
		self.session.screen["Standby"].boolean = False
		globalActionMap.setEnabled(True)
		if RecordTimer.RecordTimerEntry.receiveRecordEvents:
			RecordTimer.RecordTimerEntry.stopTryQuitMainloop()

	def __onFirstExecBegin(self):
		global inStandby
		inStandby = self
		self.session.screen["Standby"].boolean = True
		if self.StandbyCounterIncrease:
			config.misc.standbyCounter.value += 1

	def stopService(self):
		self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup()
		self.session.nav.stopService()

	def createSummary(self):
		return StandbySummary

	def standbyTimeout(self):
		if config.usage.standby_to_shutdown_timer_blocktime.value:
			curtime = localtime(time())
			if curtime.tm_year > 1970: #check if the current time is valid
				curtime = (curtime.tm_hour, curtime.tm_min, curtime.tm_sec)
				begintime = tuple(config.usage.standby_to_shutdown_timer_blocktime_begin.value)
				endtime = tuple(config.usage.standby_to_shutdown_timer_blocktime_end.value)
				if begintime <= endtime and (curtime >= begintime and curtime < endtime) or begintime > endtime and (curtime >= begintime or curtime < endtime):
					duration = (endtime[0]*3600 + endtime[1]*60) - (curtime[0]*3600 + curtime[1]*60 + curtime[2])
					if duration:
						if duration < 0:
							duration += 24*3600
						self.standbyTimeoutTimer.startLongTimer(duration)
						return
		if self.session.screen["TunerInfo"].tuner_use_mask or internalHDDNotSleeping():
			self.standbyTimeoutTimer.startLongTimer(600)
		else:
			from RecordTimer import RecordTimerEntry
			RecordTimerEntry.TryQuitMainloop()
Exemple #49
0
class Standby(Screen):
    def Power(self):
        print "leave standby"
        #set input to encoder
        self.avswitch.setInput("ENCODER")
        #restart last played service
        #unmute adc
        self.leaveMute()
        #kill me
        self.close(True)

    def setMute(self):
        if (eDVBVolumecontrol.getInstance().isMuted()):
            self.wasMuted = 1
            print "mute already active"
        else:
            self.wasMuted = 0
            eDVBVolumecontrol.getInstance().volumeToggleMute()

    def leaveMute(self):
        if self.wasMuted == 0:
            eDVBVolumecontrol.getInstance().volumeToggleMute()

    def __init__(self, session, StandbyCounterIncrease=True):
        Screen.__init__(self, session)
        self.avswitch = AVSwitch()

        print "enter standby"

        self["actions"] = ActionMap(["StandbyActions"], {
            "power": self.Power,
            "discrete_on": self.Power
        }, -1)

        globalActionMap.setEnabled(False)

        from Screens.InfoBar import InfoBar
        self.infoBarInstance = InfoBar.instance
        self.StandbyCounterIncrease = StandbyCounterIncrease
        self.standbyTimeoutTimer = eTimer()
        self.standbyTimeoutTimer.callback.append(self.standbyTimeout)
        self.standbyStopServiceTimer = eTimer()
        self.standbyStopServiceTimer.callback.append(self.stopService)
        self.timeHandler = None

        #mute adc
        self.setMute()

        self.paused_service = None

        self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup(
        )
        service = self.prev_running_service and self.prev_running_service.toString(
        )
        if service:
            if service.rsplit(":", 1)[1].startswith("/"):
                self.paused_service = True
                self.infoBarInstance.pauseService()
            else:
                self.timeHandler = eDVBLocalTimeHandler.getInstance()
                if self.timeHandler.ready():
                    if self.session.nav.getCurrentlyPlayingServiceOrGroup():
                        self.stopService()
                    else:
                        self.standbyStopServiceTimer.startLongTimer(5)
                    self.timeHandler = None
                else:
                    self.timeHandler.m_timeUpdated.get().append(
                        self.stopService)

        if self.session.pipshown:
            self.infoBarInstance and hasattr(
                self.infoBarInstance,
                "showPiP") and self.infoBarInstance.showPiP()

        #set input to vcr scart
        if SystemInfo["ScartSwitch"]:
            self.avswitch.setInput("SCART")
        else:
            self.avswitch.setInput("AUX")

        gotoShutdownTime = int(config.usage.standby_to_shutdown_timer.value)
        if gotoShutdownTime:
            self.standbyTimeoutTimer.startLongTimer(gotoShutdownTime)

        self.onFirstExecBegin.append(self.__onFirstExecBegin)
        self.onClose.append(self.__onClose)

    def __onClose(self):
        global inStandby
        inStandby = None
        self.standbyTimeoutTimer.stop()
        self.standbyStopServiceTimer.stop()
        self.timeHandler and self.timeHandler.m_timeUpdated.get().remove(
            self.stopService)
        if self.paused_service:
            self.infoBarInstance.unPauseService()
        elif self.prev_running_service:
            service = self.prev_running_service.toString()
            if config.servicelist.startupservice_onstandby.value:
                self.session.nav.playService(
                    eServiceReference(config.servicelist.startupservice.value))
                from Screens.InfoBar import InfoBar
                InfoBar.instance and InfoBar.instance.servicelist.correctChannelNumber(
                )
            else:
                self.session.nav.playService(self.prev_running_service)
        self.session.screen["Standby"].boolean = False
        globalActionMap.setEnabled(True)
        if RecordTimer.RecordTimerEntry.receiveRecordEvents:
            RecordTimer.RecordTimerEntry.stopTryQuitMainloop()

    def __onFirstExecBegin(self):
        global inStandby
        inStandby = self
        self.session.screen["Standby"].boolean = True
        if self.StandbyCounterIncrease:
            config.misc.standbyCounter.value += 1

    def stopService(self):
        self.session.nav.stopService()

    def createSummary(self):
        return StandbySummary

    def standbyTimeout(self):
        if config.usage.standby_to_shutdown_timer_blocktime.value:
            curtime = localtime(time())
            if curtime.tm_year > 1970:  #check if the current time is valid
                curtime = (curtime.tm_hour, curtime.tm_min, curtime.tm_sec)
                begintime = tuple(
                    config.usage.standby_to_shutdown_timer_blocktime_begin.
                    value)
                endtime = tuple(
                    config.usage.standby_to_shutdown_timer_blocktime_end.value)
                if begintime <= endtime and (
                        curtime >= begintime
                        and curtime < endtime) or begintime > endtime and (
                            curtime >= begintime or curtime < endtime):
                    duration = (endtime[0] * 3600 + endtime[1] * 60) - (
                        curtime[0] * 3600 + curtime[1] * 60 + curtime[2])
                    if duration:
                        if duration < 0:
                            duration += 24 * 3600
                        self.standbyTimeoutTimer.startLongTimer(duration)
                        return
        if self.session.screen[
                "TunerInfo"].tuner_use_mask or internalHDDNotSleeping():
            self.standbyTimeoutTimer.startLongTimer(600)
        else:
            from RecordTimer import RecordTimerEntry
            RecordTimerEntry.TryQuitMainloop()
Exemple #50
0
def getAspect():
    return AVSwitch().getAspectRatioSetting()
Exemple #51
0
class Standby(Screen):
	def Power(self):
		print "leave standby"
		#set input to encoder
		self.avswitch.setInput("ENCODER")
		#restart last played service
		#unmute adc
		self.leaveMute()
		#kill me
		self.close(True)

	def setMute(self):
		if (eDVBVolumecontrol.getInstance().isMuted()):
			self.wasMuted = 1
			print "mute already active"
		else:	
			self.wasMuted = 0
			eDVBVolumecontrol.getInstance().volumeToggleMute()

	def leaveMute(self):
		if self.wasMuted == 0:
			eDVBVolumecontrol.getInstance().volumeToggleMute()

	def __init__(self, session):
		Screen.__init__(self, session)
		self.avswitch = AVSwitch()

		print "enter standby"

		self["actions"] = ActionMap( [ "StandbyActions" ],
		{
			"power": self.Power,
			"discrete_on": self.Power
		}, -1)

		globalActionMap.setEnabled(False)

		#mute adc
		self.setMute()

		self.paused_service = None
		self.prev_running_service = None
		if self.session.current_dialog:
			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()
			elif self.session.current_dialog.ALLOW_SUSPEND == Screen.SUSPEND_PAUSES:
				self.paused_service = self.session.current_dialog
				self.paused_service.pauseService()

		#set input to vcr scart
		if SystemInfo["ScartSwitch"]:
			self.avswitch.setInput("SCART")
		else:
			self.avswitch.setInput("AUX")
		self.onFirstExecBegin.append(self.__onFirstExecBegin)
		self.onClose.append(self.__onClose)

	def __onClose(self):
		global inStandby
		inStandby = None
		if self.prev_running_service:
			self.session.nav.playService(self.prev_running_service)
		elif self.paused_service:
			self.paused_service.unPauseService()
		self.session.screen["Standby"].boolean = False
		globalActionMap.setEnabled(True)

	def __onFirstExecBegin(self):
		global inStandby
		inStandby = self
		self.session.screen["Standby"].boolean = True
		config.misc.standbyCounter.value += 1

	def createSummary(self):
		return StandbySummary
Exemple #52
0
def getScale():
	printl2("", "__common__::getScale", "S")

	printl2("", "__common__::getScale", "C")
	return AVSwitch().getFramebufferScale()
Exemple #53
0
	def onShow(self):
		Pixmap.onShow(self)
		sc = AVSwitch().getFramebufferScale()
		self.picload.setPara((self.instance.size().width(), self.instance.size().height(), sc[0], sc[1], 0, 0, '#00000000'))
Exemple #54
0
class Standby(Screen):
	def Power(self):
		print "[Standby] leave standby"
		self.close(True)

	def setMute(self):
		self.wasMuted = eDVBVolumecontrol.getInstance().isMuted()
		if not self.wasMuted:
			eDVBVolumecontrol.getInstance().volumeMute()

	def leaveMute(self):
		if not self.wasMuted:
			eDVBVolumecontrol.getInstance().volumeUnMute()

	def __init__(self, session, StandbyCounterIncrease=True):
		Screen.__init__(self, session)
		self.avswitch = AVSwitch()

		print "[Standby] enter standby"

		if os.path.exists("/usr/script/standby_enter.sh"):
			Console().ePopen("/usr/script/standby_enter.sh")

		self["actions"] = ActionMap( [ "StandbyActions" ],
		{
			"power": self.Power,
			"discrete_on": self.Power
		}, -1)

		globalActionMap.setEnabled(False)

		from Screens.InfoBar import InfoBar
		from Screens.SleepTimerEdit import isNextWakeupTime
		self.infoBarInstance = InfoBar.instance
		self.StandbyCounterIncrease = StandbyCounterIncrease
		self.standbyTimeoutTimer = eTimer()
		self.standbyTimeoutTimer.callback.append(self.standbyTimeout)
		self.standbyStopServiceTimer = eTimer()
		self.standbyStopServiceTimer.callback.append(self.stopService)
		self.standbyWakeupTimer = eTimer()
		self.standbyWakeupTimer.callback.append(self.standbyWakeup)
		self.timeHandler = None

		self.setMute()

		self.paused_service = self.paused_action = False

		self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup()
		if Components.ParentalControl.parentalControl.isProtected(self.prev_running_service):
			self.prev_running_service = eServiceReference(config.tv.lastservice.value)
		service = self.prev_running_service and self.prev_running_service.toString()
		if service:
			if service.rsplit(":", 1)[1].startswith("/"):
				self.paused_service = hasattr(self.session.current_dialog, "pauseService") and hasattr(self.session.current_dialog, "unPauseService") and self.session.current_dialog or self.infoBarInstance
				self.paused_action = hasattr(self.paused_service, "seekstate") and hasattr(self.paused_service, "SEEK_STATE_PLAY") and self.paused_service.seekstate == self.paused_service.SEEK_STATE_PLAY
				self.paused_action and self.paused_service.pauseService()
		if not self.paused_service:
			self.timeHandler =  eDVBLocalTimeHandler.getInstance()
			if self.timeHandler.ready():
				if self.session.nav.getCurrentlyPlayingServiceOrGroup():
					self.stopService()
				else:
					self.standbyStopServiceTimer.startLongTimer(5)
				self.timeHandler = None
			else:
				self.timeHandler.m_timeUpdated.get().append(self.stopService)

		if self.session.pipshown:
			self.infoBarInstance and hasattr(self.infoBarInstance, "showPiP") and self.infoBarInstance.showPiP()

		if SystemInfo["ScartSwitch"]:
			self.avswitch.setInput("SCART")
		else:
			self.avswitch.setInput("AUX")

		gotoShutdownTime = int(config.usage.standby_to_shutdown_timer.value)
		if gotoShutdownTime:
			self.standbyTimeoutTimer.startLongTimer(gotoShutdownTime)

		gotoWakeupTime = isNextWakeupTime(True)
		if gotoWakeupTime != -1:
			curtime = localtime(time())
			if curtime.tm_year > 1970:
				wakeup_time = int(gotoWakeupTime - time())
				if wakeup_time > 0:
					self.standbyWakeupTimer.startLongTimer(wakeup_time)

		self.onFirstExecBegin.append(self.__onFirstExecBegin)
		self.onClose.append(self.__onClose)

	def __onClose(self):
		global inStandby
		inStandby = None
		self.standbyTimeoutTimer.stop()
		self.standbyStopServiceTimer.stop()
		self.standbyWakeupTimer.stop()
		self.timeHandler and self.timeHandler.m_timeUpdated.get().remove(self.stopService)
		if self.paused_service:
			self.paused_action and self.paused_service.unPauseService()
		elif self.prev_running_service:
			service = self.prev_running_service.toString()
			if config.servicelist.startupservice_onstandby.value:
				self.session.nav.playService(eServiceReference(config.servicelist.startupservice.value))
				from Screens.InfoBar import InfoBar
				InfoBar.instance and InfoBar.instance.servicelist.correctChannelNumber()
			else:
				self.session.nav.playService(self.prev_running_service)
		self.session.screen["Standby"].boolean = False
		globalActionMap.setEnabled(True)
		if RecordTimer.RecordTimerEntry.receiveRecordEvents:
			RecordTimer.RecordTimerEntry.stopTryQuitMainloop()
		self.avswitch.setInput("ENCODER")
		self.leaveMute()
		if os.path.exists("/usr/script/standby_leave.sh"):
			Console().ePopen("/usr/script/standby_leave.sh")
		if config.usage.remote_fallback_import_standby.value:
			ImportChannels()

	def __onFirstExecBegin(self):
		global inStandby
		inStandby = self
		self.session.screen["Standby"].boolean = True
		if self.StandbyCounterIncrease:
			config.misc.standbyCounter.value += 1

	def stopService(self):
		self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup()
		if Components.ParentalControl.parentalControl.isProtected(self.prev_running_service):
			self.prev_running_service = eServiceReference(config.tv.lastservice.value)
		self.session.nav.stopService()

	def createSummary(self):
		return StandbySummary

	def standbyTimeout(self):
		if config.usage.standby_to_shutdown_timer_blocktime.value:
			curtime = localtime(time())
			if curtime.tm_year > 1970: #check if the current time is valid
				curtime = (curtime.tm_hour, curtime.tm_min, curtime.tm_sec)
				begintime = tuple(config.usage.standby_to_shutdown_timer_blocktime_begin.value)
				endtime = tuple(config.usage.standby_to_shutdown_timer_blocktime_end.value)
				if begintime <= endtime and (curtime >= begintime and curtime < endtime) or begintime > endtime and (curtime >= begintime or curtime < endtime):
					duration = (endtime[0]*3600 + endtime[1]*60) - (curtime[0]*3600 + curtime[1]*60 + curtime[2])
					if duration:
						if duration < 0:
							duration += 24*3600
						self.standbyTimeoutTimer.startLongTimer(duration)
						return
		if self.session.screen["TunerInfo"].tuner_use_mask or mediafilesInUse(self.session):
			self.standbyTimeoutTimer.startLongTimer(600)
		else:
			from RecordTimer import RecordTimerEntry
			RecordTimerEntry.TryQuitMainloop()

	def standbyWakeup(self):
		self.Power()
Exemple #55
0
class Standby2(Screen):
	def Power(self):
		print "leave standby"
		if (getBrandOEM() in ('fulan')):
			open("/proc/stb/hdmi/output", "w").write("on")
		#set input to encoder
		self.avswitch.setInput("ENCODER")
		#restart last played service
		#unmute adc
		self.leaveMute()
		# set LCDminiTV 
		if SystemInfo["Display"] and SystemInfo["LCDMiniTV"]:
			setLCDModeMinitTV(config.lcd.modeminitv.value)
		#remove wakup files and reset wakup state
		PowerTimer.resetTimerWakeup()
		RecordTimer.resetTimerWakeup()
		#kill me
		if os.path.exists("/usr/scripts/standby.sh") is True:
			os.system("chmod 755 /usr/scripts/standby.sh")
			os.system("/usr/scripts/standby.sh")
		else:
			print "/usr/scripts/standby.sh not found"
		self.close(True)

	def setMute(self):
		if eDVBVolumecontrol.getInstance().isMuted():
			self.wasMuted = 1
			print "mute already active"
		else:
			self.wasMuted = 0
			eDVBVolumecontrol.getInstance().volumeToggleMute()

	def leaveMute(self):
		if self.wasMuted == 0:
			eDVBVolumecontrol.getInstance().volumeToggleMute()

	def __init__(self, session):
		Screen.__init__(self, session)
		self.skinName = "Standby"
		self.avswitch = AVSwitch()

		print "enter standby"

		self["actions"] = ActionMap( [ "StandbyActions" ],
		{
			"power": self.Power,
			"discrete_on": self.Power
		}, -1)

		globalActionMap.setEnabled(False)

		self.standbyTimeUnknownTimer = eTimer()

		#mute adc
		self.setMute()
	
		if SystemInfo["Display"] and SystemInfo["LCDMiniTV"]:
			# set LCDminiTV off
			setLCDModeMinitTV("0")

		self.paused_service = None
		self.prev_running_service = None

		if self.session.current_dialog:
			if self.session.current_dialog.ALLOW_SUSPEND == Screen.SUSPEND_STOPS:
				if localtime(time()).tm_year > 1970 and self.session.nav.getCurrentlyPlayingServiceOrGroup():
					if config.servicelist.startupservice_standby.value:
						self.prev_running_service = eServiceReference(config.servicelist.startupservice_standby.value)
					else:
						self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup()
					self.session.nav.stopService()
				else:
					self.standbyTimeUnknownTimer.callback.append(self.stopService)
					self.standbyTimeUnknownTimer.startLongTimer(60)
			elif self.session.current_dialog.ALLOW_SUSPEND == Screen.SUSPEND_PAUSES:
				self.paused_service = self.session.current_dialog
				self.paused_service.pauseService()
		if self.session.pipshown:
			from Screens.InfoBar import InfoBar
			InfoBar.instance and hasattr(InfoBar.instance, "showPiP") and InfoBar.instance.showPiP()

		#set input to vcr scart
		if SystemInfo["ScartSwitch"]:
			self.avswitch.setInput("SCART")
		else:
			self.avswitch.setInput("AUX")
		if (getBrandOEM() in ('fulan')):
			open("/proc/stb/hdmi/output", "w").write("off")
		self.onFirstExecBegin.append(self.__onFirstExecBegin)
		self.onClose.append(self.__onClose)

	def __onClose(self):
		global inStandby
		inStandby = None
		self.standbyTimeUnknownTimer.stop()
		if self.prev_running_service:
			self.session.nav.playService(self.prev_running_service)
		elif self.paused_service:
			self.paused_service.unPauseService()
		self.session.screen["Standby"].boolean = False
		globalActionMap.setEnabled(True)

	def __onFirstExecBegin(self):
		global inStandby
		inStandby = self
		self.session.screen["Standby"].boolean = True
		config.misc.standbyCounter.value += 1

	def createSummary(self):
		return StandbySummary

	def stopService(self):
		if config.servicelist.startupservice_standby.value:
			self.prev_running_service = eServiceReference(config.servicelist.startupservice_standby.value)
		else:
			self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup()
		self.session.nav.stopService()
Exemple #56
0
	def __init__(self, session, StandbyCounterIncrease=True):
		Screen.__init__(self, session)
		self.avswitch = AVSwitch()

		print "[Standby] enter standby"

		if os.path.exists("/usr/script/standby_enter.sh"):
			Console().ePopen("/usr/script/standby_enter.sh")

		self["actions"] = ActionMap( [ "StandbyActions" ],
		{
			"power": self.Power,
			"discrete_on": self.Power
		}, -1)

		globalActionMap.setEnabled(False)

		from Screens.InfoBar import InfoBar
		from Screens.SleepTimerEdit import isNextWakeupTime
		self.infoBarInstance = InfoBar.instance
		self.StandbyCounterIncrease = StandbyCounterIncrease
		self.standbyTimeoutTimer = eTimer()
		self.standbyTimeoutTimer.callback.append(self.standbyTimeout)
		self.standbyStopServiceTimer = eTimer()
		self.standbyStopServiceTimer.callback.append(self.stopService)
		self.standbyWakeupTimer = eTimer()
		self.standbyWakeupTimer.callback.append(self.standbyWakeup)
		self.timeHandler = None

		self.setMute()

		self.paused_service = self.paused_action = False

		self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup()
		if Components.ParentalControl.parentalControl.isProtected(self.prev_running_service):
			self.prev_running_service = eServiceReference(config.tv.lastservice.value)
		service = self.prev_running_service and self.prev_running_service.toString()
		if service:
			if service.rsplit(":", 1)[1].startswith("/"):
				self.paused_service = hasattr(self.session.current_dialog, "pauseService") and hasattr(self.session.current_dialog, "unPauseService") and self.session.current_dialog or self.infoBarInstance
				self.paused_action = hasattr(self.paused_service, "seekstate") and hasattr(self.paused_service, "SEEK_STATE_PLAY") and self.paused_service.seekstate == self.paused_service.SEEK_STATE_PLAY
				self.paused_action and self.paused_service.pauseService()
		if not self.paused_service:
			self.timeHandler =  eDVBLocalTimeHandler.getInstance()
			if self.timeHandler.ready():
				if self.session.nav.getCurrentlyPlayingServiceOrGroup():
					self.stopService()
				else:
					self.standbyStopServiceTimer.startLongTimer(5)
				self.timeHandler = None
			else:
				self.timeHandler.m_timeUpdated.get().append(self.stopService)

		if self.session.pipshown:
			self.infoBarInstance and hasattr(self.infoBarInstance, "showPiP") and self.infoBarInstance.showPiP()

		if SystemInfo["ScartSwitch"]:
			self.avswitch.setInput("SCART")
		else:
			self.avswitch.setInput("AUX")

		gotoShutdownTime = int(config.usage.standby_to_shutdown_timer.value)
		if gotoShutdownTime:
			self.standbyTimeoutTimer.startLongTimer(gotoShutdownTime)

		gotoWakeupTime = isNextWakeupTime(True)
		if gotoWakeupTime != -1:
			curtime = localtime(time())
			if curtime.tm_year > 1970:
				wakeup_time = int(gotoWakeupTime - time())
				if wakeup_time > 0:
					self.standbyWakeupTimer.startLongTimer(wakeup_time)

		self.onFirstExecBegin.append(self.__onFirstExecBegin)
		self.onClose.append(self.__onClose)
	def __init__(self, session, StandbyCounterIncrease=True):
		Screen.__init__(self, session)
		self.avswitch = AVSwitch()

		print "[Standby] enter standby"

		if os.path.exists("/usr/script/standby_enter.sh"):
			Console().ePopen("/usr/script/standby_enter.sh")

		self["actions"] = ActionMap( [ "StandbyActions" ],
		{
			"power": self.Power,
			"discrete_on": self.Power
		}, -1)

		globalActionMap.setEnabled(False)

		from Screens.InfoBar import InfoBar
		from Screens.SleepTimerEdit import isNextWakeupTime
		self.infoBarInstance = InfoBar.instance
		self.StandbyCounterIncrease = StandbyCounterIncrease
		self.standbyTimeoutTimer = eTimer()
		self.standbyTimeoutTimer.callback.append(self.standbyTimeout)
		self.standbyStopServiceTimer = eTimer()
		self.standbyStopServiceTimer.callback.append(self.stopService)
		self.standbyWakeupTimer = eTimer()
		self.standbyWakeupTimer.callback.append(self.standbyWakeup)
		self.timeHandler = None

		self.setMute()

		self.paused_service = self.paused_action = False

		self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup()
		if Components.ParentalControl.parentalControl.isProtected(self.prev_running_service):
			self.prev_running_service = eServiceReference(config.tv.lastservice.value)
		service = self.prev_running_service and self.prev_running_service.toString()
		if service:
			if service.rsplit(":", 1)[1].startswith("/"):
				self.paused_service = hasattr(self.session.current_dialog, "pauseService") and hasattr(self.session.current_dialog, "unPauseService") and self.session.current_dialog or self.infoBarInstance
				self.paused_action = hasattr(self.paused_service, "seekstate") and hasattr(self.paused_service, "SEEK_STATE_PLAY") and self.paused_service.seekstate == self.paused_service.SEEK_STATE_PLAY
				self.paused_action and self.paused_service.pauseService()
		if not self.paused_service:
			self.timeHandler =  eDVBLocalTimeHandler.getInstance()
			if self.timeHandler.ready():
				if self.session.nav.getCurrentlyPlayingServiceOrGroup():
					self.stopService()
				else:
					self.standbyStopServiceTimer.startLongTimer(5)
				self.timeHandler = None
			else:
				self.timeHandler.m_timeUpdated.get().append(self.stopService)

		if self.session.pipshown:
			self.infoBarInstance and hasattr(self.infoBarInstance, "showPiP") and self.infoBarInstance.showPiP()

		if SystemInfo["ScartSwitch"]:
			self.avswitch.setInput("SCART")
		else:
			self.avswitch.setInput("AUX")

		gotoShutdownTime = int(config.usage.standby_to_shutdown_timer.value)
		if gotoShutdownTime:
			self.standbyTimeoutTimer.startLongTimer(gotoShutdownTime)

		gotoWakeupTime = isNextWakeupTime(True)
		if gotoWakeupTime != -1:
			curtime = localtime(time())
			if curtime.tm_year > 1970:
				wakeup_time = int(gotoWakeupTime - time())
				if wakeup_time > 0:
					self.standbyWakeupTimer.startLongTimer(wakeup_time)

		self.onFirstExecBegin.append(self.__onFirstExecBegin)
		self.onClose.append(self.__onClose)
def getScale():
    return AVSwitch().getFramebufferScale()
Exemple #59
0
class Standby2(Screen):
	def Power(self):
		print "[Standby] leave standby"
		if (getBrandOEM() in ('fulan')):
			open("/proc/stb/hdmi/output", "w").write("on")
		#set input to encoder
		self.avswitch.setInput("ENCODER")
		#restart last played service
		#unmute adc
		self.leaveMute()
		# set LCDminiTV 
		if SystemInfo["Display"] and SystemInfo["LCDMiniTV"]:
			setLCDModeMinitTV(config.lcd.modeminitv.value)
		#kill me
		self.close(True)

	def setMute(self):
		if eDVBVolumecontrol.getInstance().isMuted():
			self.wasMuted = 1
			print "[Standby] mute already active"
		else:
			self.wasMuted = 0
			eDVBVolumecontrol.getInstance().volumeToggleMute()

	def leaveMute(self):
		if self.wasMuted == 0:
			eDVBVolumecontrol.getInstance().volumeToggleMute()

	def __init__(self, session):
		Screen.__init__(self, session)
		self.skinName = "Standby"
		self.avswitch = AVSwitch()

		print "[Standby] enter standby"

		self["actions"] = ActionMap( [ "StandbyActions" ],
		{
			"power": self.Power,
			"discrete_on": self.Power
		}, -1)

		globalActionMap.setEnabled(False)

		self.standbyStopServiceTimer = eTimer()
		self.standbyStopServiceTimer.callback.append(self.stopService)
		self.timeHandler = None

		#mute adc
		self.setMute()
	
		if SystemInfo["Display"] and SystemInfo["LCDMiniTV"]:
			# set LCDminiTV off
			setLCDModeMinitTV("0")

		self.paused_service = None
		self.prev_running_service = None

		self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup()
		service = self.prev_running_service and self.prev_running_service.toString()
		if service:
			if service.startswith("1:") and service.rsplit(":", 1)[1].startswith("/"):
				self.paused_service = self.session.current_dialog
				self.paused_service.pauseService()
			else:
				self.timeHandler =  eDVBLocalTimeHandler.getInstance()
				if self.timeHandler.ready():
					if self.session.nav.getCurrentlyPlayingServiceOrGroup():
						self.stopService()
					else:
						self.standbyStopServiceTimer.startLongTimer(5)
					self.timeHandler = None
				else:
					self.timeHandler.m_timeUpdated.get().append(self.stopService)

		if self.session.pipshown:
			from Screens.InfoBar import InfoBar
			InfoBar.instance and hasattr(InfoBar.instance, "showPiP") and InfoBar.instance.showPiP()

		#set input to vcr scart
		if SystemInfo["ScartSwitch"]:
			self.avswitch.setInput("SCART")
		else:
			self.avswitch.setInput("AUX")
		if (getBrandOEM() in ('fulan')):
			open("/proc/stb/hdmi/output", "w").write("off")

		if int(config.usage.hdd_standby_in_standby.value) != -1: # HDD standby timer value (box in standby) / -1 = same as when box is active
			for hdd in harddiskmanager.HDDList():
				hdd[1].setIdleTime(int(config.usage.hdd_standby_in_standby.value))

		self.onFirstExecBegin.append(self.__onFirstExecBegin)
		self.onClose.append(self.__onClose)

	def __onClose(self):
		global inStandby
		inStandby = None
		self.standbyStopServiceTimer.stop()
		self.timeHandler and self.timeHandler.m_timeUpdated.get().remove(self.stopService)
		if self.paused_service:
			self.paused_service.unPauseService()
		elif self.prev_running_service:
			service = self.prev_running_service.toString()
			if config.servicelist.startupservice_onstandby.value:
				self.session.nav.playService(eServiceReference(config.servicelist.startupservice.value))
				from Screens.InfoBar import InfoBar
				InfoBar.instance and InfoBar.instance.servicelist.correctChannelNumber()
			else:
				self.session.nav.playService(self.prev_running_service)
		self.session.screen["Standby"].boolean = False
		globalActionMap.setEnabled(True)
		for hdd in harddiskmanager.HDDList():
			hdd[1].setIdleTime(int(config.usage.hdd_standby.value)) # HDD standby timer value (box active)

	def __onFirstExecBegin(self):
		global inStandby
		inStandby = self
		self.session.screen["Standby"].boolean = True
		config.misc.standbyCounter.value += 1

	def createSummary(self):
		return StandbySummary

	def stopService(self):
		self.session.nav.stopService()
Exemple #60
0
    def __init__(self,
                 session,
                 screenname="%",
                 suite_id="%",
                 title="SkinParts",
                 orderby="date desc",
                 showChangeSort=True,
                 pagelength=0,
                 type="%"):
        Screen.__init__(self, session)
        self["title"] = Label(_("OpenStore // " + _(screenname)))
        if screenname == "%":
            self["title"] = Label(_("OpenStore // " + _(title)))

        self.orderby = orderby
        self.screenname = screenname
        self.suite_id = suite_id
        self.pagelength = pagelength
        self.type = type
        self.session = session
        self["itemname"] = Label()
        self["author"] = Label(_("loading..."))
        self["votes"] = Label()
        self["date"] = Label()
        if showChangeSort:
            self["sort"] = Label(_("New"))
        else:
            self["sort"] = Label("")
        self["description"] = Label()
        self["isInstalled"] = Label()
        self.currentauthor = ""
        self.currentid = "0"
        self.image_id = ""
        self.image_token = ""
        self.currenttype = "widget"
        self.currentgroup = 'SkinParts'
        self.picPath = metrixDefaults.URI_IMAGE_LOADING
        self.Scale = AVSwitch().getFramebufferScale()
        self.PicLoad = ePicLoad()
        self["helperimage"] = Pixmap()

        #THREAD ACTIONS
        self.finished = False
        self.getCatalog = True
        self.getEntry = False
        self.action_downloadSkinPart = False
        self.thread_updater = threading.Thread(target=self.threadworker,
                                               args=())
        self.thread_updater.daemon = True

        self["menu"] = SkinPartsList([])
        self.menulist = []
        self.menulist.append(
            self.SkinPartsListEntry("-", _("loading, please wait...")))
        self["menu"].setList(self.menulist)

        self["actions"] = ActionMap(
            [
                "OkCancelActions", "DirectionActions", "InputActions",
                "ColorActions"
            ], {
                "up": self.keyUp,
                "ok": self.selectItem,
                "green": self.installSkinPart,
                "blue": self.changeSort,
                "down": self.keyDown,
                "right": self.pageDown,
                "left": self.pageUp,
                "yellow": self.openRating,
                "cancel": self.exit
            }, -1)

        self.UpdatePicture()
        self.onLayoutFinish.append(self.startThread)