예제 #1
0
	def ScartHdmi(self):
		if isinstance(self, InfoBar):
			#print '****** videomode ******'
			port = config.av.videoport.value
			#print 'actual port = ', port
			from Plugins.SystemPlugins.Videomode.VideoHardware import video_hw
			if port == 'HDMI':
				port = 'Scart'
				mode = 'PAL'
				rate = '50Hz'
				config.av.videoport.value = port
				config.av.videomode[port].value = mode
				config.av.videorate[mode].value = rate
				config.av.save()
				video_hw.setMode(port, mode, rate)
			else:
				port = 'HDMI'
				mode = '720p'
				rate = '50Hz'
				config.av.videoport.value = port
				config.av.videomode[port].value = mode
				config.av.videorate[mode].value = rate
				config.av.save()
				video_hw.setMode(port, mode, rate)
			self.session.open(MessageBox, 'Videomode changed to ' + mode + ' at ' + rate + ' on ' + port, MessageBox.TYPE_INFO, timeout=10)
예제 #2
0
	def setMode(self, mode, set=True):
		rate = config.av.videorate[mode].value
		resolutionlabel["restxt"].setText("Videomode: %s %s %s" % (port, mode, rate))
		if set:
			print "[AutoRes] switching to %s %s %s" % (port, mode, rate)
			if config.plugins.autoresolution.showinfo.value:
				resolutionlabel.show()
			video_hw.setMode(port, mode, rate)
		self.lastmode = mode
예제 #3
0
	def setMode(self, mode, set=True):
		rate = config.av.videorate[mode].value
		resolutionlabel["restxt"].setText("Videomode: %s %s %s" % (port, mode, rate))
		if set:
			print "[AutoRes] switching to %s %s %s" % (port, mode, rate)
			if config.plugins.autoresolution.showinfo.value:
				resolutionlabel.show()
			video_hw.setMode(port, mode, rate)
		self.lastmode = mode
예제 #4
0
 def switch(self, Tokodi=False, Player=False):
     if Tokodi:
         if self.kodires and self.kodirate and self.port:
             video_hw.setMode(self.port, self.kodires, self.kodirate)
             open("/proc/stb/video/videomode",
                  "w").write(self.kodires + self.kodirate.replace("Hz", ""))
     else:
         if self.E2res and self.rate and self.port:
             video_hw.setMode(self.port, self.E2res, self.rate)
예제 #5
0
	def setMode(self, mode, set=True):
		if config.plugins.autoresolution.mode.value != "manual":
			return
		rate = config.av.videorate[mode].value
		resolutionlabel["restxt"].setText(_("Videomode: %s %s %s") % (port, mode, rate))
		if set:
			print "[AutoRes] switching to %s %s %s" % (port, mode, rate)
			if config.plugins.autoresolution.showinfo.value:
				resolutionlabel.show()
			try:
				video_hw.setMode(port, mode, rate)
			except:
				print "[AutoRes] Videomode: failed switching to", mode
				return
		self.lastmode = mode
예제 #6
0
	def setMode(self, mode, set=True):
		if config.plugins.autoresolution.mode.value != "manual":
			return
		rate = config.av.videorate[mode].value
		port_txt = "HDMI" if port == "DVI" else port
		resolutionlabel["restxt"].setText(_("Videomode: %s %s %s") % (port_txt, mode, rate))
		if set:
			print "[AutoRes] switching to %s %s %s" % (port_txt, mode, rate)
			if config.plugins.autoresolution.showinfo.value:
				resolutionlabel.show()
			try:
				video_hw.setMode(port, mode, rate)
			except:
				print "[AutoRes] Videomode: failed switching to", mode
				return
		self.lastmode = mode
예제 #7
0
	def func(self, entry):
		self["menulist"].hide()
		if "ch1" in entry[1]:
			video_hw.setMode("Scart", "720p", "50Hz")
			config.av.colorformat.value = "cvbs"
			open("/proc/stb/video/aspect", "w").write("4:3")
			self.setTone("off")
			self.playService(entry[1])
		elif "ch2" in entry[1]:
			video_hw.setMode("YPbPr", "576i", "50Hz")
			config.av.colorformat.value = "yuv"
			open("/proc/stb/video/aspect", "w").write("4:3")
			self.setTone("off")
			self.playService(entry[1])
		elif "ch3" in entry[1]:
			video_hw.setMode("Scart", "576i", "50Hz")
			config.av.colorformat.value = "rgb"
			open("/proc/stb/video/aspect", "w").write("16:9")
			self.setTone("off")
			self.playService(entry[1])
		elif "ch4" in entry[1]:
			video_hw.setMode("Scart", "1080i", "50Hz")
			config.av.colorformat.value = "cvbs"
			open("/proc/stb/video/aspect", "w").write("16:9")
			self.setTone("off")
			self.playService(entry[1])
		elif entry[1] == "tone":
			if "[ON]" in entry[0]:
				self.setTone("off")
			else:
				self.setTone("on")

			# TODO  - romove below channel change codes,
			# without channel change, tuner configuration does not change
			if self.service == "ch1":
				self.playService("ch2")
				self.playService("ch1")
			elif self.service == "ch2":
				self.playService("ch1")
				self.playService("ch2")
			elif self.service == "ch3":
				self.playService("ch4")
				self.playService("ch3")
			elif self.service == "ch4":
				self.playService("ch3")
				self.playService("ch4")

		elif entry[1] == "fan":
			if "[ON]" in entry[0]:
				self.setFan("off")
			else:
				self.setFan("on")
		elif entry[1] == "fp":
			self.fpTest()
		elif entry[1] == "ds":
			self.deepStandby()
		elif entry[1] == "exit":
			self.session.openWithCallback(self.quitConfirmed, MessageBox, _("Do you really want to quit?"), default = True)
		else:
			print "what", entry
		self["menulist"].show()

		# show vfd message
		index = 0
		for menu in self.MENU_LIST:
			if menu[1] == entry[1]:
				os.system("echo \"%s\" > /proc/stb/lcd/show_txt" % self.MENU_LIST[index][0])
				self.vfdTextWrite(self.MENU_LIST[index][0])
				break
			index += 1