当前位置: 首页>>代码示例>>Python>>正文


Python ISO639.LanguageCodes类代码示例

本文整理汇总了Python中Tools.ISO639.LanguageCodes的典型用法代码示例。如果您正苦于以下问题:Python LanguageCodes类的具体用法?Python LanguageCodes怎么用?Python LanguageCodes使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了LanguageCodes类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: getAudioTracks

def getAudioTracks(session):
	service = session.nav.getCurrentService()
	audio = service and service.audioTracks()
	ret = { "tracklist": [], "result": False }
	if audio is not None and service is not None:
		current = audio.getCurrentTrack()
		for i in range(0, audio.getNumberOfTracks()):
			track = audio.getTrackInfo(i)
			languages = track.getLanguage().split('/')
			language = ""
			for lang in languages:
				if len(language) > 0:
					language += " / "
					
				if LanguageCodes.has_key(lang):
					language += LanguageCodes[lang][0]
				else:
					language += lang
					
			description = track.getDescription()
			if description:
				description += " (" + language + ")"
			else:
				description = language
				
			ret["result"] = True
			ret["tracklist"].append({
				"description": description,
				"index": i,
				"pid": track.getPID(),
				"active": i == current
			})
			
	return ret
开发者ID:Igornord,项目名称:e2openplugin-OpenWebif,代码行数:34,代码来源:audiotrack.py

示例2: language_iso639_2to3

def language_iso639_2to3(alpha2):
	ret = alpha2
	if alpha2 in LanguageCodes:
		language = LanguageCodes[alpha2]
		for alpha, name in LanguageCodes.items():
			if name == language:
				if len(alpha) == 3:
					return alpha
	return ret
开发者ID:VytenisP,项目名称:e2openplugin-EnhancedMovieCenter,代码行数:9,代码来源:EitSupport.py

示例3: getAudioInformation

    def getAudioInformation(self):
        bInitialized = False
        if self.iService == None:
            self.initAudio()
            bInitialized = True

        # check if we are in a recording
        lCurPosition = self.cueGetCurrentPosition()
        if lCurPosition is not None:
            self.bIsRecording = True
            
        # check if downmix is enabled
        try:
            bDownmixEnabled = config.av.downmix_ac3.value
        except:
            bDownmixEnabled = False

        oAudioTracks = self.iService and self.iService.audioTracks()
        n = oAudioTracks and oAudioTracks.getNumberOfTracks() or 0
        tlist = []
        self.selectedAudioInfo = ("", 0)
        self.selectedAudioIndex = None
        if n > 0:
            self.selectedAudioIndex = oAudioTracks.getCurrentTrack()
            for x in range(n):
                i = oAudioTracks.getTrackInfo(x)
                language = i.getLanguage()
                description = i.getDescription()
                if LanguageCodes.has_key(language):
                    language = LanguageCodes[language][0]
                if len(description):
                    description += " (" + language + ")"
                else:
                    description = language

                tlist.append((description, x))
                if x == self.selectedAudioIndex:
                    if ((description.find("AC3") != -1 or description.find("AC-3") != -1) and not bDownmixEnabled) or description.find("DTS") != -1:
                        self.whichAudio = AC3
                        self.channelAudio = AC3
                    else:
                        self.whichAudio = PCM
                        self.channelAudio = PCM
                    self.selectedAudioInfo = (description, x)
            tlist.sort(key=lambda x: x[0])

        self.audioTrackList = tlist
        for sAudio in AC3PCM:
            self.systemDelay[sAudio]=self.getSystemDelay(sAudio)
        del oAudioTracks
        if bInitialized == True:
            self.deleteAudio()
开发者ID:beyonwiz,项目名称:enigma2-plugins,代码行数:52,代码来源:AC3delay.py

示例4: fillList

	def fillList(self):
		list = self.list
		del list[:]
		print "self.list", list
		if self.subtitlesEnabled():
			list.append(getConfigListEntry(_("Disable Subtitles"), ConfigNothing(), None))
			sel = self.infobar.selected_subtitle
		else:
			sel = None
		for x in self.getSubtitleList():
			if sel and sel[:4] == x[:4]: #ignore Language code in compare
				text = _("Running")
			else:
				text = _("Enable")
			if x[0] == 0:
				if LanguageCodes.has_key(x[4]):
					list.append(getConfigListEntry(text+" DVB "+LanguageCodes[x[4]][0], ConfigNothing(), x))
				else:
					list.append(getConfigListEntry(text+" DVB "+x[4], ConfigNothing(), x))
			elif x[0] == 1:
				if x[4] == 'und': #undefined
					list.append(getConfigListEntry(text+" TTX "+_("Page")+" %x%02x"%(x[3],x[2]), ConfigNothing(), x))
				else:
					if LanguageCodes.has_key(x[4]):
						list.append(getConfigListEntry(text+" TTX "+_("Page")+" %x%02x"%(x[3],x[2])+" "+LanguageCodes[x[4]][0], ConfigNothing(), x))
					else:
						list.append(getConfigListEntry(text+" TTX "+_("Page")+" %x%02x"%(x[3],x[2])+" "+x[4], ConfigNothing(), x))
			elif x[0] == 2:
				types = (" UTF-8 text "," SSA / AAS "," .SRT file ")
				if x[4] == 'und': #undefined
					list.append(getConfigListEntry(text+types[x[2]]+_("Subtitles")+" %d" % x[1], ConfigNothing(), x))
				else:
					if LanguageCodes.has_key(x[4]):
						list.append(getConfigListEntry(text+types[x[2]]+_("Subtitles") + ' ' + LanguageCodes[x[4]][0], ConfigNothing(), x))
					else:
						list.append(getConfigListEntry(text+types[x[2]]+_("Subtitles")+" %d " % x[1] +x[4], ConfigNothing(), x))
#		return _("Disable subtitles")
		self["config"].list = list
		self["config"].l.setList(list)
开发者ID:fairbird,项目名称:Blackhole-OpenATV,代码行数:39,代码来源:Subtitles.py

示例5: setAudioTrack

def setAudioTrack(service):
    try:
        from Tools.ISO639 import LanguageCodes as langC
        tracks = service and service.audioTracks()
        nTracks = tracks and tracks.getNumberOfTracks() or 0
        if not nTracks:
            return
        idx = 0
        trackList = []
        for i in xrange(nTracks):
            audioInfo = tracks.getTrackInfo(i)
            lang = audioInfo.getLanguage()
            if langC.has_key(lang):
                lang = langC[lang][0]
            desc = audioInfo.getDescription()
            track = (idx, lang, desc)
            idx += 1
            trackList += [track]

        seltrack = tracks.getCurrentTrack()
        from Components.Language import language
        syslang = language.getLanguage()[:2]
        syslang = langC[syslang][0]
        if (config.autolanguage.audio_autoselect1.value or config.autolanguage.audio_autoselect2.value or config.autolanguage.audio_autoselect3.value or config.autolanguage.audio_autoselect4.value) != '---':
            audiolang = [config.autolanguage.audio_autoselect1.value,
             config.autolanguage.audio_autoselect2.value,
             config.autolanguage.audio_autoselect3.value,
             config.autolanguage.audio_autoselect4.value]
            caudiolang = True
        else:
            audiolang = syslang
            caudiolang = False
        useAc3 = config.autolanguage.audio_defaultac3.value
        if useAc3:
            matchedAc3 = tryAudioTrack(tracks, audiolang, caudiolang, trackList, seltrack, useAc3)
            if matchedAc3:
                return
            matchedMpeg = tryAudioTrack(tracks, audiolang, caudiolang, trackList, seltrack, False)
            if matchedMpeg:
                return
            tracks.selectTrack(0)
            return
        matchedMpeg = tryAudioTrack(tracks, audiolang, caudiolang, trackList, seltrack, False)
        if matchedMpeg:
            return
        matchedAc3 = tryAudioTrack(tracks, audiolang, caudiolang, trackList, seltrack, useAc3)
        if matchedAc3:
            return
        tracks.selectTrack(0)
    except Exception as e:
        print '[MoviePlayer] audioTrack exception:\n' + str(e)
开发者ID:kingvuplus,项目名称:boom,代码行数:51,代码来源:InfoBar.py

示例6: setSubtitleState

	def setSubtitleState(self, enabled):
		try:
			if not config.EMC.autosubs.value or not enabled: return
			from Tools.ISO639 import LanguageCodes as langC
			subs = self.getCurrentServiceSubtitle() or self.getServiceInterface("subtitle")
			if subs:
				lt = [ (e, (e[0] == 0 and "DVB" or e[0] == 1 and "TXT" or "???")) for e in (subs and subs.getSubtitleList() or []) ]
				if lt:
					l = [ [e[0], e[1], langC.has_key(e[0][4]) and langC[e[0][4]][0] or e[0][4] ] for e in lt ]
					if l:
						for sublang in [config.EMC.sublang1.value, config.EMC.sublang2.value, config.EMC.sublang3.value]:
							if self.trySubEnable(l, sublang): break
		except Exception, e:
			emcDebugOut("[EMCPlayer] setSubtitleState exception:\n" + str(e))
开发者ID:mukaso,项目名称:e2openplugin-EnhancedMovieCenter,代码行数:14,代码来源:EMCMediaCenter.py

示例7: __init__

	def __init__(self):
		from Components.Language import language as syslanguage
		syslang = syslanguage.getLanguage()[:2]
		self.langdict = { }
		self.choices = []
		for key, val in LanguageCodes.iteritems():
			if len(key) == 2:
				self.langdict[key] = val[0]
		for key, val in self.langdict.iteritems():
			if key not in (syslang, 'en'):
				self.langdict[key] = val
				self.choices.append((key, val))
		self.choices.sort()
		self.choices.insert(0,("nolang", ("unspecified")))
		self.choices.insert(1,(syslang, self.langdict[syslang]))
		self.choices.insert(2,("en", self.langdict["en"]))
开发者ID:TitanNit,项目名称:tdt,代码行数:16,代码来源:TitleProperties.py

示例8: getAudioTracks

	def getAudioTracks(self):
		service = self.session.nav.getCurrentService()
		audio = service and service.audioTracks()
		n = audio and audio.getNumberOfTracks() or 0

		tracklist = []

		#check for standby
		if audio is not None and service is not None:
			currentTrack = audio.getCurrentTrack()

			if n > 0:
				print "[AudioTracks.py] got %s Audiotracks!" % (n)

				x = 0
				while x < n:
					cnt = 0
					i = audio.getTrackInfo(x)

					languages = i.getLanguage().split('/')
					description = i.getDescription()
					pid = i.getPID()
					language = ''

					for lang in languages:
						if cnt:
							language += ' / '
						if LanguageCodes.has_key(lang):
							language += LanguageCodes[lang][0]
						else:
							language += lang
						cnt += 1

					if description:
						description += " (" + language + ")"
					else:
						description = language

					if x == currentTrack:
						active = "True"
					else:
						active = "False"

					tracklist.append((description, x, pid, active))
					x += 1

		return tracklist
开发者ID:13K-OMAR,项目名称:enigma2-plugins-sh4,代码行数:47,代码来源:AudioTracks.py

示例9: getLanguage

	def getLanguage(self, DVB_lang):
		DVB_lang = DVB_lang.lower()
		for word in ("stereo", "audio", "description", "2ch", "dolby digital"):
			DVB_lang = DVB_lang.replace(word,"").strip()
		for key, val in LanguageCodes.iteritems():
			if DVB_lang.find(key.lower()) == 0:
				if len(key) == 2:
					return key
				else:
					DVB_lang = (LanguageCodes[key])[0]
			elif DVB_lang.find(val[0].lower()) > -1:
				if len(key) == 2:
					return key
				else:
					DVB_lang = (LanguageCodes[key])[0]
		for key, val in self.langdict.iteritems():
			if val == DVB_lang:
				return key
		return "nolang"
开发者ID:aimejeux,项目名称:enigma2,代码行数:19,代码来源:TitleProperties.py

示例10: fillList

	def fillList(self, arg=None):
		streams = []
		conflist = []
		selectedidx = 0

		self["key_red"].setBoolean(False)
		self["key_green"].setBoolean(False)
		self["key_yellow"].setBoolean(False)
		self["key_blue"].setBoolean(False)

		subtitlelist = self.getSubtitleList()

		if self.settings.menupage.value == PAGE_AUDIO:
			self.setTitle(_("Select audio track"))
			service = self.session.nav.getCurrentService()
			self.audioTracks = audio = service and service.audioTracks()
			n = audio and audio.getNumberOfTracks() or 0
			if SystemInfo["CanDownmixAC3"]:
				self.settings.downmix_ac3 = ConfigOnOff(default=config.av.downmix_ac3.value)
				self.settings.downmix_ac3.addNotifier(self.changeAC3Downmix, initial_call = False)
				conflist.append(getConfigListEntry(_("Digital downmix"), self.settings.downmix_ac3, None))

			if SystemInfo["CanDownmixAAC"]:
				self.settings.downmix_aac = ConfigOnOff(default=config.av.downmix_aac.value)
				self.settings.downmix_aac.addNotifier(self.changeAACDownmix, initial_call = False)
				conflist.append(getConfigListEntry(_("AAC downmix"), self.settings.downmix_aac, None))

			if SystemInfo["CanAACTranscode"]:
				choice_list = [("off", _("off")), ("ac3", _("AC3")), ("dts", _("DTS"))]
				self.settings.transcodeaac = ConfigSelection(choices = choice_list, default = "off")
				self.settings.transcodeaac.addNotifier(self.setAACTranscode, initial_call = False)
				conflist.append(getConfigListEntry(_("AAC transcoding"), self.settings.transcodeaac, None))

			if SystemInfo["CanPcmMultichannel"]:
				self.settings.pcm_multichannel = ConfigOnOff(default=config.av.pcm_multichannel.value)
				self.settings.pcm_multichannel.addNotifier(self.changePCMMultichannel, initial_call = False)
				conflist.append(getConfigListEntry(_("PCM Multichannel"), self.settings.pcm_multichannel, None))

			if n > 0:
				self.audioChannel = service.audioChannel()
				if self.audioChannel:
					choicelist = [("0",_("left")), ("1",_("stereo")), ("2", _("right"))]
					self.settings.channelmode = ConfigSelection(choices = choicelist, default = str(self.audioChannel.getCurrentChannel()))
					self.settings.channelmode.addNotifier(self.changeMode, initial_call = False)
					conflist.append(getConfigListEntry(_("Channel"), self.settings.channelmode, None))
				selectedAudio = self.audioTracks.getCurrentTrack()
				for x in range(n):
					number = str(x + 1)
					i = audio.getTrackInfo(x)
					languages = i.getLanguage().split('/')
					description = i.getDescription() or ""
					selected = ""
					language = ""

					if selectedAudio == x:
						selected = "X"
						selectedidx = x

					cnt = 0
					for lang in languages:
						if cnt:
							language += ' / '
						if LanguageCodes.has_key(lang):
							language += _(LanguageCodes[lang][0])
						else:
							language += lang
						cnt += 1

					streams.append((x, "", number, description, language, selected))

			else:
				conflist.append(('',))

			if SystemInfo["Can3DSurround"]:
				choice_list = [("none", _("off")), ("hdmi", _("HDMI")), ("spdif", _("SPDIF")), ("dac", _("DAC"))]
				self.settings.surround_3d = ConfigSelection(choices = choice_list, default = config.av.surround_3d.value)
				self.settings.surround_3d.addNotifier(self.change3DSurround, initial_call = False)
				conflist.append(getConfigListEntry(_("3D Surround"), self.settings.surround_3d, None))

			if SystemInfo["Can3DSpeaker"] and config.av.surround_3d.value != "none":
				choice_list = [("center", _("center")), ("wide", _("wide")), ("extrawide", _("extra wide"))]
				self.settings.surround_3d_speaker = ConfigSelection(choices = choice_list, default = config.av.surround_3d_speaker.value)
				self.settings.surround_3d_speaker.addNotifier(self.change3DSurroundSpeaker, initial_call = False)
				conflist.append(getConfigListEntry(_("3D Surround Speaker Position"), self.settings.surround_3d_speaker, None))

			if SystemInfo["CanAutoVolume"]:
				choice_list = [("none", _("off")), ("hdmi", _("HDMI")), ("spdif", _("SPDIF")), ("dac", _("DAC"))]
				self.settings.autovolume = ConfigSelection(choices = choice_list, default = config.av.autovolume.value)
				self.settings.autovolume.addNotifier(self.changeAutoVolume, initial_call = False)
				conflist.append(getConfigListEntry(_("Auto Volume Level"), self.settings.autovolume, None))

			if SystemInfo["Canedidchecking"]:
				choice_list = [("00000001", _("on")), ("00000000", _("off"))]
				self.settings.bypass_edid_checking = ConfigSelection(choices = choice_list, default = config.av.bypass_edid_checking.value)
				self.settings.bypass_edid_checking.addNotifier(self.changeEDIDChecking, initial_call = False)
				conflist.append(getConfigListEntry(_("Bypass HDMI EDID Check"), self.settings.bypass_edid_checking, None))

			from Components.PluginComponent import plugins
			from Plugins.Plugin import PluginDescriptor

#.........这里部分代码省略.........
开发者ID:OpenLD,项目名称:enigma2-wetek,代码行数:101,代码来源:AudioSelection.py

示例11: fillList

	def fillList(self, arg=None):
		streams = []
		conflist = []
		selectedidx = 0

		if self.settings.menupage.getValue() == PAGE_AUDIO:
			self.setTitle(_("Select audio track"))
			service = self.session.nav.getCurrentService()
			self.audioTracks = audio = service and service.audioTracks()
			n = audio and audio.getNumberOfTracks() or 0
			if SystemInfo["CanDownmixAC3"]:
				self.settings.downmix = ConfigOnOff(default=config.av.downmix_ac3.value)
				self.settings.downmix.addNotifier(self.changeAC3Downmix, initial_call = False)
				conflist.append(getConfigListEntry(_("Dolby Digital / DTS downmix"), self.settings.downmix))
				self["key_red"].setBoolean(True)
			
			if SystemInfo["CanDownmixAAC"]:
				self.settings.downmix_aac = ConfigOnOff(default=config.av.downmix_aac.value)
				self.settings.downmix_aac.addNotifier(self.changeAACDownmix, initial_call = False)
				conflist.append(getConfigListEntry(_("AAC downmix"), self.settings.downmix_aac))

			if n > 0:
				self.audioChannel = service.audioChannel()
				if self.audioChannel:
					choicelist = [("0",_("left")), ("1",_("stereo")), ("2", _("right"))]
					self.settings.channelmode = ConfigSelection(choices = choicelist, default = str(self.audioChannel.getCurrentChannel()))
					self.settings.channelmode.addNotifier(self.changeMode, initial_call = False)
					conflist.append(getConfigListEntry(_("Channel"), self.settings.channelmode))
					self["key_green"].setBoolean(True)
				else:
					conflist.append(('',))
					self["key_green"].setBoolean(False)
				selectedAudio = self.audioTracks.getCurrentTrack()
				for x in range(n):
					number = str(x + 1)
					i = audio.getTrackInfo(x)
					languages = i.getLanguage().split('/')
					description = i.getDescription() or _("<unknown>")
					selected = ""
					language = ""

					if selectedAudio == x:
						selected = _("Running")
						selectedidx = x

					cnt = 0
					for lang in languages:
						if cnt:
							language += ' / '
						if LanguageCodes.has_key(lang):
							language += LanguageCodes[lang][0]
						elif lang == "und":
							_("<unknown>")
						else:
							language += lang
						cnt += 1

					streams.append((x, "", number, description, language, selected))

			else:
				streams = []
				conflist.append(('',))
				self["key_green"].setBoolean(False)
			
			if SystemInfo["CanMultiChannelPCM"]:
				self.settings.multichannel_pcm = ConfigOnOff(default=config.av.multichannel_pcm.value)
				self.settings.multichannel_pcm.addNotifier(self.changeMultiChannelPCM, initial_call = False)
				conflist.append(getConfigListEntry(_("Multichannel PCM"), self.settings.multichannel_pcm))
				self["key_blue"].setBoolean(True)
			
			if SystemInfo["Can3DSurround"]:
				choicelist = [("none", _("off")), ("hdmi", _("HDMI")), ("spdif", _("SPDIF")), ("dac", _("DAC"))]
				self.settings.surround_3d = ConfigSelection(choices = choicelist, default = config.av.surround_3d.value)
				self.settings.surround_3d.addNotifier(self.change3DSurround, initial_call = False)
				conflist.append(getConfigListEntry(_("3D Surround"), self.settings.surround_3d))
				self["key_blue"].setBoolean(True)
				
			if SystemInfo["CanSpeakerPosition"] and SystemInfo["Can3DSurround"] and config.av.surround_3d.value != "none":
				choicelist = [("center", _("center")), ("wide", _("wide")), ("extrawide", _("extrawide"))]
				self.settings.speaker_position = ConfigSelection(choices = choicelist, default = config.av.surround_speaker_position.value)
				self.settings.speaker_position.addNotifier(self.changeSpeakerPosition, initial_call = False)
				conflist.append(getConfigListEntry(_("Speaker position"), self.settings.speaker_position))
				
			if SystemInfo["CanAVL"]:
				choicelist = [("none", _("off")), ("hdmi", _("HDMI")), ("spdif", _("SPDIF")), ("dac", _("DAC"))]
				self.settings.avl = ConfigSelection(choices = choicelist, default = config.av.avl.value)
				self.settings.avl.addNotifier(self.changeAVL, initial_call = False)
				conflist.append(getConfigListEntry(_("Automatic Volume Leveling (AVL)"), self.settings.avl))
			
			edid_bypass_choicelist = [("00000000", _("off")), ("00000001", _("on"))]
			self.settings.edid_bypass = ConfigSelection(choices = edid_bypass_choicelist, default = config.av.bypass_edid_checking.value)
			self.settings.edid_bypass.addNotifier(self.changeEDIDBypass, initial_call = False)
			conflist.append(getConfigListEntry(_("Bypass HDMI EDID Check"), self.settings.edid_bypass))

			self.settings.volume = NoSave(ConfigSlider(default=config.audio.volume.value, increment = 5, limits=(0,100)))
			self.settings.volume.addNotifier(self.changeVolume, initial_call = False)
			conflist.append(getConfigListEntry(_("Volume"), self.settings.volume))

		elif self.settings.menupage.getValue() == PAGE_SUBTITLES:
			self.setTitle(_("Subtitle selection"))
#.........这里部分代码省略.........
开发者ID:kingvuplus,项目名称:test2,代码行数:101,代码来源:AudioSelection.py

示例12: fillList

	def fillList(self, arg=None):
		streams = []
		conflist = []
		selectedidx = 0

		# self["key_blue"].setBoolean(False)

		service = self.session.nav.getCurrentService()
		self.audioTracks = audio = service and service.audioTracks()
		n = audio and audio.getNumberOfTracks() or 0
		
		subtitlelist = self.getSubtitleList()
		self.nummplugin=None
		
		#### modify this section for add audio functions
		if self.settings.menupage.getValue() == PAGE_AUDIO:
			self.setTitle(_("Select audio track"))
			self["key_yellow"].setBoolean(True)
			self["key_green"].setBoolean(True)
			self["key_red"].setBoolean(True)
			service = self.session.nav.getCurrentService()
			self.audioTracks = audio = service and service.audioTracks()
			n = audio and audio.getNumberOfTracks() or 0
			if SystemInfo["CanDownmixAC3"]:
				self.settings.downmix_ac3 = ConfigOnOff(default=config.av.downmix_ac3.getValue())
				self.settings.downmix_ac3.addNotifier(self.changeAC3Downmix, initial_call = False)
				conflist.append(getConfigListEntry(_("AC3 downmix"), self.settings.downmix_ac3))

			if SystemInfo["CanDownmixAAC"]:
				self.settings.downmix_aac = ConfigOnOff(default=config.av.downmix_aac.getValue())
				self.settings.downmix_aac.addNotifier(self.changeAACDownmix, initial_call = False)
				conflist.append(getConfigListEntry(_("AAC downmix"), self.settings.downmix_aac))

			if SystemInfo["Can3DSurround"]:
				surround_choicelist = [("none", _("off")), ("hdmi", _("HDMI")), ("spdif", _("SPDIF")), ("dac", _("DAC"))]
				self.settings.surround_3d = ConfigSelection(choices = surround_choicelist, default = config.av.surround_3d.getValue())
				self.settings.surround_3d.addNotifier(self.change3DSurround, initial_call = False)
				conflist.append(getConfigListEntry(_("3D Surround"), self.settings.surround_3d))

			if SystemInfo["CanPcmMultichannel"]:
				self.settings.pcm_multichannel = ConfigOnOff(default=config.av.pcm_multichannel.getValue())
				self.settings.pcm_multichannel.addNotifier(self.changePCMMultichannel, initial_call = False)
				conflist.append(getConfigListEntry(_("PCM Multichannel"), self.settings.pcm_multichannel, None))

			if SystemInfo["Canedidchecking"]:
				edid_bypass_choicelist = [("00000001", _("on")), ("00000000", _("off"))]
				self.settings.edid_bypass = ConfigSelection(choices = edid_bypass_choicelist, default = config.av.bypass_edid_checking.getValue())
				self.settings.edid_bypass.addNotifier(self.changeEDIDBypass, initial_call = False)
				conflist.append(getConfigListEntry(_("Bypass HDMI EDID Check"), self.settings.edid_bypass))

			if n > 0:
				self.audioChannel = service.audioChannel()
				if self.audioChannel:
					choicelist = [("0",_("left")), ("1",_("stereo")), ("2", _("right"))]
					self.settings.channelmode = ConfigSelection(choices = choicelist, default = str(self.audioChannel.getCurrentChannel()))
					self.settings.channelmode.addNotifier(self.changeMode, initial_call = False)
					conflist.append(getConfigListEntry(_("Channel"), self.settings.channelmode))
				else:
					conflist.append(getConfigListEntry("", ConfigNothing()))
					# self["key_green"].setBoolean(False)
				selectedAudio = self.audioTracks.getCurrentTrack()
				conta=0
				
				
				for x in range(n):
					
					number = str(conta + 1)
					i = audio.getTrackInfo(x)
					
					languages = i.getLanguage().split('/')
					description = i.getDescription() or ""
					pondebug("AUDIO "+str(conta)+" - "+str(languages)+" - "+str(description))
					selected = ""
					language = ""

					if selectedAudio == x:
						selected = "X"
						selectedidx = x

					cnt = 0
					for lang in languages:
						if cnt:
							language += ' / '
						if lang.lower() == "und":
							language +=_("Language")+" "+number+""
						elif lang.lower() == "qaa":
							language +=_("Original track audio")+""
						elif LanguageCodes.has_key(lang):
							templan=str(LanguageCodes[lang][0])
							if templan==None or templan=="":
								language +=_("Language")+" "+number+" ("+str(lang)+")"
							else:
								language += _(templan)
						else:
							
							if lang==None or lang=="":
								language += _("Language")+" ["+number+"] "+str(lang)+""
							else:
								language += _("Language")+" ["+number+"] "+str(lang)+""

#.........这里部分代码省略.........
开发者ID:vitmod,项目名称:dvbapp,代码行数:101,代码来源:AudioSelection.py

示例13: fillList

    def fillList(self, arg = None):
        streams = []
        conflist = []
        selectedidx = 0
        self['key_red'].setBoolean(False)
        self['key_green'].setBoolean(False)
        self['key_yellow'].setBoolean(False)
        self['key_blue'].setBoolean(False)
        service = self.session.nav.getCurrentService()
        self.audioTracks = audio = service and service.audioTracks()
        n = audio and audio.getNumberOfTracks() or 0
        subtitlelist = self.getSubtitleList()
        if self.settings.menupage.value == PAGE_AUDIO:
            self.setTitle(_('Select audio track'))
            service = self.session.nav.getCurrentService()
            self.audioTracks = audio = service and service.audioTracks()
            n = audio and audio.getNumberOfTracks() or 0
            if SystemInfo['CanDownmixAC3']:
                self.settings.downmix_ac3 = ConfigOnOff(default=config.av.downmix_ac3.value)
                self.settings.downmix_ac3.addNotifier(self.changeAC3Downmix, initial_call=False)
                conflist.append(getConfigListEntry(_('Digital downmix'), self.settings.downmix_ac3, None))
            if SystemInfo['CanDownmixAAC']:
                self.settings.downmix_aac = ConfigOnOff(default=config.av.downmix_aac.value)
                self.settings.downmix_aac.addNotifier(self.changeAACDownmix, initial_call=False)
                conflist.append(getConfigListEntry(_('AAC downmix'), self.settings.downmix_aac, None))
            if SystemInfo['CanAACTranscode']:
                choice_list = [('off', _('off')), ('ac3', _('AC3')), ('dts', _('DTS'))]
                self.settings.transcodeaac = ConfigSelection(choices=choice_list, default='off')
                self.settings.transcodeaac.addNotifier(self.setAACTranscode, initial_call=False)
                conflist.append(getConfigListEntry(_('AAC transcoding'), self.settings.transcodeaac, None))
            if SystemInfo['CanPcmMultichannel']:
                self.settings.pcm_multichannel = ConfigOnOff(default=config.av.pcm_multichannel.value)
                self.settings.pcm_multichannel.addNotifier(self.changePCMMultichannel, initial_call=False)
                conflist.append(getConfigListEntry(_('PCM Multichannel'), self.settings.pcm_multichannel, None))
            if n > 0:
                self.audioChannel = service.audioChannel()
                if self.audioChannel:
                    choicelist = [('0', _('left')), ('1', _('stereo')), ('2', _('right'))]
                    self.settings.channelmode = ConfigSelection(choices=choicelist, default=str(self.audioChannel.getCurrentChannel()))
                    self.settings.channelmode.addNotifier(self.changeMode, initial_call=False)
                    conflist.append(getConfigListEntry(_('Channel'), self.settings.channelmode, None))
                selectedAudio = self.audioTracks.getCurrentTrack()
                for x in range(n):
                    number = str(x + 1)
                    i = audio.getTrackInfo(x)
                    languages = i.getLanguage().split('/')
                    description = i.getDescription() or ''
                    selected = ''
                    language = ''
                    if selectedAudio == x:
                        selected = 'X'
                        selectedidx = x
                    cnt = 0
                    for lang in languages:
                        if cnt:
                            language += ' / '
                        if LanguageCodes.has_key(lang):
                            language += _(LanguageCodes[lang][0])
                        else:
                            language += lang
                        cnt += 1

                    streams.append((x,
                     '',
                     number,
                     description,
                     language,
                     selected))

            else:
                conflist.append(('',))
            if SystemInfo['Can3DSurround']:
                choice_list = [('none', _('off')),
                 ('hdmi', _('HDMI')),
                 ('spdif', _('SPDIF')),
                 ('dac', _('DAC'))]
                self.settings.surround_3d = ConfigSelection(choices=choice_list, default=config.av.surround_3d.value)
                self.settings.surround_3d.addNotifier(self.change3DSurround, initial_call=False)
                conflist.append(getConfigListEntry(_('3D Surround'), self.settings.surround_3d, None))
            if SystemInfo['Can3DSpeaker'] and config.av.surround_3d.value != 'none':
                choice_list = [('center', _('center')), ('wide', _('wide')), ('extrawide', _('extra wide'))]
                self.settings.surround_3d_speaker = ConfigSelection(choices=choice_list, default=config.av.surround_3d_speaker.value)
                self.settings.surround_3d_speaker.addNotifier(self.change3DSurroundSpeaker, initial_call=False)
                conflist.append(getConfigListEntry(_('3D Surround Speaker Position'), self.settings.surround_3d_speaker, None))
            if SystemInfo['CanAutoVolume']:
                choice_list = [('none', _('off')),
                 ('hdmi', _('HDMI')),
                 ('spdif', _('SPDIF')),
                 ('dac', _('DAC'))]
                self.settings.autovolume = ConfigSelection(choices=choice_list, default=config.av.autovolume.value)
                self.settings.autovolume.addNotifier(self.changeAutoVolume, initial_call=False)
                conflist.append(getConfigListEntry(_('Auto Volume Level'), self.settings.autovolume, None))
            if SystemInfo['Canedidchecking']:
                choice_list = [('00000001', _('on')), ('00000000', _('off'))]
                self.settings.bypass_edid_checking = ConfigSelection(choices=choice_list, default=config.av.bypass_edid_checking.value)
                self.settings.bypass_edid_checking.addNotifier(self.changeEDIDChecking, initial_call=False)
                conflist.append(getConfigListEntry(_('Bypass HDMI EDID Check'), self.settings.bypass_edid_checking, None))
            from Components.PluginComponent import plugins
            from Plugins.Plugin import PluginDescriptor
            if hasattr(self.infobar, 'runPlugin'):
#.........这里部分代码省略.........
开发者ID:kingvuplus,项目名称:boom,代码行数:101,代码来源:AudioSelection.py

示例14: fillList

	def fillList(self, arg=None):
		streams = []
		conflist = []
		selectedidx = 0
		
		service = self.session.nav.getCurrentService()
		self.audioTracks = audio = service and service.audioTracks()
		n = audio and audio.getNumberOfTracks() or 0
		
		if self.settings.menupage.getValue() == PAGE_AUDIO:
			self.setTitle(_("Select audio track"))
			if SystemInfo["CanDownmixAC3"]:
				self.settings.downmix = ConfigOnOff(default=config.av.downmix_ac3.value)
				self.settings.downmix.addNotifier(self.changeAC3Downmix, initial_call = False)
				conflist.append(getConfigListEntry(_("AC3 downmix"), self.settings.downmix))
				self["key_red"].setBoolean(True)

			if n > 0:
				self.audioChannel = service.audioChannel()
				choicelist = [("0",_("left")), ("1",_("stereo")), ("2", _("right"))]
				self.settings.channelmode = ConfigSelection(choices = choicelist, default = str(self.audioChannel.getCurrentChannel()))
				self.settings.channelmode.addNotifier(self.changeMode, initial_call = False)
				conflist.append(getConfigListEntry(_("Channel"), self.settings.channelmode))
				self["key_green"].setBoolean(True)
				selectedAudio = self.audioTracks.getCurrentTrack()
				for x in range(n):
					number = str(x)
					i = audio.getTrackInfo(x)
					languages = i.getLanguage().split('/')
					description = i.getDescription() or _("<unknown>")
					selected = ""
					language = ""

					if selectedAudio == x:
						selected = _("Running")
						selectedidx = x

					cnt = 0
					for lang in languages:
						if cnt:
							language += ' / '
						if LanguageCodes.has_key(lang):
							language += LanguageCodes[lang][0]
						elif lang == "und":
							_("<unknown>")
						else:
							language += lang
						cnt += 1

					streams.append((x, "", number, description, language, selected))

			else:
				streams = []
				conflist.append(('',))
				self["key_green"].setBoolean(False)

		elif self.settings.menupage.getValue() == PAGE_SUBTITLES:
			self.setTitle(_("Subtitle selection"))
			conflist.append(('',))
			conflist.append(('',))
			self["key_red"].setBoolean(False)
			self["key_green"].setBoolean(False)

			if self.subtitlesEnabled():
				sel = self.infobar.selected_subtitle
			else:
				sel = None

			idx = 0
			
			subtitlelist = self.getSubtitleList()

			if len(subtitlelist):
				for x in subtitlelist:
					number = str(x[1])
					description = "?"
					language = _("<unknown>")
					selected = ""

					if sel and x[:4] == sel[:4]:
						selected = _("Running")
						selectedidx = idx
					
					if x[4] != "und":
						if LanguageCodes.has_key(x[4]):
							language = LanguageCodes[x[4]][0]
						else:
							language = x[4]

					if x[0] == 0:
						description = "DVB"
						number = "%x" % (x[1])

					elif x[0] == 1:
						description = "TTX"
						number = "%x%02x" % (x[3],x[2])

					elif x[0] == 2:
						types = ("UTF-8 text","SSA / AAS",".SRT file")
						description = types[x[2]]
#.........这里部分代码省略.........
开发者ID:FFTEAM,项目名称:enigma2-5,代码行数:101,代码来源:AudioSelectionExtended.py

示例15: subtitleChecker

	def subtitleChecker(self):
		printl("", self, "S")

		try:
			subtitles = self.getCurrentServiceSubtitle()
			subtitlelist = subtitles.getSubtitleList()
			subtitleStreams = []
			printl("subtitles: " + str(subtitles), self, "D")
			printl("what: " + str(subtitlelist), self, "D")

			if len(subtitlelist):
				for x in subtitlelist:
					number = str(x[1])
					description = "?"
					myLanguage = _("<unknown>")
					selected = ""

					if x[4] != "und":
						if LanguageCodes.has_key(x[4]):
							myLanguage = LanguageCodes[x[4]][0]
						else:
							myLanguage = x[4]

					if x[0] == 0:
						description = "DVB"
						number = "%x" % (x[1])

					elif x[0] == 1:
						description = "TTX"
						number = "%x%02x" % (x[3],x[2])

					elif x[0] == 2:
						types = (_("<unknown>"), "UTF-8 text", "SSA", "AAS", ".SRT file", "VOB", "PGS (unsupported)")
						description = types[x[2]]

					subs = (x, "", number, description, myLanguage, selected)

					myLanguageFromPlex = self.subtitleData["languageCode"]

					if LanguageCodes.has_key(myLanguageFromPlex):
						myLanguageFromPlex = LanguageCodes[myLanguageFromPlex][0]

					printl("myLanguage: " + str(myLanguage) + " / myLanguageFromPlex: " + str(myLanguageFromPlex), self, "D")

					if myLanguageFromPlex == myLanguage:
						printl("we have a match ...", self, "D")
						self.enableSubtitleNow(subs[0])
						self.subtitleWatcher.stop()

					else:
						print self.subtitleData
						print myLanguage
						raise Exception

					# just for debugging
					subtitleStreams.append((x, "", number, description, myLanguage, selected))

			printl("subtitleStreams: " + str(subtitleStreams), self, "D")

		except Exception, e:
			printl("Subtitle Message: " + str(e), self, "D")
开发者ID:DonDavici,项目名称:DreamPlex,代码行数:61,代码来源:DP_Player.py


注:本文中的Tools.ISO639.LanguageCodes类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。